# HG changeset patch # User Kim Alvefur # Date 1396477158 -7200 # Node ID 92f3b4d81b525c7df1aef0665a2c1bf8377f33b1 # Parent f4de4a35778dd44ca319129bfcc226026235b628 mod_message_logging: Treat messages with no 'to' as directed to the sender diff -r f4de4a35778d -r 92f3b4d81b52 mod_message_logging/mod_message_logging.lua --- 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();