soc.2012.statscollector: 3ff37c9c: Make the plugin compatible on 3.0.0 and ...
sanket at soc.pidgin.im
sanket at soc.pidgin.im
Fri Jun 1 05:43:17 EDT 2012
----------------------------------------------------------------------
Revision: 3ff37c9c0bfc4876905e342fc23b4a0448dade77
Parent: 393832b1daa7dc5eadd0c1212da24f6ef7c6b758
Author: sanket at soc.pidgin.im
Date: 06/01/12 06:25:12
Branch: im.pidgin.soc.2012.statscollector
URL: http://d.pidgin.im/viewmtn/revision/info/3ff37c9c0bfc4876905e342fc23b4a0448dade77
Changelog:
Make the plugin compatible on 3.0.0 and <3.0.0
There's an API change in 3.0.0 (util_fetch_request) which breaks the code
for lower versions. Place an #ifdef to handle compilation accordingly.
Also there are some string changes for being able to submit stats to the
remote server AND to ensure that stats are not submitted too often.
Changes against parent 393832b1daa7dc5eadd0c1212da24f6ef7c6b758
patched libpurple/plugins/statscollector.c
-------------- next part --------------
============================================================
--- libpurple/plugins/statscollector.c bfb369807a86418dfec21a4995ff4ec2f188270c
+++ libpurple/plugins/statscollector.c f9d65a198aed914f2c5c97cf9f0f3ce81b542cdf
@@ -27,10 +27,10 @@
#endif
/* Timeout */
-#define RESEND_SEC 40
+#define RESEND_SEC (24*3600)
/* Sending URL */
-#define SEND_URL "http://localhost:8000/collectstats/collect/"
+#define SEND_URL "http://pidgin-stats.alwaysdata.net/collectstats/collect/"
/* POSIX compliance is an issue that I have looked into some detail now
* It seems like presence of unistd.h and _POSIX_VERSION being defined
@@ -749,7 +749,11 @@ send_stats()
"Content-Length: %" G_GSIZE_FORMAT "\r\n\r\n%s",
path, host, port, strlen(postdata), postdata);
+#if PURPLE_VERSION_CHECK(3,0,0)
urldata = purple_util_fetch_url_request(NULL, url, TRUE, NULL, FALSE, request, FALSE, -1, url_callback, (gpointer)postdata);
+#else
+ urldata = purple_util_fetch_url_request(url, TRUE, NULL, FALSE, request, FALSE, url_callback, (gpointer)postdata);
+#endif
purple_prefs_set_int("/plugins/core/statscollector/last-sent",\
More information about the Commits
mailing list