diff options
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r-- | core/rostermanager.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua index 65be0de0..61b08002 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -11,11 +11,13 @@ local log = require "util.logger".init("rostermanager"); +local new_id = require "util.id".short; + local pairs = pairs; local tostring = tostring; local type = type; -local hosts = hosts; +local hosts = prosody.hosts; local bare_sessions = prosody.bare_sessions; local um_user_exists = require "core.usermanager".user_exists; @@ -23,6 +25,7 @@ local st = require "util.stanza"; local storagemanager = require "core.storagemanager"; local _ENV = nil; +-- luacheck: std none local save_roster; -- forward declaration @@ -60,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}); |