# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1536851318 -3600
# Node ID 72f0862978ef2d3d0107e93eeb6977dcdb9c8a74
# Parent  57f8e41255fb40cce8e04c2cbdc5f6ebeb424f74
rostermanager: Use util.id to generate ids for roster pushed

diff -r 57f8e41255fb -r 72f0862978ef core/rostermanager.lua
--- a/core/rostermanager.lua	Thu Sep 13 15:37:42 2018 +0100
+++ b/core/rostermanager.lua	Thu Sep 13 16:08:38 2018 +0100
@@ -11,6 +11,8 @@
 
 local log = require "util.logger".init("rostermanager");
 
+local new_id = require "util.id".short;
+
 local pairs = pairs;
 local tostring = tostring;
 local type = type;
@@ -61,7 +63,7 @@
 	local roster = jid and hosts[host] and hosts[host].sessions[username] and hosts[host].sessions[username].roster;
 	if roster then
 		local item = hosts[host].sessions[username].roster[jid];
-		local stanza = st.iq({type="set"});
+		local stanza = st.iq({type="set", id=new_id()});
 		stanza:tag("query", {xmlns = "jabber:iq:roster", ver = tostring(roster[false].version or "1")  });
 		if item then
 			stanza:tag("item", {jid = jid, subscription = item.subscription, name = item.name, ask = item.ask});