Mercurial > prosody-modules
comparison mod_rest/mod_rest.lua @ 3821:11272a3233ce
mod_rest: Fix replying to groupchat messages
Groupchat replies need to go back to the room instead of the
participants full JID
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 01 Jan 2020 18:41:04 +0100 |
parents | 8473fd2d09c1 |
children | a0b8ec44a36b |
comparison
equal
deleted
inserted
replaced
3820:d3757e089433 | 3821:11272a3233ce |
---|---|
218 to = stanza.attr.from, | 218 to = stanza.attr.from, |
219 id = parsed.attr.id or id.medium(); | 219 id = parsed.attr.id or id.medium(); |
220 type = parsed.attr.type, | 220 type = parsed.attr.type, |
221 ["xml:lang"] = parsed.attr["xml:lang"], | 221 ["xml:lang"] = parsed.attr["xml:lang"], |
222 }; | 222 }; |
223 if parsed.name == "message" and parsed.attr.type == "groupchat" then | |
224 parsed.attr.to = jid.bare(stanza.attr.from); | |
225 end | |
223 if parsed.name == "iq" or parsed.attr.type == "error" then | 226 if parsed.name == "iq" or parsed.attr.type == "error" then |
224 parsed.attr.id = stanza.attr.id; | 227 parsed.attr.id = stanza.attr.id; |
225 end | 228 end |
226 reply = parsed; | 229 reply = parsed; |
227 end | 230 end |