diff mod_http_roster_admin/mod_http_roster_admin.lua @ 3316:9d8098f4b652

mod_http_roster_admin: Explicitly set 'id' attribute on roster pushes
author Matthew Wild <mwild1@gmail.com>
date Thu, 13 Sep 2018 16:14:41 +0100
parents 2bfa7d476092
children 7d2400710d65
line wrap: on
line diff
--- a/mod_http_roster_admin/mod_http_roster_admin.lua	Wed Sep 12 18:54:49 2018 +0200
+++ b/mod_http_roster_admin/mod_http_roster_admin.lua	Thu Sep 13 16:14:41 2018 +0100
@@ -22,6 +22,8 @@
 local st = require "util.stanza";
 local array = require "util.array";
 
+local new_id = require "util.id".short;
+
 local host = module.host;
 local sessions = hosts[host].sessions;
 
@@ -30,7 +32,7 @@
 -- Send a roster push to the named user, with the given roster, for the specified
 -- contact's roster entry. Used to notify clients of changes/removals.
 local function roster_push(username, roster, contact_jid)
-	local stanza = st.iq({type="set"})
+	local stanza = st.iq({type="set", id=new_id()})
 		:tag("query", {xmlns = "jabber:iq:roster" });
 	local item = roster[contact_jid];
 	if item then