Software / code / prosody
Comparison
plugins/muc/muc.lib.lua @ 10662:46373b97e648
mod_muc: add muc-private-message event
This seems to be the one place handling MUC-PMs. This event is added so that
plugins (such as muc_occupant_id) can edit them without having to redo the work.
| author | Maxime “pep” Buquet <pep@bouah.net> |
|---|---|
| date | Mon, 24 Feb 2020 14:16:45 +0100 |
| parent | 10553:4d8119ffd433 |
| child | 10684:de607875d4bd |
comparison
equal
deleted
inserted
replaced
| 10661:4eee1aaa9405 | 10662:46373b97e648 |
|---|---|
| 812 end | 812 end |
| 813 log("debug", "%s sent private message stanza to %s (%s)", from, to, o_data.jid); | 813 log("debug", "%s sent private message stanza to %s (%s)", from, to, o_data.jid); |
| 814 stanza = muc_util.filter_muc_x(st.clone(stanza)); | 814 stanza = muc_util.filter_muc_x(st.clone(stanza)); |
| 815 stanza:tag("x", { xmlns = "http://jabber.org/protocol/muc#user" }):up(); | 815 stanza:tag("x", { xmlns = "http://jabber.org/protocol/muc#user" }):up(); |
| 816 stanza.attr.from = current_nick; | 816 stanza.attr.from = current_nick; |
| 817 self:route_to_occupant(o_data, stanza) | 817 if module:fire_event("muc-private-message", { room = self, origin = origin, stanza = stanza }) ~= false then |
| 818 self:route_to_occupant(o_data, stanza) | |
| 819 end | |
| 818 -- TODO: Remove x tag? | 820 -- TODO: Remove x tag? |
| 819 stanza.attr.from = from; | 821 stanza.attr.from = from; |
| 820 return true; | 822 return true; |
| 821 end | 823 end |
| 822 | 824 |