Mercurial > prosody-modules
comparison mod_statsd/mod_statsd.lua @ 1449:365f6db9531a
mod_statsd: Better accounting for invites, add declines
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Mon, 23 Jun 2014 16:06:46 -0400 |
parents | d722a4defea7 |
children | d31ace5b1175 |
comparison
equal
deleted
inserted
replaced
1448:d722a4defea7 | 1449:365f6db9531a |
---|---|
54 send(prefix.."broadcast-message:1|c") | 54 send(prefix.."broadcast-message:1|c") |
55 local room_node = jid.split(event.room.jid) | 55 local room_node = jid.split(event.room.jid) |
56 send(prefix..clean(room_node)..".broadcast-message:1|c") | 56 send(prefix..clean(room_node)..".broadcast-message:1|c") |
57 end) | 57 end) |
58 module:hook("muc-invite", function(event) | 58 module:hook("muc-invite", function(event) |
59 -- Total count | |
59 send(prefix.."invite:1|c") | 60 send(prefix.."invite:1|c") |
60 local room_node = jid.split(event.room.jid) | 61 local room_node = jid.split(event.room.jid) |
62 -- Counts per room | |
61 send(prefix..clean(room_node)..".invite:1|c") | 63 send(prefix..clean(room_node)..".invite:1|c") |
62 local to_node, to_host, to_resource = jid.split(event.stanza.attr.to) | 64 -- Counts per recipient |
63 send(prefix..clean(to_node)..".invites:1|c") | 65 send(prefix..clean(event.stanza.attr.to)..".invited:1|c") |
64 end) | 66 end) |
67 module:hook("muc-decline", function(event) | |
68 -- Total count | |
69 send(prefix.."decline:1|c") | |
70 local room_node = jid.split(event.room.jid) | |
71 -- Counts per room | |
72 send(prefix..clean(room_node)..".decline:1|c") | |
73 -- Counts per sender | |
74 send(prefix..clean(event.incoming.attr.from)..".declined:1|c") | |
75 end) |