Comparison

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
comparison
equal deleted inserted replaced
11428:d91def9fcfdd 11429:ef623d719894
515 return true; 515 return true;
516 end 516 end
517 local ok, ret = service:remove_subscription(node, stanza.attr.from, jid); 517 local ok, ret = service:remove_subscription(node, stanza.attr.from, jid);
518 local reply; 518 local reply;
519 if ok then 519 if ok then
520 reply = st.reply(stanza); 520 reply = st.reply(stanza)
521 :tag("pubsub", { xmlns = xmlns_pubsub })
522 :tag("subscription", {
523 node = node,
524 jid = jid,
525 subscription = "none"
526 }):up();
521 else 527 else
522 reply = pubsub_error_reply(stanza, ret); 528 reply = pubsub_error_reply(stanza, ret);
523 end 529 end
524 origin.send(reply); 530 origin.send(reply);
525 return true; 531 return true;