changeset 17495:8b322c8afeb6

propagate from branch 'im.pidgin.pidgin' (head 5c2d6effc264261827fe521b1ae841611b61dde6) to branch 'im.pidgin.soc.2007.certmgr' (head 6a6fa8ac35fd753ae9141f59e9e6dbcf811162fe)
author William Ehlhardt <williamehlhardt@gmail.com>
date Tue, 29 May 2007 16:20:39 +0000
parents b31f53796f3b (diff) 5ba545dfe2d6 (current diff)
children e0eb1eb5b47b
files
diffstat 12 files changed, 140 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/irc/msgs.c	Sun May 27 23:56:14 2007 +0000
+++ b/libpurple/protocols/irc/msgs.c	Tue May 29 16:20:39 2007 +0000
@@ -369,6 +369,7 @@
 
 	if (!strcmp(name, "322")) {
 		PurpleRoomlistRoom *room;
+		char *topic;
 
 		if (!args[0] || !args[1] || !args[2] || !args[3])
 			return;
@@ -376,7 +377,9 @@
 		room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM, args[1], NULL);
 		purple_roomlist_room_add_field(irc->roomlist, room, args[1]);
 		purple_roomlist_room_add_field(irc->roomlist, room, GINT_TO_POINTER(strtol(args[2], NULL, 10)));
-		purple_roomlist_room_add_field(irc->roomlist, room, args[3]);
+		topic = irc_mirc2txt(args[3]);
+		purple_roomlist_room_add_field(irc->roomlist, room, topic);
+		g_free(topic);
 		purple_roomlist_room_add(irc->roomlist, room);
 	}
 }
--- a/libpurple/protocols/irc/parse.c	Sun May 27 23:56:14 2007 +0000
+++ b/libpurple/protocols/irc/parse.c	Tue May 29 16:20:39 2007 +0000
@@ -402,6 +402,22 @@
 		switch (result[i]) {
 		case '\002':
 		case '\003':
+			/* Foreground color */
+			if (isdigit(result[i + 1]))
+				i++;
+			if (isdigit(result[i + 1]))
+				i++;
+			/* Optional comma and background color */
+			if (result[i + 1] == ',') {
+				i++;
+				if (isdigit(result[i + 1]))
+					i++;
+				if (isdigit(result[i + 1]))
+					i++;
+			}
+			/* Note that i still points to the last character
+			 * of the color selection string. */
+			continue;
 		case '\007':
 		case '\017':
 		case '\026':
--- a/libpurple/protocols/jabber/disco.c	Sun May 27 23:56:14 2007 +0000
+++ b/libpurple/protocols/jabber/disco.c	Tue May 29 16:20:39 2007 +0000
@@ -224,17 +224,17 @@
 		/* If the server supports JABBER_CAP_GOOGLE_ROSTER; we will have already requested it */
 		jabber_roster_request(js);
 	}
-	
+
 	/* Send initial presence; this will trigger receipt of presence for contacts on the roster */
 	gpresence = purple_account_get_presence(js->gc->account);
 	status = purple_presence_get_active_status(gpresence);
-	jabber_presence_send(js->gc->account, status);	
+	jabber_presence_send(js->gc->account, status);
 }
 
 static void
 jabber_disco_server_info_result_cb(JabberStream *js, xmlnode *packet, gpointer data)
 {
-  	xmlnode *query, *child;
+	xmlnode *query, *child;
 	const char *from = xmlnode_get_attrib(packet, "from");
 	const char *type = xmlnode_get_attrib(packet, "type");
 
@@ -257,7 +257,7 @@
 		return;
 	}
 
-	for (child = xmlnode_get_child(query, "identity"); child; 
+	for (child = xmlnode_get_child(query, "identity"); child;
 	     child = xmlnode_get_next_twin(child)) {
 		const char *category, *type, *name;
 		category = xmlnode_get_attrib(child, "category");
@@ -266,7 +266,7 @@
 		type = xmlnode_get_attrib(child, "type");
 		if (!type || strcmp(type, "im"))
 			continue;
-		
+
 		name = xmlnode_get_attrib(child, "name");
 		if (!name)
 			continue;
@@ -279,7 +279,7 @@
 		}
 	}
 
-	for (child = xmlnode_get_child(query, "feature"); child; 
+	for (child = xmlnode_get_child(query, "feature"); child;
 	     child = xmlnode_get_next_twin(child)) {
 		const char *var;
 		var = xmlnode_get_attrib(child, "var");
@@ -324,11 +324,16 @@
 	for(child = xmlnode_get_child(query, "item"); child;
 			child = xmlnode_get_next_twin(child)) {
 		JabberIq *iq;
-		const char *jid;
+		const char *jid, *node;
 
 		if(!(jid = xmlnode_get_attrib(child, "jid")))
 			continue;
 
+		/* we don't actually care about the specific nodes,
+		 * so we won't query them */
+		if((node = xmlnode_get_attrib(child, "node")))
+			continue;
+
 		iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info");
 		xmlnode_set_attrib(iq->node, "to", jid);
 		jabber_iq_send(iq);
--- a/libpurple/protocols/jabber/presence.c	Sun May 27 23:56:14 2007 +0000
+++ b/libpurple/protocols/jabber/presence.c	Tue May 29 16:20:39 2007 +0000
@@ -106,11 +106,12 @@
 		return;
 
 	disconnected = purple_account_is_disconnected(account);
-	primitive = purple_status_type_get_primitive(purple_status_get_type(status));
 
 	if(disconnected)
 		return;
 
+	primitive = purple_status_type_get_primitive(purple_status_get_type(status));
+
 	gc = purple_account_get_connection(account);
 	js = gc->proto_data;
 
--- a/libpurple/protocols/jabber/si.c	Sun May 27 23:56:14 2007 +0000
+++ b/libpurple/protocols/jabber/si.c	Tue May 29 16:20:39 2007 +0000
@@ -26,6 +26,7 @@
 #include "cipher.h"
 #include "debug.h"
 #include "ft.h"
+#include "request.h"
 #include "network.h"
 #include "notify.h"
 
@@ -769,6 +770,36 @@
 	}
 }
 
+static void resource_select_cancel_cb(PurpleXfer *xfer, PurpleRequestFields *fields)
+{
+	purple_xfer_cancel_local(xfer);
+}
+
+static void do_transfer_send(PurpleXfer *xfer, const char *resource)
+{
+	JabberSIXfer *jsx = xfer->data;
+	char **who_v = g_strsplit(xfer->who, "/", 2);
+	char *who;
+
+	who = g_strdup_printf("%s/%s", who_v[0], resource);
+	g_strfreev(who_v);
+	g_free(xfer->who);
+	xfer->who = who;
+	jabber_disco_info_do(jsx->js, who,
+			jabber_si_xfer_send_disco_cb, xfer);
+}
+
+static void resource_select_ok_cb(PurpleXfer *xfer, PurpleRequestFields *fields)
+{
+	PurpleRequestField *field = purple_request_fields_get_field(fields, "resource");
+	int selected_id = purple_request_field_choice_get_value(field);
+	GList *labels = purple_request_field_choice_get_labels(field);
+
+	const char *selected_label = g_list_nth_data(labels, selected_id);
+
+	do_transfer_send(xfer, selected_label);
+}
+
 static void jabber_si_xfer_init(PurpleXfer *xfer)
 {
 	JabberSIXfer *jsx = xfer->data;
@@ -776,26 +807,65 @@
 	if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) {
 		JabberBuddy *jb;
 		JabberBuddyResource *jbr = NULL;
+		char *resource;
+
+		if(NULL != (resource = jabber_get_resource(xfer->who))) {
+			/* they've specified a resource, no need to ask or
+			 * default or anything, just do it */
+
+			do_transfer_send(xfer, resource);
+			g_free(resource);
+		}
 
 		jb = jabber_buddy_find(jsx->js, xfer->who, TRUE);
-		/* XXX */
-		if(!jb)
-			return;
+
+		if(!jb || !jb->resources) {
+			/* no resources online, we're trying to send to someone
+			 * whose presence we're not subscribed to, or
+			 * someone who is offline.  Let's inform the user */
+			char *msg;
 
-		/* XXX: for now, send to the first resource available */
-		if(jb->resources != NULL) {
-			char **who_v = g_strsplit(xfer->who, "/", 2);
-			char *who;
+			if(!jb) {
+				msg = g_strdup_printf(_("Unable to send file to %s, invalid JID"), xfer->who);
+			} else if(jb->subscription & JABBER_SUB_TO) {
+				msg = g_strdup_printf(_("Unable to send file to %s, user is not online"), xfer->who);
+			} else {
+				msg = g_strdup_printf(_("Unable to send file to %s, not subscribed to user presence"), xfer->who);
+			}
+
+			purple_notify_error(jsx->js->gc, _("File Send Failed"), _("File Send Failed"), msg);
+			g_free(msg);
+		} else if(g_list_length(jb->resources) == 1) {
+			/* only 1 resource online (probably our most common case)
+			 * so no need to ask who to send to */
+			jbr = jb->resources->data;
+
+			do_transfer_send(xfer, jbr->name);
 
-			jbr = jabber_buddy_find_resource(jb, NULL);
-			who = g_strdup_printf("%s/%s", who_v[0], jbr->name);
-			g_strfreev(who_v);
-			g_free(xfer->who);
-			xfer->who = who;
-			jabber_disco_info_do(jsx->js, who,
-					jabber_si_xfer_send_disco_cb, xfer);
 		} else {
-			return; /* XXX: ick */
+			/* we've got multiple resources, we need to pick one to send to */
+			GList *l;
+			char *msg = g_strdup_printf(_("Please select which resource of %s you would like to send a file to"), xfer->who);
+			PurpleRequestFields *fields = purple_request_fields_new();
+			PurpleRequestField *field = purple_request_field_choice_new("resource", _("Resource"), 0);
+			PurpleRequestFieldGroup *group = purple_request_field_group_new(NULL);
+
+			for(l = jb->resources; l; l = l->next)
+			{
+				jbr = l->data;
+
+				purple_request_field_choice_add(field, jbr->name);
+			}
+
+			purple_request_field_group_add_field(group, field);
+
+			purple_request_fields_add_group(fields, group);
+
+			purple_request_fields(jsx->js->gc, _("Select a Resource"), msg, NULL, fields,
+					_("Send File"), G_CALLBACK(resource_select_ok_cb), _("Cancel"), G_CALLBACK(resource_select_cancel_cb),
+					jsx->js->gc->account, xfer->who, NULL, xfer);
+
+			g_free(msg);
 		}
 	} else {
 		xmlnode *si, *feature, *x, *field, *value;
--- a/pidgin.spec.in	Sun May 27 23:56:14 2007 +0000
+++ b/pidgin.spec.in	Tue May 29 16:20:39 2007 +0000
@@ -95,6 +95,7 @@
 Obsoletes:  gaim-gadugadu
 Obsoletes:  pidgin-tcl < 2.0.0
 Obsoletes:  pidgin-silc < 2.0.0
+%{?_with_sasl:Requires:   cyrus-sasl-plain, cyrus-sasl-md5}
 
 %package -n libpurple-devel
 Summary:    Development headers, documentation, and libraries for libpurple
@@ -449,6 +450,9 @@
 %endif
 
 %changelog
+* Sun May 27 2007 Stu Tomlinson <stu@nosnilmot.com>
+- add cyrus-sasl-plain & cyrus-sasl-md5 to Requires
+
 * Thu May 24 2007 Stu Tomlinson <stu@nosnilmot.com>
 - Silence errors from gtk-update-icon-cache
 - Change Mandriva build dependencies to reflect the correct (lower case)
--- a/pidgin/gtkaccount.c	Sun May 27 23:56:14 2007 +0000
+++ b/pidgin/gtkaccount.c	Tue May 29 16:20:39 2007 +0000
@@ -433,6 +433,7 @@
 
 	/* Screen name */
 	dialog->screenname_entry = gtk_entry_new();
+	g_object_set(G_OBJECT(dialog->screenname_entry), "truncate-multiline", TRUE, NULL);
 
 	add_pref_box(dialog, vbox, _("Screen name:"), dialog->screenname_entry);
 
--- a/pidgin/gtkblist.c	Sun May 27 23:56:14 2007 +0000
+++ b/pidgin/gtkblist.c	Tue May 29 16:20:39 2007 +0000
@@ -488,11 +488,6 @@
 	pidgin_syslog_show();
 }
 
-static void gtk_blist_show_onlinehelp_cb()
-{
-	purple_notify_uri(NULL, PURPLE_WEBSITE "documentation.php");
-}
-
 static void
 do_join_chat(PidginJoinChatData *data)
 {
@@ -2845,6 +2840,7 @@
 	{ N_("/Buddies/Add C_hat..."), NULL, pidgin_blist_add_chat_cb, 0, "<StockItem>", GTK_STOCK_ADD },
 	{ N_("/Buddies/Add _Group..."), NULL, purple_blist_request_add_group, 0, "<StockItem>", GTK_STOCK_ADD },
 	{ "/Buddies/sep3", NULL, NULL, 0, "<Separator>", NULL },
+	{ N_("/Buddies/_About Pidgin"), NULL, pidgin_dialogs_about, 0,  "<Item>", NULL },
 	{ N_("/Buddies/_Quit"), "<CTL>Q", purple_core_quit, 0, "<StockItem>", GTK_STOCK_QUIT },
 
 	/* Accounts menu */
@@ -2861,14 +2857,9 @@
 	{ N_("/Tools/_File Transfers"), "<CTL>T", pidgin_xfer_dialog_show, 0, "<Item>", NULL },
 	{ N_("/Tools/R_oom List"), NULL, pidgin_roomlist_dialog_show, 0, "<Item>", NULL },
 	{ N_("/Tools/System _Log"), NULL, gtk_blist_show_systemlog_cb, 0, "<Item>", NULL },
+	{ N_("/Tools/_Debug Window"), NULL, toggle_debug, 0, "<Item>", NULL },
 	{ "/Tools/sep3", NULL, NULL, 0, "<Separator>", NULL },
 	{ N_("/Tools/Mute _Sounds"), "<CTL>S", pidgin_blist_mute_sounds_cb, 0, "<CheckItem>", NULL },
-
-	/* Help */
-	{ N_("/_Help"), NULL, NULL, 0, "<Branch>", NULL },
-	{ N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "<StockItem>", GTK_STOCK_HELP },
-	{ N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "<Item>", NULL },
-	{ N_("/Help/_About"), NULL, pidgin_dialogs_about, 0,  "<Item>", NULL },
 };
 
 /*********************************************************
@@ -3413,8 +3404,16 @@
 				"<span color='%s' size='smaller'>%s</span>",
 				dim_grey(), esc, dim_grey(),
 				statustext != NULL ? statustext : "");
-	}
-
+	} else if (!PURPLE_BUDDY_IS_ONLINE(b)) {
+		if (!selected && !statustext) /* We handle selected text later */
+			text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
+		else if (!selected && !text)
+			text = g_strdup_printf("<span color='%s'>%s</span>\n"
+				"<span color='%s' size='smaller'>%s</span>",
+				dim_grey(), esc, dim_grey(),
+				statustext != NULL ? statustext : "");
+
+	}
 	/* Not idle and not selected */
 	else if (!selected && !text)
 	{
--- a/pidgin/gtkprefs.c	Sun May 27 23:56:14 2007 +0000
+++ b/pidgin/gtkprefs.c	Tue May 29 16:20:39 2007 +0000
@@ -1693,6 +1693,7 @@
 			vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START);
 
 	sw = gtk_scrolled_window_new(NULL,NULL);
+	gtk_widget_set_size_request(sw, -1, 100);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
 
--- a/pidgin/pidginstock.c	Sun May 27 23:56:14 2007 +0000
+++ b/pidgin/pidginstock.c	Tue May 29 16:20:39 2007 +0000
@@ -109,7 +109,7 @@
 	{ PIDGIN_STOCK_STATUS_XA, 	"status", "extended-away.png",	TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, PIDGIN_STOCK_STATUS_XA_I },
 	{ PIDGIN_STOCK_STATUS_LOGIN, 	"status", "log-in.png",		TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL },
 	{ PIDGIN_STOCK_STATUS_LOGOUT, 	"status", "log-out.png",	TRUE, TRUE, TRUE, TRUE, FALSE, FALSE , NULL },
-	{ PIDGIN_STOCK_STATUS_OFFLINE, 	"status", "offline.png",	TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL  },
+	{ PIDGIN_STOCK_STATUS_OFFLINE, 	"status", "offline.png",	TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, PIDGIN_STOCK_STATUS_OFFLINE_I  },
 	{ PIDGIN_STOCK_STATUS_PERSON, 	"status", "person.png",		TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, NULL  },
 	{ PIDGIN_STOCK_STATUS_MESSAGE, 	"status", "message-pending.png",TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL  },
 	
--- a/pidgin/pidginstock.h	Sun May 27 23:56:14 2007 +0000
+++ b/pidgin/pidginstock.h	Tue May 29 16:20:39 2007 +0000
@@ -70,6 +70,7 @@
 #define PIDGIN_STOCK_STATUS_LOGIN      "pidgin-status-login"
 #define PIDGIN_STOCK_STATUS_LOGOUT     "pidgin-status-logout"
 #define PIDGIN_STOCK_STATUS_OFFLINE    "pidgin-status-offline"
+#define PIDGIN_STOCK_STATUS_OFFLINE_I  "pidgin-status-offline"
 #define PIDGIN_STOCK_STATUS_PERSON     "pidgin-status-person"
 #define PIDGIN_STOCK_STATUS_MESSAGE    "pidgin-status-message"
 
--- a/pidgin/pixmaps/emotes/default/22/theme	Sun May 27 23:56:14 2007 +0000
+++ b/pidgin/pixmaps/emotes/default/22/theme	Tue May 29 16:20:39 2007 +0000
@@ -90,7 +90,7 @@
 good.png            (Y)     (y)
 bad.png             (N)     (n)
 vampire.png         :[      :-[
-#goat.png           (nah)
+goat.png            (nah)
 sun.png             (#)
 rainbow.png         (R)     (r)
 quiet.png           :-#
@@ -122,7 +122,6 @@
 party.png           <:o)
 eyeroll.png         8-)
 yawn.png            |-) 
-goat.png            (nah)
 ! skywalker.png     C:-)    c:-)    C:)     c:)
 ! monkey.png        :-(|)