Software /
code /
prosody-modules
Comparison
mod_muc_block_pm/mod_muc_block_pm.lua @ 4027:291a45919988
mod_muc_block_pm: Don't respond to error stanzas
author | JC Brand <jc@opkode.com> |
---|---|
date | Wed, 20 May 2020 11:11:11 +0200 |
parent | 3636:afedc2430b0d |
child | 5598:c7e532ac6bf7 |
comparison
equal
deleted
inserted
replaced
4026:e3964f876b5d | 4027:291a45919988 |
---|---|
9 return rooms[jid]; | 9 return rooms[jid]; |
10 end | 10 end |
11 | 11 |
12 module:hook("message/full", function(event) | 12 module:hook("message/full", function(event) |
13 local stanza, origin = event.stanza, event.origin; | 13 local stanza, origin = event.stanza, event.origin; |
14 if stanza.attr.type == "error" then | |
15 return | |
16 end | |
14 local to, from = stanza.attr.to, stanza.attr.from; | 17 local to, from = stanza.attr.to, stanza.attr.from; |
15 local room = get_room_from_jid(bare_jid(to)); | 18 local room = get_room_from_jid(bare_jid(to)); |
16 local to_occupant = room and room._occupants[to]; | 19 local to_occupant = room and room._occupants[to]; |
17 local from_occupant = room and room._occupants[room._jid_nick[from]] | 20 local from_occupant = room and room._occupants[room._jid_nick[from]] |
18 if not ( to_occupant and from_occupant ) then return end | 21 if not ( to_occupant and from_occupant ) then return end |