Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 9194:11a0b32fef24
MUC: Direct PubSub queries to occupants to their real bare JID
This allows accessing PEP nodes of participants without knowing their
real JIDs.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 18 Aug 2018 14:06:23 +0200 |
| parents | a474c94d0b0a |
| children | b86c2e135797 |
comparison
equal
deleted
inserted
replaced
| 9193:aba99b6539f5 | 9194:11a0b32fef24 |
|---|---|
| 725 do -- construct_stanza_id | 725 do -- construct_stanza_id |
| 726 stanza.attr.id = base64.encode(occupant.jid.."\0"..stanza.attr.id.."\0"..md5(from)); | 726 stanza.attr.id = base64.encode(occupant.jid.."\0"..stanza.attr.id.."\0"..md5(from)); |
| 727 end | 727 end |
| 728 stanza.attr.from, stanza.attr.to = current_nick, occupant.jid; | 728 stanza.attr.from, stanza.attr.to = current_nick, occupant.jid; |
| 729 log("debug", "%s sent private iq stanza to %s (%s)", from, to, occupant.jid); | 729 log("debug", "%s sent private iq stanza to %s (%s)", from, to, occupant.jid); |
| 730 if stanza.tags[1].attr.xmlns == 'vcard-temp' then | 730 local iq_ns = stanza.tags[1].attr.xmlns; |
| 731 if iq_ns == 'vcard-temp' or iq_ns == "http://jabber.org/protocol/pubsub" then | |
| 731 stanza.attr.to = jid_bare(stanza.attr.to); | 732 stanza.attr.to = jid_bare(stanza.attr.to); |
| 732 end | 733 end |
| 733 self:route_stanza(stanza); | 734 self:route_stanza(stanza); |
| 734 stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id; | 735 stanza.attr.from, stanza.attr.to, stanza.attr.id = from, to, id; |
| 735 return true; | 736 return true; |
