changeset 22046:47286f9bb434

merge of '5d18b4aee9c05f592af532f9155aadb23ad11d4b' and '6d8a02b102307c89d31b4eddc0ceee59673d157b'
author Evan Schoenberg <evan.s@dreskin.net>
date Tue, 08 Jan 2008 22:01:22 +0000
parents f4c0a7014498 (current diff) b526b6c679d9 (diff)
children 62147d5b4512
files libpurple/buddyicon.c
diffstat 15 files changed, 53 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/buddyicon.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/buddyicon.c	Tue Jan 08 22:01:22 2008 +0000
@@ -625,7 +625,7 @@
 		purple_buddy_icons_set_caching(caching);
 	}
 
-	return (icon ? purple_buddy_icon_ref(icon) : nil);
+	return (icon ? purple_buddy_icon_ref(icon) : NULL);
 }
 
 gboolean
--- a/libpurple/connection.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/connection.c	Tue Jan 08 22:01:22 2008 +0000
@@ -542,8 +542,10 @@
 
 	switch (ssl_error) {
 		case PURPLE_SSL_HANDSHAKE_FAILED:
+			reason = PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR;
+			break;
 		case PURPLE_SSL_CONNECT_FAILED:
-			reason = PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
 			break;
 		case PURPLE_SSL_CERTIFICATE_INVALID:
 			/* TODO: maybe PURPLE_SSL_* should be more specific? */
@@ -551,7 +553,7 @@
 			break;
 		default:
 			g_assert_not_reached ();
-			reason = PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR;
+			reason = PURPLE_CONNECTION_ERROR_CERT_OTHER_ERROR;
 	}
 
 	purple_connection_error_reason (gc, reason,
@@ -564,12 +566,12 @@
 	switch (reason)
 	{
 		case PURPLE_CONNECTION_ERROR_NETWORK_ERROR:
+		case PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR:
 			return FALSE;
 		case PURPLE_CONNECTION_ERROR_INVALID_USERNAME:
 		case PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED:
 		case PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE:
 		case PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT:
-		case PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR:
 		case PURPLE_CONNECTION_ERROR_NAME_IN_USE:
 		case PURPLE_CONNECTION_ERROR_INVALID_SETTINGS:
 		case PURPLE_CONNECTION_ERROR_OTHER_ERROR:
--- a/libpurple/protocols/irc/cmds.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/irc/cmds.c	Tue Jan 08 22:01:22 2008 +0000
@@ -368,10 +368,10 @@
 			end = cur + strlen(cur);
 		msg = g_strndup(cur, end - cur);
 
-		if(!strcmp(cmd, "msg"))
+		if(!strcmp(cmd, "notice"))
+			buf = irc_format(irc, "vt:", "NOTICE", args[0], msg);
+		else
 			buf = irc_format(irc, "vt:", "PRIVMSG", args[0], msg);
-		else /* seding a notice if we get here */
-			buf = irc_format(irc, "vt:", "NOTICE", args[0], msg);
 
 		irc_send(irc, buf);
 		g_free(msg);
--- a/libpurple/protocols/msn/msn.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msn/msn.c	Tue Jan 08 22:01:22 2008 +0000
@@ -461,7 +461,7 @@
 	msn_switchboard_request_add_user(swboard, buddy->name);
 
 	/* TODO: This might move somewhere else, after USR might be */
-	swboard->chat_id = session->conv_seq++;
+	swboard->chat_id = msn_switchboard_get_chat_id();
 	swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat");
 	swboard->flag = MSN_SB_FLAG_IM;
 
--- a/libpurple/protocols/msn/session.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msn/session.c	Tue Jan 08 22:01:22 2008 +0000
@@ -48,7 +48,6 @@
 	/*if you want to chat with Yahoo Messenger*/
 	//session->protocol_ver = WLM_YAHOO_PROT_VER;
 	session->protocol_ver = WLM_PROT_VER;
-	session->conv_seq = 1;
 
 	return session;
 }
--- a/libpurple/protocols/msn/session.h	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msn/session.h	Tue Jan 08 22:01:22 2008 +0000
@@ -107,8 +107,6 @@
 	GList *directconns; /**< The list of all the directconnections. */
 	GList *slplinks; /**< The list of all the slplinks. */
 
-	int conv_seq; /**< The current conversation sequence number. */
-
 	/*psm info*/
 	char *psm;
 
--- a/libpurple/protocols/msn/switchboard.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Tue Jan 08 22:01:22 2008 +0000
@@ -164,6 +164,14 @@
 	return swboard->session_id;
 }
 
+int
+msn_switchboard_get_chat_id(void)
+{
+	static int chat_id = 1;
+
+	return chat_id++;
+}
+
 void
 msn_switchboard_set_invited(MsnSwitchBoard *swboard, gboolean invited)
 {
@@ -250,7 +258,7 @@
 				purple_conversation_destroy(swboard->conv);
 #endif
 
-			swboard->chat_id = cmdproc->session->conv_seq++;
+			swboard->chat_id = msn_switchboard_get_chat_id();
 			swboard->flag |= MSN_SB_FLAG_IM;
 			swboard->conv = serv_got_joined_chat(account->gc,
 												 swboard->chat_id,
--- a/libpurple/protocols/msn/switchboard.h	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msn/switchboard.h	Tue Jan 08 22:01:22 2008 +0000
@@ -167,6 +167,13 @@
 const char *msn_switchboard_get_session_id(MsnSwitchBoard *swboard);
 
 /**
+ * Returns the next chat ID for use by a switchboard.
+ *
+ * @return The chat ID.
+ */
+int msn_switchboard_get_chat_id(void);
+
+/**
  * Sets whether or not we were invited to this switchboard.
  *
  * @param swboard The switchboard.
--- a/libpurple/protocols/msnp9/msn.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msnp9/msn.c	Tue Jan 08 22:01:22 2008 +0000
@@ -435,7 +435,7 @@
 	msn_switchboard_request_add_user(swboard, buddy->name);
 
 	/* TODO: This might move somewhere else, after USR might be */
-	swboard->chat_id = session->conv_seq++;
+	swboard->chat_id = msn_switchboard_get_chat_id();
 	swboard->conv = serv_got_joined_chat(gc, swboard->chat_id, "MSN Chat");
 	swboard->flag = MSN_SB_FLAG_IM;
 
--- a/libpurple/protocols/msnp9/session.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msnp9/session.c	Tue Jan 08 22:01:22 2008 +0000
@@ -44,7 +44,6 @@
 								 purple_account_get_username(account), NULL);
 
 	session->protocol_ver = 9;
-	session->conv_seq = 1;
 
 	return session;
 }
--- a/libpurple/protocols/msnp9/session.h	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msnp9/session.h	Tue Jan 08 22:01:22 2008 +0000
@@ -103,8 +103,6 @@
 	GList *directconns; /**< The list of all the directconnections. */
 	GList *slplinks; /**< The list of all the slplinks. */
 
-	int conv_seq; /**< The current conversation sequence number. */
-
 	struct
 	{
 		char *kv;
--- a/libpurple/protocols/msnp9/switchboard.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msnp9/switchboard.c	Tue Jan 08 22:01:22 2008 +0000
@@ -166,6 +166,14 @@
 	return swboard->session_id;
 }
 
+int
+msn_switchboard_get_chat_id(void)
+{
+	static int chat_id = 1;
+
+	return chat_id++;
+}
+
 void
 msn_switchboard_set_invited(MsnSwitchBoard *swboard, gboolean invited)
 {
@@ -252,7 +260,7 @@
 				purple_conversation_destroy(swboard->conv);
 #endif
 
-			swboard->chat_id = cmdproc->session->conv_seq++;
+			swboard->chat_id = msn_switchboard_get_chat_id();
 			swboard->flag |= MSN_SB_FLAG_IM;
 			swboard->conv = serv_got_joined_chat(account->gc,
 												 swboard->chat_id,
--- a/libpurple/protocols/msnp9/switchboard.h	Tue Jan 08 21:58:31 2008 +0000
+++ b/libpurple/protocols/msnp9/switchboard.h	Tue Jan 08 22:01:22 2008 +0000
@@ -167,6 +167,13 @@
 const char *msn_switchboard_get_session_id(MsnSwitchBoard *swboard);
 
 /**
+ * Returns the next chat ID for use by a switchboard.
+ *
+ * @return The chat ID.
+ */
+int msn_switchboard_get_chat_id(void);
+
+/**
  * Sets whether or not we were invited to this switchboard.
  *
  * @param swboard The switchboard.
--- a/pidgin/gtkconv.c	Tue Jan 08 21:58:31 2008 +0000
+++ b/pidgin/gtkconv.c	Tue Jan 08 22:01:22 2008 +0000
@@ -3365,6 +3365,7 @@
 	}
 }
 
+#if 0
 static gboolean
 typing_animation(gpointer data) {
 	PidginConversation *gtkconv = data;
@@ -3403,6 +3404,7 @@
 	gtk_widget_show(gtkwin->menu.typing_icon);
 	return TRUE;
 }
+#endif
 
 static void
 update_typing_message(PidginConversation *gtkconv, const char *message)
@@ -3438,8 +3440,6 @@
 	PidginWindow *gtkwin;
 	PurpleConvIm *im = NULL;
 	PurpleConversation *conv = gtkconv->active_conv;
-	char *stock_id;
-	const char *tooltip;
 	char *message = NULL;
 
 	gtkwin = gtkconv->win;
@@ -3447,55 +3447,20 @@
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
 		im = PURPLE_CONV_IM(conv);
 
-	if (gtkwin->menu.typing_icon) {
-		gtk_widget_hide(gtkwin->menu.typing_icon);
-	}
-
 	if (im == NULL)
 		return;
 
 	if (purple_conv_im_get_typing_state(im) == PURPLE_NOT_TYPING) {
-		if (gtkconv->u.im->typing_timer != 0) {
-			g_source_remove(gtkconv->u.im->typing_timer);
-			gtkconv->u.im->typing_timer = 0;
-		}
 		update_typing_message(gtkconv, "\n");
 		return;
 	}
 
 	if (purple_conv_im_get_typing_state(im) == PURPLE_TYPING) {
-		if (gtkconv->u.im->typing_timer == 0) {
-			gtkconv->u.im->typing_timer = g_timeout_add(250, typing_animation, gtkconv);
-		}
-		stock_id = PIDGIN_STOCK_ANIMATION_TYPING1;
-		tooltip = _("User is typing...");
 		message = g_strdup_printf(_("\n%s is typing..."), purple_conversation_get_title(conv));
 	} else {
-		stock_id = PIDGIN_STOCK_ANIMATION_TYPING5;
-		tooltip = _("User has typed something and stopped");
-		message = g_strdup_printf(_("\n%s has typed something and stopped"), purple_conversation_get_title(conv));
-		if (gtkconv->u.im->typing_timer != 0) {
-			g_source_remove(gtkconv->u.im->typing_timer);
-			gtkconv->u.im->typing_timer = 0;
-		}
-	}
-
-	if (gtkwin->menu.typing_icon == NULL)
-	{
-		gtkwin->menu.typing_icon = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_MENU);
-		pidgin_menu_tray_append(PIDGIN_MENU_TRAY(gtkwin->menu.tray),
-								  gtkwin->menu.typing_icon,
-								  tooltip);
-	}
-	else
-	{
-		gtk_image_set_from_stock(GTK_IMAGE(gtkwin->menu.typing_icon), stock_id, GTK_ICON_SIZE_MENU);
-		pidgin_menu_tray_set_tooltip(PIDGIN_MENU_TRAY(gtkwin->menu.tray),
-									   gtkwin->menu.typing_icon,
-									   tooltip);
-	}
-
-	gtk_widget_show(gtkwin->menu.typing_icon);
+		message = g_strdup_printf(_("\n%s has stopped typing"), purple_conversation_get_title(conv));
+	}
+
 	update_typing_message(gtkconv, message);
 	g_free(message);
 }
@@ -6594,7 +6559,7 @@
 			pango_attr_list_unref(list);
 		} else
 			gtk_label_set_attributes(GTK_LABEL(gtkconv->tab_label), NULL);
-
+		
 		if (pidgin_conv_window_is_active_conversation(conv))
 			update_typing_icon(gtkconv);
 
--- a/po/de.po	Tue Jan 08 21:58:31 2008 +0000
+++ b/po/de.po	Tue Jan 08 22:01:22 2008 +0000
@@ -11,8 +11,8 @@
 msgstr ""
 "Project-Id-Version: de\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-01-07 20:02+0100\n"
-"PO-Revision-Date: 2008-01-07 20:02+0100\n"
+"POT-Creation-Date: 2008-01-08 11:16+0100\n"
+"PO-Revision-Date: 2008-01-08 11:15+0100\n"
 "Last-Translator: Jochen Kemnade <jochenkemnade@web.de>\n"
 "Language-Team: Deutsch <de@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -10490,16 +10490,13 @@
 msgid "User is typing..."
 msgstr "Benutzer tippt gerade..."
 
-msgid "User has typed something and stopped"
-msgstr "Benutzer hat etwas getippt und wartet nun"
-
 #, c-format
 msgid ""
 "\n"
-"%s has typed something and stopped"
+"%s has stopped typing"
 msgstr ""
 "\n"
-"%s hat etwas getippt und wartet nun"
+"%s hat aufgehört zu tippen"
 
 #. Build the Send To menu
 msgid "S_end To"
@@ -13260,6 +13257,3 @@
 msgid "This plugin is useful for debbuging XMPP servers or clients."
 msgstr ""
 "Dieses Plugin ist nützlich zur Fehlersuche in XMPP-Servern oder -Clients."
-
-#~ msgid "Display Statistics"
-#~ msgstr "Statistik anzeigen"