changeset 17721:68f634d5f5f5

propagate from branch 'im.pidgin.pidgin' (head faebb5b94eeb15c49559aa2b3c3ce87c9a38a763) to branch 'org.maemo.garage.pidgin.pidgin.pidgin-create-window' (head 0a8f3caadedcc4862887fa8bd7695aa5ac2dff3e)
author Gabriel Schulhof <nix@go-nix.ca>
date Fri, 18 May 2007 22:32:30 +0000
parents 92c3c2eeba87 (current diff) 9c8172ddc72d (diff)
children c02305ee715a
files pidgin/gtkconv.c
diffstat 8 files changed, 55 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 18 22:04:01 2007 +0000
+++ b/ChangeLog	Fri May 18 22:32:30 2007 +0000
@@ -29,8 +29,9 @@
 	  formatting in <span> tags too
 	* File transfer progress for transfers on MSN is now correctly displayed
 	* You can set/change alias of buddies/chats by double-clicking on the
-	  conversation tabs. (Ma Xuan)
+	  conversation tabs (Ma Xuan)
 	* Fix IRC connection bug with dircproxy (xjoe)
+	* Ctrl+[shift]+tab focuses the next most active tab (William Thompson)
 
 	Finch:
 	* Userlist in chat windows, which can be turned on or off using
@@ -43,6 +44,7 @@
 	* Work around an ncurses bug which appears when half of a multi-cell
 	  character is covered by an upper-level window
 	* New plugins are shown in bold text in the plugin dialog
+	* Nicer HTML screendumps
 
 version 2.0.0 (5/3/2007):
 	* The project has new names - libpurple for the core, Pidgin for the
--- a/finch/plugins/gntgf.c	Fri May 18 22:04:01 2007 +0000
+++ b/finch/plugins/gntgf.c	Fri May 18 22:32:30 2007 +0000
@@ -56,7 +56,8 @@
 #include <gntlabel.h>
 #include <gnttree.h>
 
-#include <gntplugin.h>
+#include "gntplugin.h"
+#include "gntconv.h"
 
 typedef struct
 {
@@ -154,7 +155,7 @@
 #endif
 
 static void
-notify(const char *fmt, ...)
+notify(PurpleConversation *conv, const char *fmt, ...)
 {
 	GntWidget *window;
 	GntToast *toast;
@@ -164,6 +165,13 @@
 
 	if (purple_prefs_get_bool(PREFS_BEEP))
 		beep();
+
+	if (conv != NULL) {
+		FinchConv *fc = conv->ui_data;
+		if (gnt_widget_has_focus(fc->window))
+			return;
+	}
+
 #ifdef HAVE_X11
 	if (purple_prefs_get_bool(PREFS_URGENT))
 		urgent();
@@ -220,14 +228,14 @@
 buddy_signed_on(PurpleBuddy *buddy, gpointer null)
 {
 	if (purple_prefs_get_bool(PREFS_EVENT_SIGNONF))
-		notify(_("%s just signed on"), purple_buddy_get_alias(buddy));
+		notify(NULL, _("%s just signed on"), purple_buddy_get_alias(buddy));
 }
 
 static void
 buddy_signed_off(PurpleBuddy *buddy, gpointer null)
 {
 	if (purple_prefs_get_bool(PREFS_EVENT_SIGNONF))
-		notify(_("%s just signed off"), purple_buddy_get_alias(buddy));
+		notify(NULL, _("%s just signed off"), purple_buddy_get_alias(buddy));
 }
 
 static void
@@ -235,7 +243,7 @@
 		PurpleConversation *conv, PurpleMessageFlags flags, gpointer null)
 {
 	if (purple_prefs_get_bool(PREFS_EVENT_IM_MSG))
-		notify(_("%s sent you a message"), sender);
+		notify(conv, _("%s sent you a message"), sender);
 }
 
 static void
@@ -254,9 +262,9 @@
 
 	if (purple_prefs_get_bool(PREFS_EVENT_CHAT_NICK) &&
 			(purple_utf8_has_word(msg, nick)))
-		notify(_("%s said your nick in %s"), sender, purple_conversation_get_name(conv));
+		notify(conv, _("%s said your nick in %s"), sender, purple_conversation_get_name(conv));
 	else if (purple_prefs_get_bool(PREFS_EVENT_CHAT_MSG))
-		notify(_("%s sent a message in %s"), sender, purple_conversation_get_name(conv));
+		notify(conv, _("%s sent a message in %s"), sender, purple_conversation_get_name(conv));
 }
 
 static gboolean
--- a/libpurple/protocols/oscar/oscar.c	Fri May 18 22:04:01 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Fri May 18 22:32:30 2007 +0000
@@ -4143,6 +4143,7 @@
 			conn->sn, msg->str, &tmp, &tmplen, &charset, &charsubset);
 	g_string_free(msg, TRUE);
 	msg = g_string_new_len(tmp, tmplen);
+	g_free(tmp);
 
 	/* Append any binary data that we may have */
 	if (oscar_id) {
--- a/libpurple/protocols/simple/simple.c	Fri May 18 22:04:01 2007 +0000
+++ b/libpurple/protocols/simple/simple.c	Fri May 18 22:32:30 2007 +0000
@@ -277,18 +277,18 @@
 							auth->nonce, noncecount, NULL, auth->digest_session_key);
 		purple_debug(PURPLE_DEBUG_MISC, "simple", "response %s\n", response);
 
-		ret = g_strdup_printf("Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", nc=\"%s\", response=\"%s\"\r\n", authuser, auth->realm, auth->nonce, target, noncecount, response);
+		ret = g_strdup_printf("Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", nc=\"%s\", response=\"%s\"", authuser, auth->realm, auth->nonce, target, noncecount, response);
 		g_free(response);
 		return ret;
 	} else if(auth->type == 2) { /* NTLM */
 		if(auth->nc == 3 && auth->nonce) {
 			/* TODO: Don't hardcode "purple" as the hostname */
 			ret = purple_ntlm_gen_type3(authuser, sip->password, "purple", authdomain, (const guint8 *)auth->nonce, &auth->flags);
-			tmp = g_strdup_printf("NTLM qop=\"auth\", opaque=\"%s\", realm=\"%s\", targetname=\"%s\", gssapi-data=\"%s\"\r\n", auth->opaque, auth->realm, auth->target, ret);
+			tmp = g_strdup_printf("NTLM qop=\"auth\", opaque=\"%s\", realm=\"%s\", targetname=\"%s\", gssapi-data=\"%s\"", auth->opaque, auth->realm, auth->target, ret);
 			g_free(ret);
 			return tmp;
 		}
-		tmp = g_strdup_printf("NTLM qop=\"auth\", realm=\"%s\", targetname=\"%s\", gssapi-data=\"\"\r\n", auth->realm, auth->target);
+		tmp = g_strdup_printf("NTLM qop=\"auth\", realm=\"%s\", targetname=\"%s\", gssapi-data=\"\"", auth->realm, auth->target);
 		return tmp;
 	}
 
@@ -298,7 +298,7 @@
 						auth->nonce, noncecount, NULL, auth->digest_session_key);
 	purple_debug(PURPLE_DEBUG_MISC, "simple", "response %s\n", response);
 
-	ret = g_strdup_printf("Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", nc=\"%s\", response=\"%s\"\r\n", authuser, auth->realm, auth->nonce, target, noncecount, response);
+	ret = g_strdup_printf("Digest username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", nc=\"%s\", response=\"%s\"", authuser, auth->realm, auth->nonce, target, noncecount, response);
 	g_free(response);
 	return ret;
 }
@@ -630,14 +630,12 @@
 	if(addheaders) addh = addheaders;
 	if(sip->registrar.type && !strcmp(method, "REGISTER")) {
 		buf = auth_header(sip, &sip->registrar, method, url);
-		auth = g_strdup_printf("Authorization: %s", buf);
+		auth = g_strdup_printf("Authorization: %s\r\n", buf);
 		g_free(buf);
 		purple_debug(PURPLE_DEBUG_MISC, "simple", "header %s", auth);
-	}
-
-	if(sip->proxy.type && strcmp(method, "REGISTER")) {
+	} else if(sip->proxy.type && strcmp(method, "REGISTER")) {
 		buf = auth_header(sip, &sip->proxy, method, url);
-		auth = g_strdup_printf("Proxy-Authorization: %s", buf);
+		auth = g_strdup_printf("Proxy-Authorization: %s\r\n", buf);
 		g_free(buf);
 		purple_debug(PURPLE_DEBUG_MISC, "simple", "header %s", auth);
 	}
@@ -984,8 +982,8 @@
 		state = xmlnode_get_child(isc, "state");
 
 		if(!state) {
-			purple_debug_info("simple", "process_incoming_message: no state found\n");
-			xmlnode_free(isc);
+				purple_debug_info("simple", "process_incoming_message: no state found\n");
+				xmlnode_free(isc);
 			return;
 		}
 
--- a/pidgin/gtkconv.c	Fri May 18 22:04:01 2007 +0000
+++ b/pidgin/gtkconv.c	Fri May 18 22:32:30 2007 +0000
@@ -1755,7 +1755,8 @@
 static void
 move_to_next_unread_tab(PidginConversation *gtkconv, gboolean forward)
 {
-	PidginConversation *next_gtkconv = NULL;
+	PidginConversation *next_gtkconv = NULL, *most_active = NULL;
+	PidginUnseenState unseen_state = PIDGIN_UNSEEN_NONE;
 	PidginWindow *win;
 	int initial, i, total, diff;
 
@@ -1771,17 +1772,21 @@
 
 	for (i = (initial + diff) % total; i != initial; i = (i + diff) % total) {
 		next_gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, i);
-		if (next_gtkconv->unseen_state > 0)
-			break;
-	}
-
-	if (i == initial) { /* no new messages */
+		if (next_gtkconv->unseen_state > unseen_state) {
+			most_active = next_gtkconv;
+			unseen_state = most_active->unseen_state;
+			if(PIDGIN_UNSEEN_NICK == unseen_state) /* highest possible state */
+				break;
+		}
+	}
+
+	if (most_active == NULL) { /* no new messages */
 		i = (i + diff) % total;
-		next_gtkconv = pidgin_conv_window_get_gtkconv_at_index(win, i);
-	}
-
-	if (next_gtkconv != NULL && next_gtkconv != gtkconv)
-		pidgin_conv_window_switch_gtkconv(win, next_gtkconv);
+		most_active = pidgin_conv_window_get_gtkconv_at_index(win, i);
+	}
+
+	if (most_active != NULL && most_active != gtkconv)
+		pidgin_conv_window_switch_gtkconv(win, most_active);
 }
 
 static gboolean
--- a/pidgin/gtkimhtml.c	Fri May 18 22:04:01 2007 +0000
+++ b/pidgin/gtkimhtml.c	Fri May 18 22:32:30 2007 +0000
@@ -4441,7 +4441,7 @@
 		}
 	}
 
-	if (imhtml_smiley->flags & GTK_IMHTML_SMILEY_CUSTOM) {
+	if (imhtml_smiley && imhtml_smiley->flags & GTK_IMHTML_SMILEY_CUSTOM) {
 		ebox = gtk_event_box_new();
 		gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox), FALSE);
 		gtk_widget_show(ebox);
--- a/pidgin/gtkstatusbox.c	Fri May 18 22:04:01 2007 +0000
+++ b/pidgin/gtkstatusbox.c	Fri May 18 22:32:30 2007 +0000
@@ -2334,11 +2334,16 @@
 
 	buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(status_box->imhtml));
 
+	height = 0;
 	wrapped_lines = 1;
 	gtk_text_buffer_get_start_iter(buffer, &iter);
-	gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline);
-	while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(status_box->imhtml), &iter))
+	do {
+		gtk_text_view_get_iter_location(GTK_TEXT_VIEW(status_box->imhtml), &iter, &oneline);
+		height += oneline.height;
 		wrapped_lines++;
+		if (wrapped_lines > 4)
+			break;
+	} while (gtk_text_view_forward_display_line(GTK_TEXT_VIEW(status_box->imhtml), &iter));
 
 	lines = gtk_text_buffer_get_line_count(buffer);
 
@@ -2350,8 +2355,8 @@
 	pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(status_box->imhtml));
 	pad_inside = gtk_text_view_get_pixels_inside_wrap(GTK_TEXT_VIEW(status_box->imhtml));
 
-	height = (oneline.height + pad_top + pad_bottom) * lines;
-	height += (oneline.height + pad_inside) * (wrapped_lines - lines);
+	height += (pad_top + pad_bottom) * lines;
+	height += (pad_inside) * (wrapped_lines - lines);
 
 	gtk_widget_set_size_request(status_box->vbox, -1, height + PIDGIN_HIG_BOX_SPACE);
 }
--- a/pidgin/win32/winpidgin.c	Fri May 18 22:04:01 2007 +0000
+++ b/pidgin/win32/winpidgin.c	Fri May 18 22:32:30 2007 +0000
@@ -145,7 +145,7 @@
 		putenv(settingsdir);
 
 		snprintf(aspelldir, sizeof(aspelldir), "PIDGIN_ASPELL_DIR=%s\\Aspell\\bin", path);
-		printf("%s", aspelldir);
+		printf("%s\n", aspelldir);
 		putenv(aspelldir);
 
 		/* set the GTK+ path to be \\path\to\GTK\bin */