Software /
code /
prosody-modules
Changeset
6171:44f77f4f653a
mod_storage_metronome_readonly: Revert non-working is_muc hack, the correct with is "message<groupchat"
author | Link Mauve <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 28 Jan 2025 01:58:45 +0100 |
parents | 6170:ec0e9d4f2275 |
children | 6172:983549664bd4 |
files | mod_storage_metronome_readonly/mod_storage_metronome_readonly.lua |
diffstat | 1 files changed, 11 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_storage_metronome_readonly/mod_storage_metronome_readonly.lua Tue Jan 28 00:35:39 2025 +0100 +++ b/mod_storage_metronome_readonly/mod_storage_metronome_readonly.lua Tue Jan 28 01:58:45 2025 +0100 @@ -164,7 +164,7 @@ return datamanager.users(host, store, self.type); end -local function parse_logs(logs, is_muc) +local function parse_logs(logs) local iter = ipairs(logs); local i = 0; local message; @@ -175,18 +175,14 @@ end local with; - if is_muc then - with = message["resource"]; + local bare_to = message["bare_to"]; + local bare_from = message["bare_from"]; + if jid == bare_to then + -- received + with = bare_from; else - local bare_to = message["bare_to"]; - local bare_from = message["bare_from"]; - if jid == bare_to then - -- received - with = bare_from; - else - -- sent - with = bare_to; - end + -- sent + with = bare_to; end local to = message["to"]; @@ -347,8 +343,8 @@ module:log("error", "Unable to load metronome storage"); return nil, "Error reading storage"; end - for key, item, when, with in parse_logs(data, true) do - table.insert(list, {key, item, when, with}); + for key, item, when in parse_logs(data) do + table.insert(list, {key, item, when}); end end end @@ -368,7 +364,7 @@ end return end - return item[1], item[2], item[3], item[4]; + return item[1], item[2], item[3], "message<groupchat" end else