diff options
author | Kim Alvefur <zash@zash.se> | 2018-10-07 03:48:13 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-10-07 03:48:13 +0200 |
commit | 07502b5698cadd9513bd73a965cdee56f496f02c (patch) | |
tree | fcfe9301f7339fd936d86f01c0bcdf5f632ba290 /plugins/muc/muc.lib.lua | |
parent | 18f98f701791369a09617ef5ce7652190c7952b2 (diff) | |
download | prosody-07502b5698cadd9513bd73a965cdee56f496f02c.tar.gz prosody-07502b5698cadd9513bd73a965cdee56f496f02c.zip |
MUC: Respond to ping per XEP-0410: MUC Self-Ping server optimization (closes #1220)
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 4d986457..8e039457 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -734,6 +734,11 @@ function room_mt:handle_iq_to_occupant(origin, stanza) origin.send(st.error_reply(stanza, "cancel", "item-not-found", "Recipient not in room")); return true; end + -- XEP-0410 MUC Self-Ping #1220 + if to == current_nick and stanza.attr.type == "get" and stanza:get_child("ping", "urn:xmpp:ping") then + self:route_stanza(st.reply(stanza)); + return true; + end do -- construct_stanza_id stanza.attr.id = base64.encode(occupant.jid.."\0"..stanza.attr.id.."\0"..md5(from)); end |