/soc/2013/ankitkv/gobjectification: 77e5418ff1ba: Merged default...

Ankit Vani a at nevitus.org
Sun Jan 12 05:51:29 EST 2014


Changeset: 77e5418ff1baeef2de105d0edb0a0ba0d7e381c4
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-01-12 16:17 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/77e5418ff1ba

Description:

Merged default branch

diffstat:

 .hgignore                                    |    1 +
 ChangeLog                                    |   53 ++++++-
 ChangeLog.API                                |    1 +
 libpurple/account.c                          |   13 +-
 libpurple/http.c                             |   27 ++-
 libpurple/keyring.c                          |    6 +-
 libpurple/plugins/keyrings/internalkeyring.c |    1 +
 libpurple/plugins/notify_example.c           |    2 +-
 libpurple/plugins/perl/common/Prefs.xs       |    5 -
 libpurple/plugins/tcl/signal-test.tcl        |    2 +-
 libpurple/prefs.c                            |   20 +--
 libpurple/prefs.h                            |   17 --
 libpurple/protocols/gg/Makefile.am           |    2 +
 libpurple/protocols/gg/Makefile.mingw        |    1 +
 libpurple/protocols/gg/edisc.c               |   24 +++
 libpurple/protocols/gg/gg.c                  |   12 +
 libpurple/protocols/gg/keymapper.c           |   79 ++++++++++
 libpurple/protocols/gg/keymapper.h           |   21 ++
 libpurple/protocols/gg/multilogon.c          |  194 ++++++++++++++++++++++++--
 libpurple/protocols/gg/multilogon.h          |    2 +-
 libpurple/protocols/gg/pubdir-prpl.c         |    3 +-
 libpurple/protocols/gg/servconn.c            |    7 +
 libpurple/protocols/gg/servconn.h            |    1 +
 libpurple/protocols/gg/utils.c               |   14 +
 libpurple/protocols/gg/utils.h               |    2 +
 libpurple/protocols/msn/msnutils.c           |    2 +-
 libpurple/protocols/msn/msnutils.h           |    2 +-
 libpurple/request-datasheet.c                |   46 ++++++-
 libpurple/request-datasheet.h                |   21 ++
 libpurple/request.c                          |    6 +-
 libpurple/tests/test_util.c                  |    2 +-
 libpurple/tests/test_yahoo_util.c            |   12 +-
 pidgin/Makefile.am                           |    2 -
 pidgin/gtkdialogs.c                          |    7 +-
 pidgin/gtkrequest.c                          |   14 +-
 pidgin/win32/prepare-workspace.sh            |   12 +-
 po/ChangeLog                                 |    2 +-
 37 files changed, 525 insertions(+), 113 deletions(-)

diffs (truncated from 1276 to 300 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -1,5 +1,6 @@
 syntax: glob
 .*.swp
+clang_output_*
 
 syntax: regexp
 (.*/)?TAGS$
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,23 +80,58 @@ version 3.0.0 (??/??/????):
 	* Doxygen has been replaced by gtk-doc for generating documentation.
 
 version 2.10.8:
-	Stock market:
-	* Ludicrous increases on mediocre worldwide economic data.
-
 	General:
-	* Add support for Python3 in build scripts. (Ashish Gupta) (#15624)
+	* Python build scripts and example plugins are now compatible with
+	  Python 3. (Ashish Gupta) (#15624)
+
+	libpurple:
+	* Fix handling of SSL certificates without subjects when using libnss.
+	* Fix handling of SSL certificates with timestamps in the distant future
+	  when using libnss. (#15586)
 
 	Pidgin:
-	* Add a Unity integration plugin.
-
-	Gadu-Gadu:
-	* Disabled buddy list import/export from/to server (it didn't worked
-	  anymore). Buddy list synchronization will be implemented in 3.0.0.
+	* Better handling of URLs longer than 1000 letters.
+	* Fix handling of multibyte UTF-8 characters in smiley themes. (#15756)
 
 	Windows-Specific Changes:
+	* Fix Tcl scripts. (#15520)
+	* Fix crash-on-startup when ASLR is always on. (#15521)
 	* Updates to dependencies:
 		* NSS 3.15.3 and NSPR 4.10.2
 
+	Gadu-Gadu:
+	* Disabled buddy list import/export from/to server (it didn't work
+	  anymore). Buddy list synchronization will be implemented in 3.0.0.
+
+	IRC:
+	* Fix bug where initial IRC status would not be set correctly.
+	* Fix bug where IRC wasn't available when libpurple was compiled with
+	  Cyrus SASL support. (#15517)
+
+	MXit:
+	* Fix sporadic crashes that can happen after user is disconnected.
+	* Fix crash when attempting to add a contact via search results.
+	* Show error message if file transfer fails.
+	* Fix compiling with InstantBird.
+	* Fix display of some custom emoticons.
+
+	SILC:
+	* Correctly set whiteboard dimensions in whiteboard sessions.
+
+	XMPP:
+	* Fix possible crash or other erratic behavior when selecting a very
+	  small file for your own buddy icon.
+	* Fix crash if the user tries to initiate a voice/video session with a
+	  resourceless JID.
+	* Fix login errors when the first two available auth mechanisms fail but
+	  a subsequent mechanism would otherwise work when using Cyrus SASL.
+	  (#15524)
+
+	Plugins:
+	* Fix crash in contact availability plugin.
+	* Fix perl function Purple::Network::ip_atoi
+	* Add Unity integration plugin.
+
 version 2.10.7 (02/13/2013):
 	Alien hatchery:
 	* No changes
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -454,6 +454,7 @@ version 3.0.0 (??/??/????):
 		* purple_plugins_unload
 		* purple_plugins_unload_all
 		* purple_pounces_load
+		* purple_prefs_set_generic
 		* purple_presence_add_status
 		* purple_presence_add_list
 		* PurplePresenceContext
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -70,13 +70,12 @@ typedef struct
 								/*   proxy settings from global prefs.      */
 
 	/*
-	 * TODO: Supplementing the next two linked lists with hash tables
-	 * should help performance a lot when these lists are long.  This
-	 * matters quite a bit for protocols like MSN, where all your
-	 * buddies are added to your permit list.  Currently we have to
-	 * iterate through the entire list if we want to check if someone
-	 * is permitted or denied.  We should do this for 3.0.0.
-	 * Or maybe use a GTree.
+	 * TODO: Instead of linked lists for permit and deny, use a data
+	 * structure that allows fast lookups AND decent performance when
+	 * iterating through all items. Fast lookups should help performance
+	 * for protocols like MSN, where all your buddies exist in your permit
+	 * list therefore the permit list is large. Possibly GTree or
+	 * GHashTable.
 	 */
 	GSList *permit;             /**< Permit list.                           */
 	GSList *deny;               /**< Deny list.                             */
diff --git a/libpurple/http.c b/libpurple/http.c
--- a/libpurple/http.c
+++ b/libpurple/http.c
@@ -598,6 +598,8 @@ static void purple_http_headers_remove(P
 
 static const GList * purple_http_headers_get_all(PurpleHttpHeaders *hdrs)
 {
+	g_return_val_if_fail(hdrs != NULL, NULL);
+
 	return hdrs->list;
 }
 
@@ -1433,7 +1435,7 @@ static void
 		return;
 	}
 
-	purple_socket_watch(hs->ps, PURPLE_INPUT_WRITE, _purple_http_send, hc);
+	purple_socket_watch(ps, PURPLE_INPUT_WRITE, _purple_http_send, hc);
 }
 
 static gboolean _purple_http_reconnect(PurpleHttpConnection *hc)
@@ -1448,16 +1450,16 @@ static gboolean _purple_http_reconnect(P
 
 	if (purple_debug_is_verbose()) {
 		if (purple_debug_is_unsafe()) {
-			gchar *url = purple_http_url_print(hc->url);
-			purple_debug_misc("http", "Connecting to %s...\n", url);
-			g_free(url);
+			gchar *urlp = purple_http_url_print(hc->url);
+			purple_debug_misc("http", "Connecting to %s...\n", urlp);
+			g_free(urlp);
 		} else
 			purple_debug_misc("http", "Connecting to %s...\n",
 				hc->url->host);
 	}
 
 	url = hc->url;
-	if (url->protocol[0] == '\0' ||
+	if (g_strcmp0(url->protocol, "") == 0 ||
 		g_ascii_strcasecmp(url->protocol, "http") == 0) {
 		/* do nothing */
 	} else if (g_ascii_strcasecmp(url->protocol, "https") == 0) {
@@ -1615,6 +1617,8 @@ static PurpleHttpConnection * purple_htt
 {
 	PurpleHttpConnection *hc = g_new0(PurpleHttpConnection, 1);
 
+	g_assert(request != NULL);
+
 	hc->request = request;
 	purple_http_request_ref(request);
 	hc->response = purple_http_response_new();
@@ -2190,7 +2194,7 @@ static void
 	if (hs != NULL)
 		hs->use_count++;
 
-	req->cb(hs->ps, error, req->user_data);
+	req->cb(ps, error, req->user_data);
 	g_free(req);
 }
 
@@ -2255,6 +2259,11 @@ static gboolean
 	hs = purple_http_socket_connect_new(req->gc, req->host->host,
 		req->host->port, req->host->is_ssl,
 		_purple_http_keepalive_socket_connected, req);
+	if (hs == NULL) {
+		purple_debug_error("http", "failed creating new socket");
+		return FALSE;
+	}
+
 	req->hs = hs;
 	hs->is_busy = TRUE;
 	hs->host = host;
@@ -2289,8 +2298,10 @@ purple_http_keepalive_pool_request_cance
 		req->host->queue = g_slist_remove(req->host->queue, req);
 
 	if (req->hs != NULL) {
-		req->host->sockets = g_slist_remove(req->host->sockets,
-			req->hs);
+		if (G_LIKELY(req->host)) {
+			req->host->sockets = g_slist_remove(req->host->sockets,
+				req->hs);
+		}
 		purple_http_socket_close_free(req->hs);
 		/* req should already be free'd here */
 	} else {
diff --git a/libpurple/keyring.c b/libpurple/keyring.c
--- a/libpurple/keyring.c
+++ b/libpurple/keyring.c
@@ -268,7 +268,9 @@ purple_keyring_set_inuse_save_cb(PurpleA
 
 	tracker->read_outstanding--;
 
-	if (g_error_matches(error, PURPLE_KEYRING_ERROR,
+	if (error == NULL) {
+		/* no error */
+	} else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
 		PURPLE_KEYRING_ERROR_NOPASSWORD)) {
 		if (purple_debug_is_verbose()) {
 			purple_debug_misc("keyring", "No password found while "
@@ -303,7 +305,7 @@ purple_keyring_set_inuse_save_cb(PurpleA
 		if (tracker->error != NULL)
 			g_error_free(tracker->error);
 		tracker->error = g_error_copy(error);
-	} else if (error != NULL) {
+	} else {
 		purple_debug_error("keyring", "Unknown error while changing "
 			"keyring for account %s: %s. Aborting changes.\n",
 			purple_keyring_print_account(account), error->message);
diff --git a/libpurple/plugins/keyrings/internalkeyring.c b/libpurple/plugins/keyrings/internalkeyring.c
--- a/libpurple/plugins/keyrings/internalkeyring.c
+++ b/libpurple/plugins/keyrings/internalkeyring.c
@@ -262,6 +262,7 @@ intkeyring_encrypt(intkeyring_buff_t *ke
 	plaintext_len += verify_len;
 
 	iv = intkeyring_gen_salt(purple_cipher_get_block_size(cipher));
+	g_return_val_if_fail(iv != NULL, NULL);
 	purple_cipher_set_iv(cipher, iv->data, iv->len);
 	purple_cipher_set_key(cipher, key->data, key->len);
 	purple_cipher_set_batch_mode(cipher,
diff --git a/libpurple/plugins/notify_example.c b/libpurple/plugins/notify_example.c
--- a/libpurple/plugins/notify_example.c
+++ b/libpurple/plugins/notify_example.c
@@ -66,7 +66,7 @@ static void
 notify_uri_cb(PurplePluginAction *action)
 {
 	/* This one should open your web browser of choice. */
-	purple_notify_uri(action->plugin, "https://www.pidgin.im/");
+	purple_notify_uri(action->plugin, "https://pidgin.im/");
 }
 
 static GList *
diff --git a/libpurple/plugins/perl/common/Prefs.xs b/libpurple/plugins/perl/common/Prefs.xs
--- a/libpurple/plugins/perl/common/Prefs.xs
+++ b/libpurple/plugins/perl/common/Prefs.xs
@@ -179,11 +179,6 @@ purple_prefs_set_bool(name, value)
 	gboolean value
 
 void
-purple_prefs_set_generic(name, value)
-	const char *name
-	gpointer value
-
-void
 purple_prefs_set_int(name, value)
 	const char *name
 	int value
diff --git a/libpurple/plugins/tcl/signal-test.tcl b/libpurple/plugins/tcl/signal-test.tcl
--- a/libpurple/plugins/tcl/signal-test.tcl
+++ b/libpurple/plugins/tcl/signal-test.tcl
@@ -119,5 +119,5 @@ proc plugin_init { } {
 	     "Tests Tcl signal handlers" \
              "Debugs a ridiculous amount of signal information." \
              "Ethan Blanton <elb at pidgin.im>" \
-             "https://www.pidgin.im/"
+             "https://pidgin.im/"
 }
diff --git a/libpurple/prefs.c b/libpurple/prefs.c
--- a/libpurple/prefs.c
+++ b/libpurple/prefs.c
@@ -51,6 +51,11 @@ struct purple_pref {
 	PurplePrefType type;
 	char *name;
 	union {
+		/* 'generic' is kind of ugly. We use it as an elegant way to refer to
+		   the value of this pref when calling callback functions. We could
+		   use 'boolean' or 'integer' or any other field... but it feels
+		   mildly cleaner to use a gpointer. Maybe it would be best to use a
+		   GValue? */
 		gpointer generic;
 		gboolean boolean;
 		int integer;
@@ -782,21 +787,6 @@ purple_prefs_trigger_callback(const char
 }
 
 void
-purple_prefs_set_generic(const char *name, gpointer value)
-{
-	struct purple_pref *pref = find_pref(name);
-
-	if(!pref) {
-		purple_debug_error("prefs",
-				"purple_prefs_set_generic: Unknown pref %s\n", name);
-		return;
-	}
-



More information about the Commits mailing list