mod_pubsub_text_interface: Generate a stanza id for replies
authorKim Alvefur <zash@zash.se>
Mon, 20 Aug 2018 22:52:20 +0200
changeset 3251 ada7a0c7221c
parent 3250 2a54b331f011
child 3252 ecec46f7d020
mod_pubsub_text_interface: Generate a stanza id for replies This may be needed for some clients that de-duplicate messages based on stanza id.
mod_pubsub_text_interface/mod_pubsub_text_interface.lua
--- a/mod_pubsub_text_interface/mod_pubsub_text_interface.lua	Mon Aug 20 21:40:48 2018 +0200
+++ b/mod_pubsub_text_interface/mod_pubsub_text_interface.lua	Mon Aug 20 22:52:20 2018 +0200
@@ -1,5 +1,6 @@
 local st = require "util.stanza";
 local jid = require "util.jid";
+local id = require "util.id";
 
 local pubsub = module:depends "pubsub".service;
 
@@ -23,6 +24,7 @@
 	local from = stanza.attr.from;
 
 	local reply = st.reply(stanza);
+	reply.attr.id = id.medium();
 
 	if body == "help" then
 		reply:body(help);