aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-26 22:22:14 +0200
committerKim Alvefur <zash@zash.se>2017-10-26 22:22:14 +0200
commit1e7a4fc6a4b23c60ccf808a8191a1d34543c35da (patch)
tree62fce1427bcc4eda8fc075897796ab381a10af8d
parent155e81d053abb8d12f2812d3c4d1fd92289d7237 (diff)
downloadprosody-im-server-1e7a4fc6a4b23c60ccf808a8191a1d34543c35da.zip
prosody-im-server-1e7a4fc6a4b23c60ccf808a8191a1d34543c35da.tar
mod_carbons: Synthesize a 'to' attribute for carbons of stanzas to "self" (fixes #956)
-rw-r--r--plugins/mod_carbons.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_carbons.lua b/plugins/mod_carbons.lua
index cb7d9233..1dcd4a07 100644
--- a/plugins/mod_carbons.lua
+++ b/plugins/mod_carbons.lua
@@ -76,6 +76,9 @@ local function message_handler(event, c2s)
-- Create the carbon copy and wrap it as per the Stanza Forwarding XEP
local copy = st.clone(stanza);
+ if c2s and not orig_to then
+ stanza.attr.to = bare_from;
+ end
copy.attr.xmlns = "jabber:client";
local carbon = st.message{ from = bare_jid, type = orig_type, }
:tag(c2s and "sent" or "received", { xmlns = xmlns_carbons })