Diff

mod_pubsub_text_interface/mod_pubsub_text_interface.lua @ 3247:ada7a0c7221c

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.
author Kim Alvefur <zash@zash.se>
date Mon, 20 Aug 2018 22:52:20 +0200
parent 3243:ca856a892719
child 3248:ecec46f7d020
line wrap: on
line diff
--- 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);