/soc/2012/sanket/statscollector-2.x.y: 11b80c3b1dd7: [BUGFIX] Fi...

sanket sanket at soc.pidgin.im
Wed Aug 15 16:18:05 EDT 2012

Changeset: 11b80c3b1dd7f18ab0e5ae0e83b1c9ec56e9dd58
Author:	 sanket <sanket at soc.pidgin.im>
Date:	 2012-08-15 12:49 +0530
Branch:	 soc.2012.statscollector
URL: http://hg.pidgin.im/soc/2012/sanket/statscollector-2.x.y/rev/11b80c3b1dd7


[BUGFIX] Fix double submit of stats on first load

On the first load of the plugin, due to an extra call to
plugin_load causes the plugin to create two callbacks for
stats send, and hence have two callbacks all the time.


 libpurple/plugins/statscollector.c |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (23 lines):

diff --git a/libpurple/plugins/statscollector.c b/libpurple/plugins/statscollector.c
--- a/libpurple/plugins/statscollector.c
+++ b/libpurple/plugins/statscollector.c
@@ -90,7 +90,6 @@ confirm_allow(){
   /* Set the allow variable in prefs to ALLOW */
   purple_prefs_set_int("/plugins/core/statscollector/allow", ALLOW);
-  plugin_load(plugin_g);
@@ -1112,9 +1111,9 @@ static void
 pref_allow_cb(const char *name, PurplePrefType type, \
     gconstpointer val, gpointer data){
-  purple_debug_info("STATS PREF", "Pref %s has changed to %d", name, (int)val);
+  purple_debug_info("STATS PREF", "Pref %s has changed to %d", name, GPOINTER_TO_INT(val));
-  switch((int)val){
+  switch(GPOINTER_TO_INT(val)){
     case ALLOW:

More information about the Commits mailing list