changeset 22664:5624eec4da24

merge of '8ac2f1461dd4df5ba43e8c0399b59451b3c549e6' and 'f29197b389e99b8fcdc2b1179c0be21644a4c170'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 13 Apr 2008 17:39:38 +0000
parents 654f8386f4b3 (current diff) 5cc1bb16edcd (diff)
children 864c82371181
files pidgin/gtkconv.c
diffstat 14 files changed, 174 insertions(+), 79 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Sun Apr 13 17:33:13 2008 +0000
+++ b/COPYRIGHT	Sun Apr 13 17:39:38 2008 +0000
@@ -52,6 +52,7 @@
 Matt Brenneke
 Jeremy Brooks
 Jonathan Brossard
+Jeffery Brown
 Philip Brown
 Norbert Buchmuller
 Sean Burke
@@ -232,6 +233,7 @@
 Matthew Luckie
 Mike Lundy
 Jason Lynch
+Iain MacDonnell
 Lucio Maciel
 Brian Macke
 Paolo Maggi
--- a/ChangeLog	Sun Apr 13 17:33:13 2008 +0000
+++ b/ChangeLog	Sun Apr 13 17:39:38 2008 +0000
@@ -3,11 +3,24 @@
 version 2.x.x:
 	libpurple:
 	* In MySpaceIM, messages from spambots are discarded (Justin Williams)
-
+	* Strip mIRC formatting codes from quit and part messages.
+	* IRC now displays ban lists in-channel for joined channels.
+	
 	Pidgin:
 	* The typing notification in the conversation history can be disabled or
 	  customized (font, color etc.) in .gtkrc-2.0.
 
+	General:
+	* The configure script now dies on more absent dependencies.  The
+	  --disable-xxx arguments to configure can be used to bypass unneeded
+	  dependencies.  This will also cause the configure script to die if an
+	  --enable-xxx option is used and the dependencies it requires are
+	  missing.
+	* The Evolution integration plugin must now be explicitly enabled.  Use
+	  the --enable-gevolution argument to configure to enable it.
+	* The Contact Availability Prediction plugin must now be explicitly
+	  enabled.  Use the --enable-cap argument to configure to enable it.
+
 version 2.4.1 (03/31/2008):
 	http://developer.pidgin.im/query?status=closed&milestone=2.4.1
 
--- a/libpurple/protocols/irc/irc.h	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/protocols/irc/irc.h	Sun Apr 13 17:39:38 2008 +0000
@@ -118,6 +118,7 @@
 void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args);
 void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, char **args);
 void irc_msg_badnick(struct irc_conn *irc, const char *name, const char *from, char **args);
+void irc_msg_ban(struct irc_conn *irc, const char *name, const char *from, char **args);
 void irc_msg_banfull(struct irc_conn *irc, const char *name, const char *from, char **args);
 void irc_msg_banned(struct irc_conn *irc, const char *name, const char *from, char **args);
 void irc_msg_chanmode(struct irc_conn *irc, const char *name, const char *from, char **args);
--- a/libpurple/protocols/irc/msgs.c	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/protocols/irc/msgs.c	Sun Apr 13 17:39:38 2008 +0000
@@ -30,6 +30,7 @@
 #include "irc.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 
 static char *irc_mask_nick(const char *mask);
 static char *irc_mask_userhost(const char *mask);
@@ -61,9 +62,11 @@
 
 static void irc_chat_remove_buddy(PurpleConversation *convo, char *data[2])
 {
-	char *message;
+	char *message, *stripped;
 
-	message = g_strdup_printf("quit: %s", data[1]);
+	stripped = data[1] ? irc_mirc2txt(data[1]) : NULL;
+	message = g_strdup_printf("quit: %s", stripped);
+	g_free(stripped);
 
 	if (purple_conv_chat_find_user(PURPLE_CONV_CHAT(convo), data[0]))
 		purple_conv_chat_remove_user(PURPLE_CONV_CHAT(convo), data[0], message);
@@ -189,6 +192,49 @@
 	purple_notify_error(gc, NULL, _("Bad mode"), args[1]);
 }
 
+void irc_msg_ban(struct irc_conn *irc, const char *name, const char *from, char **args)
+{
+	PurpleConversation *convo;
+
+	if (!args || !args[0] || !args[1])
+		return;
+
+	convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT,
+						      args[1], irc->account);
+
+	if (!strcmp(name, "367")) {
+		char *msg = NULL;
+		/* Ban list entry */
+		if (!args[2])
+			return;
+		if (args[3] && args[4]) {
+			/* This is an extended syntax, not in RFC 1459 */
+			int t1 = atoi(args[4]);
+			time_t t2 = time(NULL);
+			msg = g_strdup_printf(_("Ban on %s by %s, set %ld seconds ago"),
+			                      args[2], args[3], t2 - t1);
+		} else {
+			msg = g_strdup_printf(_("Ban on %s"), args[2]);
+		}
+		if (convo) {
+			purple_conv_chat_write(PURPLE_CONV_CHAT(convo), "", msg,
+			                       PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG,
+			                       time(NULL));
+		} else {
+			purple_debug_info("irc", "%s\n", msg);
+		}
+		g_free(msg);
+	} else if (!strcmp(name, "368")) {
+		if (!convo)
+			return;
+		/* End of ban list */
+		purple_conv_chat_write(PURPLE_CONV_CHAT(convo), "",
+		                       _("End of ban list"),
+		                       PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG,
+		                       time(NULL));
+	}
+}
+
 void irc_msg_banned(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	PurpleConnection *gc = purple_account_get_connection(irc->account);
@@ -991,7 +1037,9 @@
 		g_free(msg);
 		serv_got_chat_left(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(convo)));
 	} else {
-		purple_conv_chat_remove_user(PURPLE_CONV_CHAT(convo), nick, args[1]);
+		msg = args[1] ? irc_mirc2txt(args[1]) : NULL;
+		purple_conv_chat_remove_user(PURPLE_CONV_CHAT(convo), nick, msg);
+		g_free(msg);
 	}
 	g_free(nick);
 }
--- a/libpurple/protocols/irc/parse.c	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/protocols/irc/parse.c	Sun Apr 13 17:39:38 2008 +0000
@@ -75,6 +75,8 @@
 	{ "333", "*", irc_msg_ignore },		/* Topic setter stuff		*/
 	{ "353", "nvc:", irc_msg_names },	/* Names list			*/
 	{ "366", "nc:", irc_msg_names },	/* End of names			*/
+	{ "367", "ncnnv", irc_msg_ban },	/* Ban list			*/
+	{ "368", "nc:", irc_msg_ban },		/* End of ban list		*/
 	{ "372", "n:", irc_msg_motd },		/* MOTD				*/
 	{ "375", "n:", irc_msg_motd },		/* Start MOTD			*/
 	{ "376", "n:", irc_msg_motd },		/* End of MOTD			*/
--- a/libpurple/protocols/jabber/auth.c	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/protocols/jabber/auth.c	Sun Apr 13 17:39:38 2008 +0000
@@ -264,7 +264,7 @@
 
 static void jabber_auth_start_cyrus(JabberStream *js)
 {
-	const char *clientout = NULL, *mech = NULL;
+	const char *clientout = NULL;
 	char *enc_out;
 	unsigned coutlen = 0;
 	xmlnode *auth;
@@ -297,7 +297,7 @@
 		if (js->sasl_state==SASL_OK) {
 			sasl_setprop(js->sasl, SASL_SEC_PROPS, &secprops);
 			purple_debug_info("sasl", "Mechs found: %s\n", js->sasl_mechs->str);
-			js->sasl_state = sasl_client_start(js->sasl, js->sasl_mechs->str, NULL, &clientout, &coutlen, &mech);
+			js->sasl_state = sasl_client_start(js->sasl, js->sasl_mechs->str, NULL, &clientout, &coutlen, &js->current_mech);
 		}
 		switch (js->sasl_state) {
 			/* Success */
@@ -372,10 +372,10 @@
 				 * due to mechanism specific issues, so we want to try one of the other
 				 * supported mechanisms. This code handles that case
 				 */
-				if (mech && strlen(mech) > 0) {
+				if (js->current_mech && strlen(js->current_mech) > 0) {
 					char *pos;
-					if ((pos = strstr(js->sasl_mechs->str, mech))) {
-						g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(mech));
+					if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) {
+						g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(js->current_mech));
 					}
 					again = TRUE;
 				}
@@ -387,7 +387,7 @@
 	if (js->sasl_state == SASL_CONTINUE || js->sasl_state == SASL_OK) {
 		auth = xmlnode_new("auth");
 		xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl");
-		xmlnode_set_attrib(auth, "mechanism", mech);
+		xmlnode_set_attrib(auth, "mechanism", js->current_mech);
 		if (clientout) {
 			if (coutlen == 0) {
 				xmlnode_insert_data(auth, "=", -1);
@@ -1101,8 +1101,24 @@
 void jabber_auth_handle_failure(JabberStream *js, xmlnode *packet)
 {
 	PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
-	char *msg = jabber_parse_error(js, packet, &reason);
+	char *msg;
 
+#ifdef HAVE_CYRUS_SASL
+	if(js->auth_fail_count++ < 5) {
+		if (js->current_mech && strlen(js->current_mech) > 0) {
+			char *pos;
+			if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) {
+				g_string_erase(js->sasl_mechs, pos-js->sasl_mechs->str, strlen(js->current_mech));
+			}
+		}
+
+		sasl_dispose(&js->sasl);
+
+		jabber_auth_start_cyrus(js);
+		return;
+	}
+#endif
+	msg = jabber_parse_error(js, packet, &reason);
 	if(!msg) {
 		purple_connection_error_reason (js->gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
--- a/libpurple/protocols/jabber/jabber.h	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.h	Sun Apr 13 17:39:38 2008 +0000
@@ -158,6 +158,11 @@
 	void *sasl;
 	void *sasl_cb;
 #endif
+	/* did someone say something about the end of the struct? */
+#ifdef HAVE_CYRUS_SASL
+	const char *current_mech;
+	int auth_fail_count;
+#endif
 
 	int sasl_state;
 	int sasl_maxbuf;
--- a/libpurple/protocols/oscar/oscar.c	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sun Apr 13 17:39:38 2008 +0000
@@ -5302,7 +5302,7 @@
 	else
 		nombre = g_strdup(sn);
 
-	dialog_msg = g_strdup_printf(_("The user %s has given you permission to add you to their buddy list.  Do you want to add them?"), nombre);
+	dialog_msg = g_strdup_printf(_("The user %s has given you permission to add him or her to your buddy list.  Do you want to add this user?"), nombre);
 	g_free(nombre);
 
 	data = g_new(struct name_data, 1);
--- a/libpurple/server.c	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/server.c	Sun Apr 13 17:39:38 2008 +0000
@@ -705,7 +705,7 @@
 	if (conv == NULL)
 		conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name);
 
-	purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, message, flags, mtime);
+	purple_conv_im_write(PURPLE_CONV_IM(conv), name, message, flags, mtime);
 	g_free(message);
 
 	/*
--- a/libpurple/status.c	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/status.c	Sun Apr 13 17:39:38 2008 +0000
@@ -130,14 +130,15 @@
 	-100,   /* away                     */
 	-200,   /* extended away            */
 	-400,   /* mobile                   */
+	0,      /* tune                     */
 	-10,    /* idle, special case.      */
 	-5,     /* idle time, special case. */
 	10      /* Offline messageable      */
 };
 
-#define SCORE_IDLE      8
-#define SCORE_IDLE_TIME 9
-#define SCORE_OFFLINE_MESSAGE 10
+#define SCORE_IDLE      9
+#define SCORE_IDLE_TIME 10
+#define SCORE_OFFLINE_MESSAGE 11
 
 /**************************************************************************
  * PurpleStatusPrimitive API
--- a/libpurple/status.h	Sun Apr 13 17:33:13 2008 +0000
+++ b/libpurple/status.h	Sun Apr 13 17:39:38 2008 +0000
@@ -96,7 +96,8 @@
  */
 /*
  * If you add a value to this enum, make sure you update
- * the status_primitive_map array in status.c.
+ * the status_primitive_map array in status.c and the special-cases for idle
+ * and offline-messagable just below it.
  */
 typedef enum
 {
@@ -110,7 +111,6 @@
 	PURPLE_STATUS_MOBILE,
 	PURPLE_STATUS_TUNE,
 	PURPLE_STATUS_NUM_PRIMITIVES
-
 } PurpleStatusPrimitive;
 
 #include "account.h"
--- a/pidgin/gtkconv.c	Sun Apr 13 17:33:13 2008 +0000
+++ b/pidgin/gtkconv.c	Sun Apr 13 17:39:38 2008 +0000
@@ -6538,7 +6538,9 @@
 				markup = title;
 			}
 		} else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
-			const char *topic = gtkconv->u.chat->topic_text ? gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text)) : NULL;
+			const char *topic = gtkconv->u.chat->topic_text
+				? gtk_entry_get_text(GTK_ENTRY(gtkconv->u.chat->topic_text))
+				: NULL;
 			char *esc = NULL, *tmp;
 #if GTK_CHECK_VERSION(2,6,0)
 			esc = topic ? g_markup_escape_text(topic, -1) : NULL;
@@ -6548,20 +6550,22 @@
 			int len = 0;
 			char *c;
 
-			tmp = g_strdup(topic);
-			c = tmp;
-			while(*c && len < 72) {
-				c = g_utf8_next_char(c);
-				len++;
+			if (topic != NULL) {
+				tmp = g_strdup(topic);
+				c = tmp;
+				while(*c && len < 72) {
+					c = g_utf8_next_char(c);
+					len++;
+				}
+				if (len == 72) {
+					*c = '\0';
+					c = g_strdup_printf("%s...", tmp);
+					g_free(tmp);
+					tmp = c;
+				}
+				esc = g_markup_escape_text(tmp, -1);
+				g_free(tmp);
 			}
-			if (len == 72) {
-				*c = '\0';
-				c = g_strdup_printf("%s...", tmp);
-				g_free(tmp);
-				tmp = c;
-			}
-			esc = tmp ? g_markup_escape_text(tmp, -1) : NULL;
-			g_free(tmp);
 #endif
 			tmp = g_markup_escape_text(purple_conversation_get_title(conv), -1);
 			markup = g_strdup_printf("%s%s<span color='%s' size='smaller'>%s</span>",
--- a/pidgin/gtkmain.c	Sun Apr 13 17:33:13 2008 +0000
+++ b/pidgin/gtkmain.c	Sun Apr 13 17:39:38 2008 +0000
@@ -299,7 +299,7 @@
 	purple_sound_set_ui_ops(pidgin_sound_get_ui_ops());
 	purple_connections_set_ui_ops(pidgin_connections_get_ui_ops());
 	purple_whiteboard_set_ui_ops(pidgin_whiteboard_get_ui_ops());
-#ifdef USE_SCREENSAVER
+#if defined(USE_SCREENSAVER) || defined(HAVE_IOKIT)
 	purple_idle_set_ui_ops(pidgin_idle_get_ui_ops());
 #endif
 
--- a/po/de.po	Sun Apr 13 17:33:13 2008 +0000
+++ b/po/de.po	Sun Apr 13 17:39:38 2008 +0000
@@ -11,8 +11,8 @@
 msgstr ""
 "Project-Id-Version: de\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-04-08 19:36+0200\n"
-"PO-Revision-Date: 2008-04-08 19:35+0200\n"
+"POT-Creation-Date: 2008-04-12 10:45+0200\n"
+"PO-Revision-Date: 2008-04-12 10:45+0200\n"
 "Last-Translator: Jochen Kemnade <jochenkemnade@web.de>\n"
 "Language-Team: Deutsch <de@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -611,7 +611,7 @@
 msgstr "Buddy-Alarm hinzufügen..."
 
 msgid "View Log..."
-msgstr "Mitschnitt anzeigen.."
+msgstr "Mitschnitt anzeigen..."
 
 msgid "Enable Logging"
 msgstr "Mitschnitt einschalten"
@@ -752,17 +752,26 @@
 
 #, c-format
 msgid "%.2f KiB/s"
-msgstr "%.2f KB/s"
+msgstr "%.2f KiB/s"
+
+msgid "Sent"
+msgstr "Gesendet"
+
+msgid "Received"
+msgstr "Empfangen"
+
+msgid "Finished"
+msgstr "Fertig"
 
 #, c-format
 msgid "The file was saved as %s."
 msgstr "Die Datei wurde unter %s gespeichert."
 
-msgid "Finished"
-msgstr "Fertig"
-
-msgid "Transferring"
-msgstr "Übertragung"
+msgid "Sending"
+msgstr "Sende"
+
+msgid "Receiving"
+msgstr "Empfange"
 
 #, c-format
 msgid "Conversation in %s on %s"
@@ -5212,7 +5221,10 @@
 "versuchen Sie es später nochmal."
 
 msgid "Handshaking"
-msgstr "Händedruck"
+msgstr "Abgleich"
+
+msgid "Transferring"
+msgstr "Übertrage"
 
 msgid "Starting authentication"
 msgstr "Starte Authentifizierung"
@@ -11727,27 +11739,24 @@
 
 #, c-format
 msgid ""
-"%s%s<span weight=\"bold\">Written by:</span>\t%s\n"
-"<span weight=\"bold\">Website:</span>\t\t%s\n"
-"<span weight=\"bold\">Filename:</span>\t\t%s"
-msgstr ""
-"%s%s<span weight=\"bold\">Geschrieben von:</span>\t%s\n"
-"<span weight=\"bold\">Webseite: </span>\t\t%s\n"
-"<span weight=\"bold\">Dateiname:</span>\t\t%s"
-
-#, c-format
-msgid ""
-"%s\n"
-"<span foreground=\"#ff0000\" weight=\"bold\">Error: %s\n"
+"<span foreground=\"red\" weight=\"bold\">Error: %s\n"
 "Check the plugin website for an update.</span>"
 msgstr ""
-"%s\n"
-"<span foreground=\"#ff0000\" weight=\"bold\">Fehler: %s\n"
+"<span foreground=\"red\" weight=\"bold\">Fehler: %s\n"
 "Überprüfen Sie die Website des Plugins auf eine neue Version.</span>"
 
 msgid "Author"
 msgstr "Autor"
 
+msgid "<b>Written by:</b>"
+msgstr "<b>Geschrieben von:</b>"
+
+msgid "<b>Web site:</b>"
+msgstr "<b>Webseite:</b>"
+
+msgid "<b>Filename:</b>"
+msgstr "<b>Dateiname:</b>"
+
 msgid "Configure Pl_ugin"
 msgstr "Pl_ugin konfigurieren"
 
@@ -12498,12 +12507,8 @@
 msgstr "Kontakt-Verfügbarkeits-Vorhersage-Plugin."
 
 #. *  summary
-msgid ""
-"The contact availability plugin (cap) is used to display statistical "
-"information about buddies in a users contact list."
-msgstr ""
-"Das Kontakt-Verfügbarkeits-Plugin (cap) wird benutzt um statistische "
-"Informationen über Buddys anzuzeigen."
+msgid "Displays statistical information about your buddies' availability"
+msgstr "Statistische Informationen über die Verfügbarkeit Ihrer Buddys zeigen"
 
 msgid "Buddy is idle"
 msgstr "Buddy ist untätig"
@@ -12653,7 +12658,7 @@
 
 #. "Visual gesture display" checkbox
 msgid "_Visual gesture display"
-msgstr "_Gestiken anzeigen"
+msgstr "_Gesten anzeigen"
 
 #. *< type
 #. *< ui_requirement
@@ -12662,29 +12667,27 @@
 #. *< priority
 #. *< id
 msgid "Mouse Gestures"
-msgstr "Maus-Gestiken"
+msgstr "Maus-Gesten"
 
 #. *< name
 #. *< version
 #. *  summary
 msgid "Provides support for mouse gestures"
-msgstr "Ermöglicht die Bedienung mit Maus-Gestiken"
+msgstr "Ermöglicht die Bedienung mit Maus-Gesten"
 
 #. *  description
 msgid ""
-"Allows support for mouse gestures in conversation windows.\n"
-"Drag the middle mouse button to perform certain actions:\n"
-"\n"
-"Drag down and then to the right to close a conversation.\n"
-"Drag up and then to the left to switch to the previous conversation.\n"
-"Drag up and then to the right to switch to the next conversation."
-msgstr ""
-"Ermöglicht das Benutzen von Maus-Gestiken im Gesprächsfenster. Halten Sie "
-"die mittlere Maustaste gedrückt um folgende Aktionen auszuführen:\n"
-"\n"
-"Herunterziehen und dann nach rechts, um ein Gespräch zu beenden. Hochziehen "
-"und dann nach links, um auf ein voriges Gespräch zu wechseln. Hochziehen und "
-"dann nach rechts, um zum nächsten Gespräche zu wechseln."
+"Allows support for mouse gestures in conversation windows. Drag the middle "
+"mouse button to perform certain actions:\n"
+" • Drag down and then to the right to close a conversation.\n"
+" • Drag up and then to the left to switch to the previous conversation.\n"
+" • Drag up and then to the right to switch to the next conversation."
+msgstr ""
+"Ermöglicht das Benutzen von Maus-Gesten in Gesprächsfenstern. Halten Sie die "
+"mittlere Maustaste gedrückt um folgende Aktionen auszuführen:\n"
+" • Herunterziehen und dann nach rechts, um ein Gespräch zu beenden.\n"
+" • Hochziehen und dann nach links, um auf ein voriges Gespräch zu wechseln.\n"
+" • Hochziehen und dann nach rechts, um zum nächsten Gespräche zu wechseln."
 
 msgid "Instant Messaging"
 msgstr "Sofortnachrichten"