Software /
code /
verse
Diff
plugins/presence.lua @ 476:c34b263499be
presence: Clone stanza before caching it
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 17 Mar 2023 11:18:39 +0000 |
parent | 406:3c732f1d990c |
child | 490:6b2f31da9610 |
line wrap: on
line diff
--- a/plugins/presence.lua Fri Mar 17 11:15:18 2023 +0000 +++ b/plugins/presence.lua Fri Mar 17 11:18:39 2023 +0000 @@ -1,11 +1,13 @@ local verse = require "verse"; +local st = require "util.stanza"; function verse.plugins.presence(stream) stream.last_presence = nil; stream:hook("presence-out", function (presence) if not presence.attr.to then - stream.last_presence = presence; -- Cache non-directed presence + -- Clone so we don't add stuff over and over..? + stream.last_presence = st.clone(presence); -- Cache non-directed presence end end, 1);