pidgin: 37d6f8af: Strip mIRC formatting codes from PART an...

elb at pidgin.im elb at pidgin.im
Sat Apr 12 16:25:37 EDT 2008


-----------------------------------------------------------------
Revision: 37d6f8af593bffa17bba1823a3c5a8612bcfdf18
Ancestor: 826ffa5b206886c18f53cd9271876ae6b4f0340c
Author: elb at pidgin.im
Date: 2008-04-12T19:40:06
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/37d6f8af593bffa17bba1823a3c5a8612bcfdf18

Modified files:
        ChangeLog libpurple/protocols/irc/msgs.c

ChangeLog: 

Strip mIRC formatting codes from PART and QUIT messages.

References #5495

-------------- next part --------------
============================================================
--- ChangeLog	44f1b73b09609d921ff24dc4559c8e58d4d95363
+++ ChangeLog	414e352e54682992c0d07a2132f4ce42d6f8e021
@@ -3,7 +3,8 @@ version 2.x.x:
 version 2.x.x:
 	libpurple:
 	* In MySpaceIM, messages from spambots are discarded (Justin Williams)
-
+	* Strip mIRC formatting codes from quit and part messages.
+	
 	Pidgin:
 	* The typing notification in the conversation history can be disabled or
 	  customized (font, color etc.) in .gtkrc-2.0.
============================================================
--- libpurple/protocols/irc/msgs.c	76e6395bef71aa519327f57dbf3fd688424c2858
+++ libpurple/protocols/irc/msgs.c	93bebb730f37d6151c180b868a8124bf0e4003aa
@@ -61,9 +61,11 @@ static void irc_chat_remove_buddy(Purple
 
 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);
@@ -991,7 +993,9 @@ void irc_msg_part(struct irc_conn *irc, 
 		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);
 }


More information about the Commits mailing list