equal
deleted
inserted
replaced
27 end |
27 end |
28 |
28 |
29 -- Track users as they bind/unbind |
29 -- Track users as they bind/unbind |
30 -- count bare sessions every time, as we have no way to tell if it's a new bare session or not |
30 -- count bare sessions every time, as we have no way to tell if it's a new bare session or not |
31 module:hook("resource-bind", function(event) |
31 module:hook("resource-bind", function(event) |
32 send(prefix.."bare_sessions:"..iterators.count(bare_sessions).."|g") |
32 send(prefix.."bare_sessions:"..iterators.count(pairs(bare_sessions)).."|g") |
33 send(prefix.."full_sessions:+1|g") |
33 send(prefix.."full_sessions:+1|g") |
34 end, 1) |
34 end, 1) |
35 module:hook("resource-unbind", function(event) |
35 module:hook("resource-unbind", function(event) |
36 send(prefix.."bare_sessions:"..iterators.count(bare_sessions).."|g") |
36 send(prefix.."bare_sessions:"..iterators.count(pairs(bare_sessions)).."|g") |
37 send(prefix.."full_sessions:-1|g") |
37 send(prefix.."full_sessions:-1|g") |
38 end, 1) |
38 end, 1) |
39 |
39 |
40 -- Track MUC occupants as they join/leave |
40 -- Track MUC occupants as they join/leave |
41 module:hook("muc-occupant-joined", function(event) |
41 module:hook("muc-occupant-joined", function(event) |