/pidgin/main: 04fa195c585c: Merge release-2.x.y

Tomasz Wasilczyk twasilczyk at pidgin.im
Tue May 6 04:46:58 EDT 2014


Changeset: 04fa195c585c8637237cc73c5b4b9899abe0be60
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-05-06 10:46 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/04fa195c585c

Description:

Merge release-2.x.y

diffstat:

 ChangeLog                               |  18 ++++-
 autogen.sh                              |   1 -
 finch/gntdebug.c                        |   1 +
 libpurple/plugins/log_reader.c          |   2 +
 libpurple/protocols/irc/cmds.c          |  90 ++++++++++++++++++++++++--------
 libpurple/protocols/sametime/sametime.c |   1 +
 libpurple/protocols/zephyr/ZOpenPort.c  |   1 +
 libpurple/protocols/zephyr/zephyr.c     |   2 +
 libpurple/util.c                        |   4 +-
 pidgin/gtkaccount.c                     |  11 +++-
 pidgin/gtkrequest.c                     |  30 ++++++++++-
 11 files changed, 127 insertions(+), 34 deletions(-)

diffs (truncated from 378 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,16 +69,24 @@ version 3.0.0 (??/??/????):
 	* Doxygen has been replaced by gtk-doc for generating documentation.
 
 version 2.10.10 (?/?/?):
-	Finch:
-	* Fix build against Python 3. (Ed Catmur) (#15969)
-
-	Gadu-Gadu:
-	* Updated internal libgadu to version 1.12.0-rc2.
+	libpurple3 compatibility:
+	* Encrypted account passwords are preserved until the new one is set.
+	* Fix loading Google Talk and Facebook XMPP accounts.
 
 	Windows-Specific Changes:
 	* Updates to dependencies:
 		* NSS 3.16 and NSPR 4.10.4
 
+	Finch:
+	* Fix build against Python 3. (Ed Catmur) (#15969)
+
+	Gadu-Gadu:
+	* Updated internal libgadu to version 1.12.0-rc2.
+
+	IRC:
+	* Fix a possible leak of unencrypted data when using /me command
+	  with OTR. (Thijs Alkemade) (#15750)
+
 version 2.10.9 (2/2/2014):
 	XMPP:
 	* Fix problems logging into some servers including jabber.org and
diff --git a/autogen.sh b/autogen.sh
--- a/autogen.sh
+++ b/autogen.sh
@@ -184,4 +184,3 @@ if test -z "$NOCONFIGURE"; then
 	echo "running ./configure ${CONFIGURE_FLAGS} $@"
 	./configure ${CONFIGURE_FLAGS} $@
 fi
-
diff --git a/finch/gntdebug.c b/finch/gntdebug.c
--- a/finch/gntdebug.c
+++ b/finch/gntdebug.c
@@ -130,6 +130,7 @@ finch_debug_print(PurpleDebugLevel level
 		{
 			case PURPLE_DEBUG_WARNING:
 				flag |= GNT_TEXT_FLAG_UNDERLINE;
+				/* fall through */
 			case PURPLE_DEBUG_ERROR:
 			case PURPLE_DEBUG_FATAL:
 				flag |= GNT_TEXT_FLAG_BOLD;
diff --git a/libpurple/plugins/log_reader.c b/libpurple/plugins/log_reader.c
--- a/libpurple/plugins/log_reader.c
+++ b/libpurple/plugins/log_reader.c
@@ -1776,6 +1776,8 @@ static GList *qip_logger_list(PurpleLogT
 	g_return_val_if_fail(sn != NULL, NULL);
 	g_return_val_if_fail(account != NULL, NULL);
 
+	memset(&tm, 0, sizeof(tm));
+
 	/* QIP only supports ICQ. */
 	if (strcmp(purple_account_get_protocol_id(account), "prpl-icq"))
 		return NULL;
diff --git a/libpurple/protocols/irc/cmds.c b/libpurple/protocols/irc/cmds.c
--- a/libpurple/protocols/irc/cmds.c
+++ b/libpurple/protocols/irc/cmds.c
@@ -95,41 +95,85 @@ int irc_cmd_ctcp_action(struct irc_conn 
 	PurpleConnection *gc = purple_account_get_connection(irc->account);
 	char *action, *escaped, *dst, **newargs;
 	const char *src;
+	char *msg;
 	PurpleConversation *convo;
 
 	if (!args || !args[0] || !gc)
 		return 0;
 
-	action = g_malloc(strlen(args[0]) + 10);
+	convo = purple_conversations_find_with_account(target, irc->account);
 
-	sprintf(action, "\001ACTION ");
+	msg = g_strdup_printf("/me %s", args[0]);
 
-	src = args[0];
-	dst = action + 8;
-	while (*src) {
-		if (*src == '\n') {
-			if (*(src + 1) == '\0') {
-				break;
-			} else {
-				*dst++ = ' ';
-				src++;
-				continue;
+	/* XXX: we'd prefer to keep this in conversation.c */
+	if (PURPLE_IS_IM_CONVERSATION(convo)) {
+		purple_signal_emit(purple_conversations_get_handle(),
+			"sending-im-msg", irc->account,
+			purple_conversation_get_name(convo), &msg);
+	} else {
+		purple_signal_emit(purple_conversations_get_handle(),
+			"sending-chat-msg", irc->account, &msg,
+			purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(convo)));
+	}
+
+	if (!msg || !msg[0]) {
+		g_free(msg);
+		return 0;
+	}
+
+	if (strncmp(msg, "/me ", 4) != 0) {
+		newargs = g_new0(char *, 2);
+		newargs[0] = g_strdup(target);
+		newargs[1] = msg;
+
+		irc_cmd_privmsg(irc, cmd, target, (const char **)newargs);
+
+		g_free(newargs[0]);
+		g_free(newargs);
+	} else {
+		action = g_malloc(strlen(&msg[4]) + 10);
+
+		sprintf(action, "\001ACTION ");
+
+		src = &msg[4];
+		dst = action + 8;
+		while (*src) {
+			if (*src == '\n') {
+				if (*(src + 1) == '\0') {
+					break;
+				} else {
+					*dst++ = ' ';
+					src++;
+					continue;
+				}
 			}
+			*dst++ = *src++;
 		}
-		*dst++ = *src++;
+		*dst++ = '\001';
+		*dst = '\0';
+
+		newargs = g_new0(char *, 2);
+		newargs[0] = g_strdup(target);
+		newargs[1] = action;
+		irc_cmd_privmsg(irc, cmd, target, (const char **)newargs);
+		g_free(newargs[0]);
+		g_free(newargs);
+		g_free(action);
 	}
-	*dst++ = '\001';
-	*dst = '\0';
 
-	newargs = g_new0(char *, 2);
-	newargs[0] = g_strdup(target);
-	newargs[1] = action;
-	irc_cmd_privmsg(irc, cmd, target, (const char **)newargs);
-	g_free(newargs[0]);
-	g_free(newargs[1]);
-	g_free(newargs);
+	/* XXX: we'd prefer to keep this in conversation.c */
+	if (PURPLE_IS_IM_CONVERSATION(convo)) {
+		purple_signal_emit(purple_conversations_get_handle(),
+			"sent-im-msg", irc->account,
+			purple_conversation_get_name(convo), msg);
+	} else {
+		purple_signal_emit(purple_conversations_get_handle(),
+			"sent-chat-msg", irc->account, msg,
+			purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(convo)));
+	}
 
-	convo = purple_conversations_find_with_account(target, irc->account);
+	g_free(msg);
+
 	if (convo) {
 		escaped = g_markup_escape_text(args[0], -1);
 		action = g_strdup_printf("/me %s", escaped);
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -1559,6 +1559,7 @@ static void mw_session_stateChange(struc
   case mwSession_LOGIN_CONT:
     msg = _("Forcing Login");
     purple_connection_update_progress(gc, msg, 7, MW_CONNECT_STEPS);
+    break;
 
   case mwSession_LOGIN_ACK:
     msg = _("Login Acknowledged");
diff --git a/libpurple/protocols/zephyr/ZOpenPort.c b/libpurple/protocols/zephyr/ZOpenPort.c
--- a/libpurple/protocols/zephyr/ZOpenPort.c
+++ b/libpurple/protocols/zephyr/ZOpenPort.c
@@ -22,6 +22,7 @@ Code_t ZOpenPort(port)
     socklen_t len;
 
     (void) ZClosePort();
+    memset(&bindin, 0, sizeof(bindin));
 
     if ((__Zephyr_fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
 	__Zephyr_fd = -1;
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -1246,6 +1246,8 @@ static gint check_notify_zeph02(gpointer
 			break;
 		case CLIENTACK:
 			purple_debug_error("zephyr", "Client ack received\n");
+			handle_unknown(notice); /* XXX: is it really unknown? */
+			break;
 		default:
 			/* we'll just ignore things for now */
 			handle_unknown(notice);
diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -1557,6 +1557,7 @@ purple_markup_find_tag(const char *needl
 				case '"':
 				case '\'':
 					in_quotes = close;
+					/* fall through */
 				case '=':
 					{
 						size_t len = close - cur;
@@ -1569,11 +1570,12 @@ purple_markup_find_tag(const char *needl
 
 						in_attr = FALSE;
 						cur = close + 1;
-						break;
 					}
+					break;
 				case ' ':
 				case '>':
 					in_attr = FALSE;
+					/* fall through */
 				default:
 					cur = close;
 					break;
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -241,10 +241,17 @@ set_account_protocol_cb(GtkWidget *widge
 
 	if (dialog->plugin != NULL)
 	{
+		PurplePlugin *old_plugin = NULL;
+
 		dialog->prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(dialog->plugin);
 
-		g_free(dialog->protocol_id);
-		dialog->protocol_id = g_strdup(dialog->plugin->info->id);
+		if (dialog->protocol_id)
+			old_plugin = purple_find_prpl(dialog->protocol_id);
+
+		if (old_plugin != new_plugin) {
+			g_free(dialog->protocol_id);
+			dialog->protocol_id = g_strdup(dialog->plugin->info->id);
+		}
 	}
 
 	if (dialog->account != NULL)
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -2165,7 +2165,9 @@ pidgin_request_fields(const char *title,
 		size_t field_count = 0;
 		size_t cols = 1;
 		size_t rows;
+#if 0
 		size_t col_num;
+#endif
 		size_t row_num = 0;
 		guint tab_no;
 		gboolean contains_resizable = FALSE, frame_fill;
@@ -2188,17 +2190,19 @@ pidgin_request_fields(const char *title,
 			frame = pages[tab_no];
 
 		field_count = g_list_length(field_list);
-/*
+#if 0
 		if (field_count > 9)
 		{
 			rows = field_count / 2;
 			cols++;
 		}
 		else
-		*/
+#endif
 			rows = field_count;
 
+#if 0
 		col_num = 0;
+#endif
 
 		for (fl = field_list; fl != NULL; fl = fl->next)
 		{
@@ -2213,8 +2217,10 @@ pidgin_request_fields(const char *title,
 
 			if (type == PURPLE_REQUEST_FIELD_LABEL)
 			{
+#if 0
 				if (col_num > 0)
 					rows++;



More information about the Commits mailing list