changeset 28214:2075b5cb608e

merge of '7267766a0885d4724d8069fbe8b617a51cccf64c' and '914921bfe0d4ed0711648940bd871a18809ea203'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 10 Aug 2009 04:40:54 +0000
parents ff365d26e997 (current diff) f27425877d29 (diff)
children 766f7905314a 4a4e9d309fc0
files
diffstat 4 files changed, 30 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/presence.c	Mon Aug 10 04:34:15 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c	Mon Aug 10 04:40:54 2009 +0000
@@ -698,6 +698,7 @@
 			const char *real_jid = NULL;
 			const char *affiliation = NULL;
 			const char *role = NULL;
+			gboolean is_our_resource = FALSE; /* Is the presence about us? */
 
 			/*
 			 * XEP-0045 mandates the presence to include a resource (which is
@@ -718,10 +719,15 @@
 				xmlnode *status_node;
 				xmlnode *item_node;
 
-				status_node = xmlnode_get_child(x, "status");
-				if (status_node) {
+				for (status_node = xmlnode_get_child(x, "status"); status_node;
+						status_node = xmlnode_get_next_twin(status_node)) {
 					const char *code = xmlnode_get_attrib(status_node, "code");
-					if (purple_strequal(code, "201")) {
+					if (!code)
+						continue;
+
+					if (g_str_equal(code, "110")) {
+						is_our_resource = TRUE;
+					} else if (g_str_equal(code, "201")) {
 						if ((chat = jabber_chat_find(js, jid->node, jid->domain))) {
 							chat->config_dialog_type = PURPLE_REQUEST_ACTION;
 							chat->config_dialog_handle =
@@ -737,7 +743,7 @@
 										_("_Configure Room"), G_CALLBACK(jabber_chat_request_room_configure),
 										_("_Accept Defaults"), G_CALLBACK(jabber_chat_create_instant_room));
 						}
-					} else if (purple_strequal(code, "210")) {
+					} else if (g_str_equal(code, "210")) {
 						/* server rewrote room-nick */
 						if((chat = jabber_chat_find(js, jid->node, jid->domain))) {
 							g_free(chat->handle);
@@ -814,7 +820,6 @@
 					"http://jabber.org/protocol/muc#user");
 			if (chat->muc && x) {
 				const char *nick;
-				const char *code = NULL;
 				const char *item_jid = NULL;
 				const char *to;
 				xmlnode *stat;
@@ -824,13 +829,16 @@
 				if (item)
 					item_jid = xmlnode_get_attrib(item, "jid");
 
-				stat = xmlnode_get_child(x, "status");
+				for (stat = xmlnode_get_child(x, "status"); stat;
+						stat = xmlnode_get_next_twin(stat)) {
+					const char *code = xmlnode_get_attrib(stat, "code");
 
-				if (stat)
-					code = xmlnode_get_attrib(stat, "code");
+					if (!code)
+						continue;
 
-				if (code) {
-					if(!strcmp(code, "301")) {
+					if (g_str_equal(code, "110")) {
+						is_our_resource = TRUE;
+					} else if(!strcmp(code, "301")) {
 						/* XXX: we got banned */
 					} else if(!strcmp(code, "303") && item &&
 							(nick = xmlnode_get_attrib(item, "nick"))) {
@@ -839,10 +847,11 @@
 							g_free(chat->handle);
 							chat->handle = g_strdup(nick);
 						}
+
+						/* TODO: This should probably be moved out of the loop */
 						purple_conv_chat_rename_user(PURPLE_CONV_CHAT(chat->conv), jid->resource, nick);
 						jabber_chat_remove_handle(chat, jid->resource);
-						/* TODO: Enable this when this is in a for-loop...
-						break; */
+						continue;
 					} else if(!strcmp(code, "307")) {
 						/* Someone was kicked from the room */
 						xmlnode *reason = NULL, *actor = NULL;
--- a/pidgin/gtkimhtml.c	Mon Aug 10 04:34:15 2009 +0000
+++ b/pidgin/gtkimhtml.c	Mon Aug 10 04:40:54 2009 +0000
@@ -2953,7 +2953,7 @@
 							font->size = oldfont->size;
 						else
 							font->size = 3;
-						if ((imhtml->format_functions & (GTK_IMHTML_GROW|GTK_IMHTML_SHRINK)))
+						if ((imhtml->format_functions & (GTK_IMHTML_GROW|GTK_IMHTML_SHRINK)) && (font->size != 3 || (oldfont && oldfont->size == 3)))
 							gtk_imhtml_font_set_size(imhtml, font->size);
 						g_free(size);
 						fonts = g_slist_prepend (fonts, font);
--- a/pidgin/gtkmedia.c	Mon Aug 10 04:34:15 2009 +0000
+++ b/pidgin/gtkmedia.c	Mon Aug 10 04:40:54 2009 +0000
@@ -500,7 +500,7 @@
 
 	gtkmedia->priv->request_type = PURPLE_MEDIA_NONE;
 
-	purple_request_accept_cancel(gtkmedia, "Media invitation",
+	purple_request_accept_cancel(gtkmedia, _("Incoming Call"),
 			message, NULL, PURPLE_DEFAULT_ACTION_NONE,
 			(void*)account, gtkmedia->priv->screenname, NULL,
 			gtkmedia->priv->media,
--- a/po/nn.po	Mon Aug 10 04:34:15 2009 +0000
+++ b/po/nn.po	Mon Aug 10 04:40:54 2009 +0000
@@ -2,8 +2,8 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-08-02 23:34-0700\n"
-"PO-Revision-Date: 2009-08-01 13:29+0100\n"
+"POT-Creation-Date: 2009-08-09 19:06-0700\n"
+"PO-Revision-Date: 2009-08-09 02:41+0100\n"
 "Last-Translator: Yngve Spjeld Landro <nynorsk@landro.net>\n"
 "Language-Team: \n"
 "MIME-Version: 1.0\n"
@@ -12132,6 +12132,9 @@
 msgid "%s wishes to start a video session with you."
 msgstr "%s ønskjer å starta ei biletøkt med deg."
 
+msgid "_Pause"
+msgstr "_Pause"
+
 #, c-format
 msgid "%s has %d new message."
 msgid_plural "%s has %d new messages."
@@ -12673,7 +12676,7 @@
 "(%s for filnamn)"
 
 msgid "M_ute sounds"
-msgstr "&Demp lydar"
+msgstr "_Demp lydar"
 
 msgid "Sounds when conversation has _focus"
 msgstr "Lydar medan samtalevindauget har _fokus"
@@ -12688,7 +12691,7 @@
 msgstr "Spel"
 
 msgid "_Browse..."
-msgstr "Bla &gjennom…"
+msgstr "Bla _gjennom…"
 
 msgid "_Reset"
 msgstr "_Nullstill"
@@ -13068,9 +13071,6 @@
 msgid "_Open Mail"
 msgstr "_Opna e-post"
 
-msgid "_Pause"
-msgstr "_Pause"
-
 msgid "_Edit"
 msgstr "_Endra"