# HG changeset patch # User Matthew Wild # Date 1682611128 -3600 # Node ID ad6e9b0fd15bff40cc0fa3353c46c7be6ce098cd # Parent 8b7d97f0ae8aa5c7de0d838eb38183554cd987f7 mod_remote_roster: Set id on generated iq stanzas (thanks @agwa) Fixes 'iq stanzas require an id attribute' error from util.stanza. diff -r 8b7d97f0ae8a -r ad6e9b0fd15b mod_remote_roster/mod_remote_roster.lua --- a/mod_remote_roster/mod_remote_roster.lua Wed Apr 26 23:41:49 2023 +0200 +++ b/mod_remote_roster/mod_remote_roster.lua Thu Apr 27 16:58:48 2023 +0100 @@ -19,6 +19,7 @@ local rm_roster_push = require "core.rostermanager".roster_push; local user_exists = require "core.usermanager".user_exists; local add_task = require "util.timer".add_task; +local new_id = require "util.id".short; module:hook("iq-get/bare/jabber:iq:roster:query", function(event) local origin, stanza = event.origin, event.stanza; @@ -138,7 +139,7 @@ if roster then local item = roster[jid]; local contact_node, contact_host = jid_split(jid); - local stanza = st.iq({ type="set", from=node.."@"..host, to=contact_host }):query("jabber:iq:roster"); + local stanza = st.iq({ type="set", from=node.."@"..host, to=contact_host, id = new_id() }):query("jabber:iq:roster"); if item then stanza:tag("item", { jid = jid, subscription = item.subscription, name = item.name, ask = item.ask }); for group in pairs(item.groups) do