Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 9444:7c1cdf5f9f83
MUC: Respond to ping per XEP-0410: MUC Self-Ping server optimization (closes #1220)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 07 Oct 2018 03:48:13 +0200 |
| parents | a47bba3b35f3 |
| children | 3bc5c22e2ca4 |
comparison
equal
deleted
inserted
replaced
| 9443:4e881be88727 | 9444:7c1cdf5f9f83 |
|---|---|
| 732 end | 732 end |
| 733 if not occupant then -- recipient not in room | 733 if not occupant then -- recipient not in room |
| 734 origin.send(st.error_reply(stanza, "cancel", "item-not-found", "Recipient not in room")); | 734 origin.send(st.error_reply(stanza, "cancel", "item-not-found", "Recipient not in room")); |
| 735 return true; | 735 return true; |
| 736 end | 736 end |
| 737 -- XEP-0410 MUC Self-Ping #1220 | |
| 738 if to == current_nick and stanza.attr.type == "get" and stanza:get_child("ping", "urn:xmpp:ping") then | |
| 739 self:route_stanza(st.reply(stanza)); | |
| 740 return true; | |
| 741 end | |
| 737 do -- construct_stanza_id | 742 do -- construct_stanza_id |
| 738 stanza.attr.id = base64.encode(occupant.jid.."\0"..stanza.attr.id.."\0"..md5(from)); | 743 stanza.attr.id = base64.encode(occupant.jid.."\0"..stanza.attr.id.."\0"..md5(from)); |
| 739 end | 744 end |
| 740 stanza.attr.from, stanza.attr.to = current_nick, occupant.jid; | 745 stanza.attr.from, stanza.attr.to = current_nick, occupant.jid; |
| 741 log("debug", "%s sent private iq stanza to %s (%s)", from, to, occupant.jid); | 746 log("debug", "%s sent private iq stanza to %s (%s)", from, to, occupant.jid); |
