Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 8486:c50101b527bf
MUC: Hook the correct event
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 23 Dec 2017 06:17:11 +0100 |
| parents | 8b2219011386 |
| children | e7808f8d7d11 |
comparison
equal
deleted
inserted
replaced
| 8485:0e02c6de5c02 | 8486:c50101b527bf |
|---|---|
| 170 self:broadcast(stanza); | 170 self:broadcast(stanza); |
| 171 return true; | 171 return true; |
| 172 end | 172 end |
| 173 | 173 |
| 174 -- Strip delay tags claiming to be from us | 174 -- Strip delay tags claiming to be from us |
| 175 module:hook("muc-occupant-message", function (event) | 175 module:hook("muc-occupant-groupchat", function (event) |
| 176 local stanza = event.stanza; | 176 local stanza = event.stanza; |
| 177 local to = stanza.attr.to; | 177 local room = event.room; |
| 178 local room_jid = self.jid; | 178 local room_jid = room.jid; |
| 179 | 179 |
| 180 stanza:maptags(function (child) | 180 stanza:maptags(function (child) |
| 181 if child.name == "delay" and child.attr["xmlns"] == "urn:xmpp:delay" then | 181 if child.name == "delay" and child.attr["xmlns"] == "urn:xmpp:delay" then |
| 182 if child.attr["from"] == room_jid then | 182 if child.attr["from"] == room_jid then |
| 183 return nil; | 183 return nil; |
