Software /
code /
prosody
Comparison
plugins/mod_carbons.lua @ 10786:a1b633ba9bd9
mod_carbons: Check for and strip 'private' tag before stopping
This was explicit previously
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 27 Apr 2020 14:46:15 +0200 |
parent | 10785:e210afc9296a |
child | 10802:c11f9cd6c761 |
comparison
equal
deleted
inserted
replaced
10785:e210afc9296a | 10786:a1b633ba9bd9 |
---|---|
90 | 90 |
91 local should, why = should_copy(stanza, c2s, bare_jid); | 91 local should, why = should_copy(stanza, c2s, bare_jid); |
92 | 92 |
93 if not should then | 93 if not should then |
94 module:log("debug", "Not copying stanza: %s (%s)", stanza:top_tag(), why); | 94 module:log("debug", "Not copying stanza: %s (%s)", stanza:top_tag(), why); |
95 return; | 95 if why == "private" and not c2s then |
96 elseif why == "private" and not c2s then | |
97 stanza:maptags(function(tag) | 96 stanza:maptags(function(tag) |
98 if not ( tag.attr.xmlns == xmlns_carbons and tag.name == "private" ) then | 97 if not ( tag.attr.xmlns == xmlns_carbons and tag.name == "private" ) then |
99 return tag; | 98 return tag; |
100 end | 99 end |
101 end); | 100 end); |
101 end | |
102 return; | |
102 end | 103 end |
103 | 104 |
104 local carbon; | 105 local carbon; |
105 user_sessions = user_sessions and user_sessions.sessions; | 106 user_sessions = user_sessions and user_sessions.sessions; |
106 for _, session in pairs(user_sessions) do | 107 for _, session in pairs(user_sessions) do |