From bc7bff10bda692eba525ca690378f2c29a833a5f Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 10 Mar 2015 01:38:33 +0100 Subject: [PATCH] mod_statsdx: Fix user registration counters Closes #82. --- mod_statsdx/src/mod_statsdx.erl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mod_statsdx/src/mod_statsdx.erl b/mod_statsdx/src/mod_statsdx.erl index b57d9ea..05ae811 100644 --- a/mod_statsdx/src/mod_statsdx.erl +++ b/mod_statsdx/src/mod_statsdx.erl @@ -212,15 +212,17 @@ finish_stats(Host) -> %%%================================== %%%% Hooks Handlers -register_user(_User, Server) -> - Table = table_name(Server), - ets:update_counter(Table, {register_user, Server}, 1), - ets:update_counter(Table, {register_user, server}, 1). +register_user(_User, Host) -> + TableHost = table_name(Host), + TableServer = table_name("server"), + ets:update_counter(TableHost, {register_user, Host}, 1), + ets:update_counter(TableServer, {register_user, server}, 1). -remove_user(_User, Server) -> - Table = table_name(Server), - ets:update_counter(Table, {remove_user, Server}, 1), - ets:update_counter(Table, {remove_user, server}, 1). +remove_user(_User, Host) -> + TableHost = table_name(Host), + TableServer = table_name("server"), + ets:update_counter(TableHost, {remove_user, Host}, 1), + ets:update_counter(TableServer, {remove_user, server}, 1). user_send_packet(FromJID, ToJID, NewEl) -> %% Registrarse para tramitar Host/mod_stats2file