Software /
code /
prosody
Changeset
9368:0c5177738ffd
mod_scansion_record: Record connected clients as scansion Objects declarations
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 22 Sep 2018 18:32:22 +0200 |
parents | 9367:577c3a7f5045 |
children | 9369:dd452f932b67 |
files | plugins/mod_scansion_record.lua |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_scansion_record.lua Sat Sep 22 17:24:28 2018 +0200 +++ b/plugins/mod_scansion_record.lua Sat Sep 22 18:32:22 2018 +0200 @@ -23,6 +23,14 @@ head:write(string); end +local function record_object(class, name, props) + head:write(("[%s] %s\n"):format(class, name)); + for k,v in pairs(props) do + head:write(("\t%s: %s\n"):format(k, v)); + end + head:write("\n"); +end + local function record_event(session, event) record(session.scansion_id.." "..event.."\n\n"); end @@ -67,6 +75,11 @@ session.scansion_device = device; session.scansion_id = user.character..(device ~= "" and "'s "..device or device); + record_object("Client", user.character, { + jid = session.full_jid, + password = "password", + }); + module:log("warn", "Connected: %s's %s", user.character, device); record_event(session, "connects");