aboutsummaryrefslogtreecommitdiffstats
path: root/core/rostermanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-09-13 16:08:38 +0100
committerMatthew Wild <mwild1@gmail.com>2018-09-13 16:08:38 +0100
commitfae3c34ef6a5b6accb0ea3cc289fae663eaf3f9b (patch)
tree682735898d2d280cb0a480210482341d52984326 /core/rostermanager.lua
parent2854d8c2b0d0ec0dd6624401e7a47bed1aa59359 (diff)
downloadprosody-fae3c34ef6a5b6accb0ea3cc289fae663eaf3f9b.tar.gz
prosody-fae3c34ef6a5b6accb0ea3cc289fae663eaf3f9b.zip
rostermanager: Use util.id to generate ids for roster pushed
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r--core/rostermanager.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua
index aa1ba9f3..61b08002 100644
--- a/core/rostermanager.lua
+++ b/core/rostermanager.lua
@@ -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 function roster_push(username, host, jid)
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});