# HG changeset patch # User Matthew Wild # Date 1588089261 -3600 # Node ID 67047ed63b15bc58827dc00358ea36bcf05527ae # Parent 0e72dd70afff8e6029085157f8e5b91f1595fb1c mod_muc_rai: Ignore attempts to re-subscribe from the same full JID diff -r 0e72dd70afff -r 67047ed63b15 mod_muc_rai/mod_muc_rai.lua --- a/mod_muc_rai/mod_muc_rai.lua Tue Apr 28 10:03:17 2020 +0100 +++ b/mod_muc_rai/mod_muc_rai.lua Tue Apr 28 16:54:21 2020 +0100 @@ -137,9 +137,17 @@ return muc_affiliation_store:get_all(jid.bare(user_jid)); end +local function is_subscribed(user_jid) + return not not subscribed_users:get(user_jid); +end + -- Subscribes to all rooms that the user has an interest in -- Returns a set of room JIDs that have already had activity (thus no subscription) local function subscribe_all_rooms(user_jid) + if is_subscribed(user_jid) then + return nil; + end + -- Send activity notifications for all relevant rooms local interested_rooms, err = get_interested_rooms(user_jid);