Software /
code /
prosody
Diff
plugins/mod_pubsub/pubsub.lib.lua @ 11429:ef623d719894
mod_pubsub: Include <pubsub> with unsubscribe reply
XEP-0060 6.2.2
This is a MAY but it makes it nice and symmetric with the subscription
response. Reduces the need to remember which node you unsubscribed from.
Explicit > implicit etc.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 15 Mar 2021 19:04:08 +0100 |
parent | 11187:76e135fbca0f |
child | 11631:6641ca266d94 |
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua Sat Mar 06 18:26:50 2021 +0100 +++ b/plugins/mod_pubsub/pubsub.lib.lua Mon Mar 15 19:04:08 2021 +0100 @@ -517,7 +517,13 @@ local ok, ret = service:remove_subscription(node, stanza.attr.from, jid); local reply; if ok then - reply = st.reply(stanza); + reply = st.reply(stanza) + :tag("pubsub", { xmlns = xmlns_pubsub }) + :tag("subscription", { + node = node, + jid = jid, + subscription = "none" + }):up(); else reply = pubsub_error_reply(stanza, ret); end