diff options
author | Kim Alvefur <zash@zash.se> | 2018-09-22 18:32:22 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-09-22 18:32:22 +0200 |
commit | 74ae56ade698a5530125926ac74509e80f9c8ff8 (patch) | |
tree | f75ad63779c9e7d56aa5c24d0b66fcf65132783e /plugins/mod_scansion_record.lua | |
parent | 61d21c9a6538cbc3be605c5b18859eb0e3dbd947 (diff) | |
download | prosody-74ae56ade698a5530125926ac74509e80f9c8ff8.tar.gz prosody-74ae56ade698a5530125926ac74509e80f9c8ff8.zip |
mod_scansion_record: Record connected clients as scansion Objects declarations
Diffstat (limited to 'plugins/mod_scansion_record.lua')
-rw-r--r-- | plugins/mod_scansion_record.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/mod_scansion_record.lua b/plugins/mod_scansion_record.lua index 0ee22778..defbbee4 100644 --- a/plugins/mod_scansion_record.lua +++ b/plugins/mod_scansion_record.lua @@ -23,6 +23,14 @@ local function record_header(string) 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 @@ module:hook("resource-bind", function (event) 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"); |