# HG changeset patch # User Kim Alvefur # Date 1482410424 -3600 # Node ID deedb77c4f9668a5937a41865ae33c4919c5f869 # Parent 26c68a5f432fb7f03450f845289647df2dfaf311 mod_mam_muc: Rename room and room JID variables for consistency diff -r 26c68a5f432f -r deedb77c4f96 mod_mam_muc/mod_mam_muc.lua --- a/mod_mam_muc/mod_mam_muc.lua Mon Dec 19 07:51:23 2016 +0100 +++ b/mod_mam_muc/mod_mam_muc.lua Thu Dec 22 13:40:24 2016 +0100 @@ -155,22 +155,22 @@ -- Handle archive queries module:hook("iq-set/bare/"..xmlns_mam..":query", function(event) local origin, stanza = event.origin, event.stanza; - local room = stanza.attr.to; - local room_node = jid_split(room); + local room_jid = stanza.attr.to; + local room_node = jid_split(room_jid); local orig_from = stanza.attr.from; local query = stanza.tags[1]; - local room_obj = get_room_from_jid(room); - if not room_obj then + local room = get_room_from_jid(room_jid); + if not room then origin.send(st.error_reply(stanza, "cancel", "item-not-found")) return true; end local from = jid_bare(orig_from); -- Banned or not a member of a members-only room? - local from_affiliation = room_obj:get_affiliation(from); + local from_affiliation = room:get_affiliation(from); if from_affiliation == "outcast" -- banned - or room_obj:get_members_only() and not from_affiliation then -- members-only, not a member + or room:get_members_only() and not from_affiliation then -- members-only, not a member origin.send(st.error_reply(stanza, "auth", "forbidden")) return true; end