Software /
code /
prosody-modules
Diff
mod_message_logging/mod_message_logging.lua @ 1377:92f3b4d81b52
mod_message_logging: Treat messages with no 'to' as directed to the sender
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 03 Apr 2014 00:19:18 +0200 |
parent | 1343:7dbde05b48a9 |
child | 1500:045720a5fccd |
line wrap: on
line diff
--- a/mod_message_logging/mod_message_logging.lua Wed Apr 02 13:32:00 2014 +0200 +++ b/mod_message_logging/mod_message_logging.lua Thu Apr 03 00:19:18 2014 +0200 @@ -56,7 +56,7 @@ if message_type == "error" then return; end - local from, to = jid_bare(stanza.attr.from), jid_bare(stanza.attr.to); + local from, to = jid_bare(stanza.attr.from), jid_bare(stanza.attr.to or stanza.attr.from); local body = stanza:get_child("body"); if not body then return; end body = body:get_text(); @@ -78,7 +78,7 @@ if message_type == "error" or message_type == "groupchat" then return; end - local from, to = jid_bare(stanza.attr.from), jid_bare(stanza.attr.to); + local from, to = jid_bare(stanza.attr.from), jid_bare(stanza.attr.to or origin.full_jid); local body = stanza:get_child("body"); if not body then return; end body = body:get_text();