soc.2012.statscollector: de879e3a: Add the number of buddies to stats

sanket at soc.pidgin.im sanket at soc.pidgin.im
Thu May 24 05:40:49 EDT 2012


----------------------------------------------------------------------
Revision: de879e3a12f5c18577a3fa7f1af06a317d4e88fe
Parent:   87cf6adb2543d33a6280a554872c681897e82e6e
Author:   sanket at soc.pidgin.im
Date:     05/24/12 06:35:43
Branch:   im.pidgin.soc.2012.statscollector
URL: http://d.pidgin.im/viewmtn/revision/info/de879e3a12f5c18577a3fa7f1af06a317d4e88fe

Changelog: 

Add the number of buddies to stats

Changes against parent 87cf6adb2543d33a6280a554872c681897e82e6e

  patched  libpurple/plugins/statscollector.c

-------------- next part --------------
============================================================
--- libpurple/plugins/statscollector.c	2362f2af78dc2b22d93f1a0679ee8b7fcde1bc48
+++ libpurple/plugins/statscollector.c	8f90e3108c5e6a35c1e68069a95aee4a1fa9cff8
@@ -585,8 +585,9 @@ acc_sign_on_event(PurpleAccount *account
 
   const char *username, *protocol, *data;
   char *id;
+  xmlnode *acc, *p_node, *len_node;
+  int len;
 
-  xmlnode *acc, *p_node;
   username = purple_account_get_username(account);
   protocol = purple_account_get_protocol_id(account);
 
@@ -602,9 +603,16 @@ acc_sign_on_event(PurpleAccount *account
 
     xmlnode_set_attrib(acc, "id", id);
 
+    /* Protocol information */
     p_node = xmlnode_new_child(acc, "protocol");
     xmlnode_insert_data(p_node, protocol, -1);
 
+    /* Number of buddies in account list */
+    len = g_slist_length(purple_find_buddies(account, NULL));
+    len_node = xmlnode_new("buddies");
+    xmlnode_insert_data(len_node, g_strdup_printf("%d", len), -1);
+    xmlnode_insert_child(acc, len_node);
+
     data = xmlnode_to_str(acc, NULL);
 
     g_hash_table_insert(stats_acc_ht, (void *)id, (void *)data);


More information about the Commits mailing list