diff options
author | John Smith <mrdoctorwho@helldev.net> | 2019-09-06 05:35:38 +0300 |
---|---|---|
committer | John Smith <mrdoctorwho@helldev.net> | 2019-09-06 05:35:38 +0300 |
commit | 87302c58d20cd6d23adad000c613776cc2be8c3d (patch) | |
tree | 60a619ea287226a6a4dd7b6f20da88bac9dfe003 /modules | |
parent | 72a074f2a04bac12c92e45b7d01990680fda3ee0 (diff) |
Change isAppUser method to users.get
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mod_msg_main.py | 4 | ||||
-rw-r--r-- | modules/mod_msg_xhtml.py | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/modules/mod_msg_main.py b/modules/mod_msg_main.py index a1bd57d..7a3410e 100644 --- a/modules/mod_msg_main.py +++ b/modules/mod_msg_main.py @@ -57,6 +57,10 @@ def message_handler(cl, msg): jidTo = msg.getTo() destination = jidTo.getStripped() jidFrom = msg.getFrom() + if isinstance(jidFrom, (str, unicode)): + logger.warning("Received message did not contain a valid jid: %s", msg) + raise xmpp.NodeProcessed() + source = jidFrom.getStripped() if msg.getType() == "chat" and source in Users: diff --git a/modules/mod_msg_xhtml.py b/modules/mod_msg_xhtml.py index fa12a74..8122a61 100644 --- a/modules/mod_msg_xhtml.py +++ b/modules/mod_msg_xhtml.py @@ -9,7 +9,11 @@ import mod_xhtml def xhtml_handler(cl, msg): destination = msg.getTo().getStripped() - source = msg.getFrom().getStripped() + source = msg.getFrom() + if isinstance(source, (str, unicode)): + logger.warning("Received message did not contain a valid jid: %s", msg) + raise xmpp.NodeProcessed() + source = source.getStripped() if source in Users and msg.getType() == "chat": user = Users[source] html = msg.getTag("html") |