/soc/2012/michael/libpurple2: 79846d846285: Patched changes need...

Michael Zangl michael at soc.pidgin.im
Tue May 7 09:25:53 EDT 2013


Changeset: 79846d84628531a6e28a6587942ab4cd93b46a83
Author:	 Michael Zangl <michael at soc.pidgin.im>
Date:	 2013-05-07 13:18 +0200
Branch:	 default
URL: https://hg.pidgin.im/soc/2012/michael/libpurple2/rev/79846d846285

Description:

Patched changes needed for Android

diffstat:

 .hgignore                       |  95 +++++++++++++++++++++++-----------------
 libpurple/blist.c               |  20 +++++---
 libpurple/buddyicon.c           |   6 ++
 libpurple/buddyicon.h           |  11 ++++
 libpurple/cipher.c              |  24 +---------
 libpurple/cipher.h              |  50 +++++++--------------
 libpurple/ciphers/Makefile.am   |   6 +-
 libpurple/ciphers/des.c         |   6 +--
 libpurple/ciphers/gchecksum.c   |   2 -
 libpurple/ciphers/hmac.c        |  38 ++++-----------
 libpurple/ciphers/md4.c         |   2 -
 libpurple/ciphers/rc4.c         |   4 +-
 libpurple/core.h                |   2 +
 libpurple/dnsquery.c            |  19 +++++++-
 libpurple/dnsquery.h            |  19 ++++++++
 libpurple/dnssrv.c              |  64 +++++++++++++++++++--------
 libpurple/dnssrv.h              |  12 +++-
 libpurple/example/nullclient.c  |  11 ++++
 libpurple/plugin.c              |   8 +++
 libpurple/plugin.h              |   9 +++
 libpurple/protocols/msn/nexus.c |  14 ++++-
 21 files changed, 248 insertions(+), 174 deletions(-)

diffs (truncated from 1046 to 300 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -30,64 +30,64 @@ syntax: regexp
 .*\.so$
 Doxyfile(\.mingw)?$
 VERSION$
-aclocal.m4
-autogen.args
+aclocal\.m4
+autogen\.args
 autom4te.*\.cache
 compile
-config.cache
-config.guess
-config.h$
-config.h.in
-config.log
-config.status
-config.sub
+config\.cache
+config\.guess
+config\.h$
+config\.h\.in
+config\.log
+config\.status
+config\.sub
 configure$
 depcomp
 doc/finch.1$
 doc/html
 doc/pidgin.1$
 finch/finch$
-finch/libgnt/gntmarshal.c
-finch/libgnt/gntmarshal.h
+finch/libgnt/gntmarshal\.c
+finch/libgnt/gntmarshal\.h
 install-sh
 intltool-.*
-libpurple/dbus-bindings.c
-libpurple/dbus-signals.c
-libpurple/dbus-types.c
-libpurple/dbus-types.h
+libpurple/dbus-bindings\.c
+libpurple/dbus-signals\.c
+libpurple/dbus-types\.c
+libpurple/dbus-types\.h
 libpurple/example/nullclient
 libpurple/gconf/purple.schemas$
-libpurple/marshallers.[ch]
-libpurple/plugins/dbus-example-bindings.c
-libpurple/plugins/perl/common/Makefile.PL$
-libpurple/plugins/perl/common/Makefile.old
-libpurple/plugins/perl/common/const-c.inc
-libpurple/plugins/perl/common/const-xs.inc
+libpurple/marshallers\.[ch]
+libpurple/plugins/dbus-example-bindings\.c
+libpurple/plugins/perl/common/Makefile\.PL$
+libpurple/plugins/perl/common/Makefile\.old
+libpurple/plugins/perl/common/const-c\.inc
+libpurple/plugins/perl/common/const-xs\.inc
 libpurple/plugins/perl/common/lib
-libpurple/purple-client-bindings.c
-libpurple/purple-client-bindings.h
+libpurple/purple-client-bindings\.c
+libpurple/purple-client-bindings\.h
 libpurple/purple-client-example
-libpurple/purple.h$
+libpurple/purple\.h$
 libpurple/tests/check_libpurple
 libpurple/tests/libpurple..
-libpurple/version.h$
-libpurple/win32/libpurplerc.rc$
+libpurple/version\.h$
+libpurple/win32/libpurplerc\.rc$
 libtool
-local.mak
-ltmain.sh
+local\.mak
+ltmain\.sh
 missing
 mkinstalldirs
-package_revision.h
-package_revision_raw.txt
-pidgin-*.*.*-dbgsym$
-pidgin-*.*.*-dbgsym.zip$
-pidgin-*.*.*-win32-bin.zip$
-pidgin-*.*.*-win32bin$
-pidgin-.*.tar.bz2
-pidgin-.*.tar.gz
-pidgin.apspec$
-pidgin.desktop$
-pidgin.spec$
+package_revision\.h
+package_revision_raw\.txt
+pidgin-.*\..*\..*-dbgsym$
+pidgin-.*\..*\..*-dbgsym\.zip$
+pidgin-.*\..*\..*-win32-bin\.zip$
+pidgin-.*\..*\..*-win32bin$
+pidgin-\..*\.tar\.bz2
+pidgin-\..*\.tar\.gz
+pidgin\.apspec$
+pidgin\.desktop$
+pidgin\.spec$
 pidgin/pidgin$
 pidgin/pixmaps/emotes/default/24/theme
 pidgin/pixmaps/emotes/none/theme
@@ -106,7 +106,7 @@ pidgin/win32/nsis/pidgin-translations.ns
 pidgin/win32/nsis/translations
 pidgin/win32/pidgin_dll_rc.rc$
 pidgin/win32/pidgin_exe_rc.rc$
-po/Makefile.in.in
+po/Makefile\.in\.in
 po/POTFILES$
 po/missing
 po/notexist
@@ -114,3 +114,18 @@ po/pidgin.pot
 po/stamp-it
 stamp-h1
 win32-install-dir(\.release)?
+
+#Android
+android/workspace/\.metadata
+android/workspace/im\.pidgin\.libpurple\.build/build/.*
+android/workspace/im\.pidgin\.libpurple\.build/bin/.*
+android/workspace/im\.pidgin\.libpurple\.build/downloads
+android/workspace/im\.pidgin\.libpurple/bin/.*
+android/workspace/im\.pidgin\.libpurple/native/\.javah-tmp
+android/workspace/im\.pidgin\.libpurple/Android
+android/workspace/im\.pidgin\.libpurple/X86
+android/workspace/im\.pidgin\.libpurple\.testclient/gen/.*
+android/workspace/im\.pidgin\.libpurple\.testclient/bin/.*
+android/workspace/im\.pidgin\.libpurple/gen/.*
+
+
diff --git a/libpurple/blist.c b/libpurple/blist.c
--- a/libpurple/blist.c
+++ b/libpurple/blist.c
@@ -763,7 +763,9 @@ purple_get_blist()
 PurpleBlistNode *
 purple_blist_get_root()
 {
-	return purplebuddylist ? purplebuddylist->root : NULL;
+	g_return_val_if_fail(purplebuddylist != NULL, NULL);
+	
+	return purplebuddylist->root;
 }
 
 static void
@@ -963,6 +965,8 @@ void purple_blist_rename_buddy(PurpleBud
 	GHashTable *account_buddies;
 
 	g_return_if_fail(buddy != NULL);
+	g_return_if_fail(((PurpleBlistNode *)buddy)->parent != NULL);
+	g_return_if_fail(((PurpleBlistNode *)buddy)->parent->parent != NULL);
 
 	hb = g_new(struct _purple_hbuddy, 1);
 	hb->name = (gchar *)purple_normalize(buddy->account, buddy->name);
@@ -1482,7 +1486,7 @@ void purple_blist_add_chat(PurpleChat *c
 		/* Add group to blist if isn't already on it. Fixes #2752. */
 		if (!purple_find_group(group->name)) {
 			purple_blist_add_group(group,
-					purple_blist_get_last_sibling(purplebuddylist->root));
+					purple_blist_get_last_sibling(purple_blist_get_root()));
 		}
 	} else {
 		group = (PurpleGroup*)node->parent;
@@ -1585,7 +1589,7 @@ void purple_blist_add_buddy(PurpleBuddy 
 		/* Add group to blist if isn't already on it. Fixes #2752. */
 		if (!purple_find_group(g->name)) {
 			purple_blist_add_group(g,
-					purple_blist_get_last_sibling(purplebuddylist->root));
+					purple_blist_get_last_sibling(purple_blist_get_root()));
 		}
 		c = purple_contact_new();
 		purple_blist_add_contact(c, g,
@@ -1835,7 +1839,7 @@ void purple_blist_add_contact(PurpleCont
 		if (g == NULL) {
 			g = purple_group_new(_("Buddies"));
 			purple_blist_add_group(g,
-					purple_blist_get_last_sibling(purplebuddylist->root));
+					purple_blist_get_last_sibling(purple_blist_get_root()));
 		}
 	}
 
@@ -2461,7 +2465,7 @@ GSList *purple_find_buddies(PurpleAccoun
 		hb.name = (gchar *)purple_normalize(account, name);
 		hb.account = account;
 
-		for (node = purplebuddylist->root; node != NULL; node = node->next) {
+		for (node = purple_blist_get_root(); node != NULL; node = node->next) {
 			if (!node->child)
 				continue;
 
@@ -2519,7 +2523,7 @@ purple_blist_find_chat(PurpleAccount *ac
 		return prpl_info->find_blist_chat(account, name);
 
 	normname = g_strdup(purple_normalize(account, name));
-	for (group = purplebuddylist->root; group != NULL; group = group->next) {
+	for (group = purple_blist_get_root(); group != NULL; group = group->next) {
 		for (node = group->child; node != NULL; node = node->next) {
 			if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
 
@@ -2643,7 +2647,7 @@ void purple_blist_add_account(PurpleAcco
 	if (!ops || !ops->update)
 		return;
 
-	for (gnode = purplebuddylist->root; gnode; gnode = gnode->next) {
+	for (gnode = purple_blist_get_root(); gnode; gnode = gnode->next) {
 		if (!PURPLE_BLIST_NODE_IS_GROUP(gnode))
 			continue;
 		for (cnode = gnode->child; cnode; cnode = cnode->next) {
@@ -2687,7 +2691,7 @@ void purple_blist_remove_account(PurpleA
 
 	g_return_if_fail(purplebuddylist != NULL);
 
-	for (gnode = purplebuddylist->root; gnode; gnode = gnode->next) {
+	for (gnode = purple_blist_get_root(); gnode; gnode = gnode->next) {
 		if (!PURPLE_BLIST_NODE_IS_GROUP(gnode))
 			continue;
 
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c
--- a/libpurple/buddyicon.c
+++ b/libpurple/buddyicon.c
@@ -508,6 +508,12 @@ purple_buddy_icon_get_data(const PurpleB
 	return NULL;
 }
 
+PurpleStoredImage *
+purple_buddy_icon_get_image(const PurpleBuddyIcon *icon) {
+	return 	purple_imgstore_ref(icon->img);
+}
+
+
 const char *
 purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon)
 {
diff --git a/libpurple/buddyicon.h b/libpurple/buddyicon.h
--- a/libpurple/buddyicon.h
+++ b/libpurple/buddyicon.h
@@ -143,6 +143,17 @@ const char *purple_buddy_icon_get_checks
 gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len);
 
 /**
+ * Returns the buddy icon's stored image and increases the reference count 
+ * of that stored image by one, so you should use purple_imgstore_unref after 
+ * using the image.
+ *
+ * @param icon The buddy icon.
+ *
+ * @return A pointer to the icon data.
+ */
+PurpleStoredImage *purple_buddy_icon_get_image(const PurpleBuddyIcon *icon);
+
+/**
  * Returns an extension corresponding to the buddy icon's file type.
  *
  * @param icon The buddy icon.
diff --git a/libpurple/cipher.c b/libpurple/cipher.c
--- a/libpurple/cipher.c
+++ b/libpurple/cipher.c
@@ -88,8 +88,6 @@ purple_cipher_get_capabilities(PurpleCip
 		caps |= PURPLE_CIPHER_CAPS_INIT;
 	if(ops->reset)
 		caps |= PURPLE_CIPHER_CAPS_RESET;
-	if(ops->reset_state)
-		caps |= PURPLE_CIPHER_CAPS_RESET_STATE;
 	if(ops->uninit)
 		caps |= PURPLE_CIPHER_CAPS_UNINIT;
 	if(ops->set_iv)
@@ -361,26 +359,6 @@ purple_cipher_context_reset(PurpleCipher
 }
 
 void
-purple_cipher_context_reset_state(PurpleCipherContext *context, void *extra) {
-	PurpleCipher *cipher = NULL;
-
-	g_return_if_fail(context);
-
-	cipher = context->cipher;
-	g_return_if_fail(cipher);
-	g_return_if_fail(cipher->ops);
-
-	if (cipher->ops->reset_state) {
-		context->cipher->ops->reset_state(context, extra);
-		return;
-	}
-
-	purple_debug_warning("cipher", "the %s cipher does not support the "
-		"reset_state operation\n", cipher->name);
-	purple_cipher_context_reset(context, extra);
-}
-
-void
 purple_cipher_context_destroy(PurpleCipherContext *context) {
 	PurpleCipher *cipher = NULL;
 
@@ -551,7 +529,7 @@ purple_cipher_context_decrypt(PurpleCiph
 }
 



More information about the Commits mailing list