Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6229:8aa59b73f801
plugins/muc/muc.lib: Remove reversed conditionals when firing pre- events
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Mon, 21 Apr 2014 17:39:18 -0400 |
| parents | bb75c011b15e |
| children | bc12a8253f94 |
comparison
equal
deleted
inserted
replaced
| 6228:4968d18e2c1e | 6229:8aa59b73f801 |
|---|---|
| 820 local payload = stanza:get_child("x", "http://jabber.org/protocol/muc#user"):get_child("invite"); | 820 local payload = stanza:get_child("x", "http://jabber.org/protocol/muc#user"):get_child("invite"); |
| 821 local invitee = jid_prep(payload.attr.to); | 821 local invitee = jid_prep(payload.attr.to); |
| 822 if not invitee then | 822 if not invitee then |
| 823 origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); | 823 origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); |
| 824 return true; | 824 return true; |
| 825 elseif not module:fire_event("muc-pre-invite", {room = self, origin = origin, stanza = stanza}) then | 825 elseif module:fire_event("muc-pre-invite", {room = self, origin = origin, stanza = stanza}) then |
| 826 return true; | 826 return true; |
| 827 end | 827 end |
| 828 local invite = st.message({from = self.jid, to = invitee, id = stanza.attr.id}) | 828 local invite = st.message({from = self.jid, to = invitee, id = stanza.attr.id}) |
| 829 :tag('x', {xmlns='http://jabber.org/protocol/muc#user'}) | 829 :tag('x', {xmlns='http://jabber.org/protocol/muc#user'}) |
| 830 :tag('invite', {from = stanza.attr.from;}) | 830 :tag('invite', {from = stanza.attr.from;}) |
| 861 local payload = stanza:get_child("x", "http://jabber.org/protocol/muc#user"):get_child("decline"); | 861 local payload = stanza:get_child("x", "http://jabber.org/protocol/muc#user"):get_child("decline"); |
| 862 local declinee = jid_prep(payload.attr.to); | 862 local declinee = jid_prep(payload.attr.to); |
| 863 if not declinee then | 863 if not declinee then |
| 864 origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); | 864 origin.send(st.error_reply(stanza, "cancel", "jid-malformed")); |
| 865 return true; | 865 return true; |
| 866 elseif not module:fire_event("muc-pre-decline", {room = self, origin = origin, stanza = stanza}) then | 866 elseif module:fire_event("muc-pre-decline", {room = self, origin = origin, stanza = stanza}) then |
| 867 return true; | 867 return true; |
| 868 end | 868 end |
| 869 local decline = st.message({from = self.jid, to = declinee, id = stanza.attr.id}) | 869 local decline = st.message({from = self.jid, to = declinee, id = stanza.attr.id}) |
| 870 :tag("x", {xmlns = "http://jabber.org/protocol/muc#user"}) | 870 :tag("x", {xmlns = "http://jabber.org/protocol/muc#user"}) |
| 871 :tag("decline", {from = stanza.attr.from}) | 871 :tag("decline", {from = stanza.attr.from}) |
