changeset 25249:c3e44dae2f65

propagate from branch 'im.pidgin.pidgin' (head c06356e8e8d2c586f0192a5564053c2584020da8) to branch 'im.pidgin.cpw.malu.xmpp.idle' (head 492dca97b7449230d13f72aff36cc1c03bdd1bd9)
author Marcus Lundblad <ml@update.uu.se>
date Tue, 23 Dec 2008 20:12:07 +0000
parents 280ffb4d954f (current diff) 41e69c65b006 (diff)
children b1a16f0efec2
files libpurple/protocols/jabber/jabber.c
diffstat 15 files changed, 43 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/blist.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/blist.c	Tue Dec 23 20:12:07 2008 +0000
@@ -1029,7 +1029,7 @@
 		return;
 
 	dest = purple_find_group(new_name);
-	if (dest != NULL) {
+	if (dest != NULL && purple_utf8_strcasecmp(source->name, dest->name) != 0) {
 		/* We're merging two groups */
 		PurpleBlistNode *prev, *child, *next;
 
--- a/libpurple/protocols/gg/buddylist.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/protocols/gg/buddylist.c	Tue Dec 23 20:12:07 2008 +0000
@@ -216,13 +216,14 @@
 	PurpleBlistNode *gnode, *cnode, *bnode;
 	PurpleGroup *group;
 	PurpleBuddy *buddy;
-
-	char *buddylist = g_strdup("");
+	GString *buddylist;
 	char *ptr;
 
 	if ((blist = purple_get_blist()) == NULL)
 		return NULL;
 
+	buddylist = g_string_sized_new(1024);
+
 	for (gnode = blist->root; gnode != NULL; gnode = gnode->next) {
 		if (!PURPLE_BLIST_NODE_IS_GROUP(gnode))
 			continue;
@@ -247,19 +248,16 @@
 				alias = buddy->alias ? buddy->alias : buddy->name;
 				gname = group->name;
 
-				ptr = buddylist;
-				buddylist = g_strdup_printf(
-						"%s%s;%s;%s;%s;%s;%s;%s;%s%s\r\n",
-						ptr, alias, alias, alias, alias,
+				g_string_append_printf(buddylist,
+						"%s;%s;%s;%s;%s;%s;%s;%s%s\r\n",
+						alias, alias, alias, alias,
 						"", gname, name, "", "");
-
-				g_free(ptr);
 			}
 		}
 	}
 
-	ptr = charset_convert(buddylist, "UTF-8", "CP1250");
-	g_free(buddylist);
+	ptr = charset_convert(buddylist->str, "UTF-8", "CP1250");
+	g_string_free(buddylist, TRUE);
 	return ptr;
 }
 /* }}} */
--- a/libpurple/protocols/jabber/jabber.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Tue Dec 23 20:12:07 2008 +0000
@@ -151,7 +151,7 @@
 	char hostname[256]; /* current hostname */
 
 	/* Empty resource == don't send any */
-	if (*input == '\0')
+	if (input == NULL || *input == '\0')
 		return NULL;
 
 	if (strstr(input, "__HOSTNAME__") == NULL)
--- a/libpurple/protocols/myspace/session.h	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/protocols/myspace/session.h	Tue Dec 23 20:12:07 2008 +0000
@@ -35,7 +35,7 @@
 	guint userid;                       /**< This user's numeric user ID */
 	gchar *username;                    /**< This user's unique username */
 	gboolean show_only_to_list;
-	int privacy_mode;
+	int privacy_mode;                   /**< This is a bitmask */
 	int offline_message_mode;
 	gint fd;                            /**< File descriptor to/from server */
 
--- a/libpurple/protocols/myspace/user.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/protocols/myspace/user.c	Tue Dec 23 20:12:07 2008 +0000
@@ -406,10 +406,11 @@
 	}
 
 	if (msim_msg_get_integer(msg, "dsn") == MG_OWN_IM_INFO_DSN &&
-		msim_msg_get_integer(msg, "lid") == MG_OWN_IM_INFO_LID) {
+		msim_msg_get_integer(msg, "lid") == MG_OWN_IM_INFO_LID)
+	{
 		/*
 		 * Some of this info will be available on the buddy list if the
-		 * has themselves as their own buddy.
+		 * user has themselves as their own buddy.
 		 *
 		 * Much of the info is already available in MsimSession,
 		 * stored in msim_we_are_logged_on().
@@ -431,7 +432,7 @@
 				"idlist", MSIM_TYPE_STRING,
 						g_strdup_printf("w%d|c%d",
 								session->show_only_to_list ? 1 : 0,
-								session->privacy_mode),
+								session->privacy_mode & 1),
 				NULL);
 	} else if (msim_msg_get_integer(msg, "dsn") == MG_OWN_MYSPACE_INFO_DSN &&
 			msim_msg_get_integer(msg, "lid") == MG_OWN_MYSPACE_INFO_LID) {
--- a/libpurple/protocols/oscar/odc.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/protocols/oscar/odc.c	Tue Dec 23 20:12:07 2008 +0000
@@ -567,6 +567,7 @@
 	{
 		purple_debug_info("oscar", "Unknown ODC frame type 0x%04hx, "
 				"subtype 0x%04hx.\n", frame->type, frame->subtype);
+		g_free(frame);
 		return;
 	}
 
@@ -607,6 +608,7 @@
 			g_free(tmp);
 
 			peer_connection_destroy(conn, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL);
+			g_free(frame);
 			return;
 		}
 
--- a/libpurple/protocols/qq/group_internal.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/protocols/qq/group_internal.c	Tue Dec 23 20:12:07 2008 +0000
@@ -30,7 +30,7 @@
 #include "group_internal.h"
 #include "utils.h"
 
-static qq_room_data *room_data_new(guint32 id, guint32 ext_id, gchar *title)
+static qq_room_data *room_data_new(guint32 id, guint32 ext_id, const gchar *title)
 {
 	qq_room_data *rmd;
 
@@ -62,9 +62,9 @@
 
 	value = g_hash_table_lookup(data, QQ_ROOM_KEY_INTERNAL_ID);
 	id = value ? strtoul(value, NULL, 10) : 0;
-	value= g_hash_table_lookup(data, QQ_ROOM_KEY_EXTERNAL_ID);
+	value = g_hash_table_lookup(data, QQ_ROOM_KEY_EXTERNAL_ID);
 	ext_id = value ? strtoul(value, NULL, 10) : 0;
-	value = g_strdup(g_hash_table_lookup(data, QQ_ROOM_KEY_TITLE_UTF8));
+	value = g_hash_table_lookup(data, QQ_ROOM_KEY_TITLE_UTF8);
 
 	rmd = room_data_new(id, ext_id, value);
 	rmd->my_role = QQ_ROOM_ROLE_YES;
--- a/libpurple/protocols/qq/group_opt.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/protocols/qq/group_opt.c	Tue Dec 23 20:12:07 2008 +0000
@@ -416,11 +416,6 @@
 
 	bytes += qq_get_vstr(&reason, QQ_CHARSET_DEFAULT, data + bytes);
 
-	add_req = g_new0(qq_room_req, 1);
-	add_req->gc = gc;
-	add_req->id = id;
-	add_req->member = member_id;
-
 	purple_debug_info("QQ", "%u requested to join room, ext id %u\n", member_id, ext_id);
 
 	rmd = qq_room_data_find(gc, id);
@@ -442,6 +437,11 @@
 	who = uid_to_purple_name(member_id);
 	msg = g_strdup_printf(_("%u request to join Qun %u"), member_id, ext_id);
 
+	add_req = g_new0(qq_room_req, 1);
+	add_req->gc = gc;
+	add_req->id = id;
+	add_req->member = member_id;
+
 	purple_request_action(gc, _("QQ Qun Operation"),
 			msg, reason,
 			PURPLE_DEFAULT_ACTION_NONE,
--- a/libpurple/protocols/sametime/sametime.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Tue Dec 23 20:12:07 2008 +0000
@@ -3724,7 +3724,6 @@
   gc->flags |= PURPLE_CONNECTION_NO_IMAGES;
 
   user = g_strdup(purple_account_get_username(account));
-  pass = g_strdup(purple_account_get_password(account));
 
   host = strrchr(user, ':');
   if(host) {
@@ -3741,10 +3740,12 @@
   if(! host || ! *host) {
     /* somehow, we don't have a host to connect to. Well, we need one
        to actually continue, so let's ask the user directly. */
+    g_free(user);
     prompt_host(gc);
     return;
   }
 
+  pass = g_strdup(purple_account_get_password(account));
   port = purple_account_get_int(account, MW_KEY_PORT, MW_PLUGIN_DEFAULT_PORT);
 
   DEBUG_INFO("user: '%s'\n", user);
--- a/libpurple/server.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/server.c	Tue Dec 23 20:12:07 2008 +0000
@@ -804,7 +804,7 @@
 {
 	PurpleAccount *account;
 	char buf2[BUF_LONG];
-	struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1);
+	struct chat_invite_data *cid;
 	int plugin_return;
 
 	account = purple_connection_get_account(gc);
@@ -817,6 +817,8 @@
 		}
 	}
 
+	cid = g_new0(struct chat_invite_data, 1);
+
 	plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1(
 					purple_conversations_get_handle(),
 					"chat-invited", account, who, name, message, data));
--- a/libpurple/util.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/util.c	Tue Dec 23 20:12:07 2008 +0000
@@ -1676,20 +1676,18 @@
 							  size = "xx-small";
 							  break;
 							case 2:
-							  size = "x-small";
+							  size = "small";
 							  break;
 							case 3:
-							  size = "small";
+							  size = "medium";
 							  break;
 							case 4:
-							  size = "medium";
+							  size = "large";
 							  break;
 							case 5:
-							  size = "large";
+							  size = "x-large";
 							  break;
 							case 6:
-							  size = "x-large";
-							  break;
 							case 7:
 							  size = "xx-large";
 							  break;
--- a/libpurple/xmlnode.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/libpurple/xmlnode.c	Tue Dec 23 20:12:07 2008 +0000
@@ -662,7 +662,7 @@
 	vsnprintf(errmsg, sizeof(errmsg), msg, args);
 	va_end(args);
 
-	purple_debug_error("xmlnode", "Error parsing xml file: %s\n", errmsg);
+	purple_debug_error("xmlnode", "Error parsing xml file: %s", errmsg);
 }
 
 static xmlSAXHandler xmlnode_parser_libxml = {
--- a/pidgin/gtkblist.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/pidgin/gtkblist.c	Tue Dec 23 20:12:07 2008 +0000
@@ -602,7 +602,7 @@
 			break;
 		case PURPLE_BLIST_GROUP_NODE:
 			dest = purple_find_group(arg2);
-			if (dest != NULL && strcmp(arg2, ((PurpleGroup*) node)->name)) {
+			if (dest != NULL && purple_utf8_strcasecmp(arg2, ((PurpleGroup*) node)->name)) {
 				pidgin_dialogs_merge_groups((PurpleGroup*) node, arg2);
 			} else
 				purple_blist_rename_group((PurpleGroup*)node, arg2);
--- a/pidgin/gtkimhtml.c	Mon Dec 22 11:24:17 2008 +0000
+++ b/pidgin/gtkimhtml.c	Tue Dec 23 20:12:07 2008 +0000
@@ -3117,15 +3117,15 @@
 							else if (g_ascii_strcasecmp(size, "smaller") == 0
 								  || g_ascii_strcasecmp(size, "x-small") == 0)
 								font->size = 2;
-							else if (g_ascii_strcasecmp(size, "larger") == 0
-								  || g_ascii_strcasecmp(size, "medium") == 0)
+							else if (g_ascii_strcasecmp(size, "medium") == 0)
+								font->size = 3;
+							else if (g_ascii_strcasecmp(size, "large") == 0
+								  || g_ascii_strcasecmp(size, "larger") == 0)
 								font->size = 4;
-							else if (g_ascii_strcasecmp(size, "large") == 0)
+							else if (g_ascii_strcasecmp(size, "x-large") == 0)
 								font->size = 5;
-							else if (g_ascii_strcasecmp(size, "x-large") == 0)
+							else if (g_ascii_strcasecmp(size, "xx-large") == 0)
 								font->size = 6;
-							else if (g_ascii_strcasecmp(size, "xx-large") == 0)
-								font->size = 7;
 
 							/*
 							 * TODO: Handle other values, like percentages, or
--- a/po/fr.po	Mon Dec 22 11:24:17 2008 +0000
+++ b/po/fr.po	Tue Dec 23 20:12:07 2008 +0000
@@ -4964,7 +4964,7 @@
 msgstr "Erreur MSN : %s\n"
 
 msgid "Other Contacts"
-msgstr "AUtres contacts"
+msgstr "Autres contacts"
 
 msgid "Non-IM Contacts"
 msgstr "Contacts non instantanés"