aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-09-22 18:32:22 +0200
committerKim Alvefur <zash@zash.se>2018-09-22 18:32:22 +0200
commit74ae56ade698a5530125926ac74509e80f9c8ff8 (patch)
treef75ad63779c9e7d56aa5c24d0b66fcf65132783e
parent61d21c9a6538cbc3be605c5b18859eb0e3dbd947 (diff)
downloadprosody-74ae56ade698a5530125926ac74509e80f9c8ff8.tar.gz
prosody-74ae56ade698a5530125926ac74509e80f9c8ff8.zip
mod_scansion_record: Record connected clients as scansion Objects declarations
-rw-r--r--plugins/mod_scansion_record.lua13
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");