# HG changeset patch # User Kim Alvefur # Date 1481215883 -3600 # Node ID 63f50a84318f37225c5278b8683971fc751f145f # Parent 3733bdbe0b22003bffeac67dabd498d41c10b7e7 mod_carbons: Rename some variables for clarity diff -r 3733bdbe0b22 -r 63f50a84318f plugins/mod_carbons.lua --- a/plugins/mod_carbons.lua Mon Dec 05 17:35:38 2016 +0100 +++ b/plugins/mod_carbons.lua Thu Dec 08 17:51:23 2016 +0100 @@ -24,21 +24,23 @@ local origin, stanza = event.origin, event.stanza; local orig_type = stanza.attr.type or "normal"; local orig_from = stanza.attr.from; + local bare_from = jid_bare(orig_from); local orig_to = stanza.attr.to; - + local bare_to = jid_bare(orig_to); + if not(orig_type == "chat" or (orig_type == "normal" and stanza:get_child("body"))) then return -- Only chat type messages end -- Stanza sent by a local client - local bare_jid = jid_bare(orig_from); + local bare_jid = bare_from; -- JID of the local user local target_session = origin; local top_priority = false; - local user_sessions = bare_sessions[bare_jid]; + local user_sessions = bare_sessions[bare_from]; -- Stanza about to be delivered to a local client if not c2s then - bare_jid = jid_bare(orig_to); + bare_jid = bare_to; target_session = full_sessions[orig_to]; user_sessions = bare_sessions[bare_jid]; if not target_session and user_sessions then