pidgin: 63f378af: Fixes #1982

sulabh at soc.pidgin.im sulabh at soc.pidgin.im
Sun Jul 19 04:35:27 EDT 2009


-----------------------------------------------------------------
Revision: 63f378af2c370e793b90d83341d3b8b629691788
Ancestor: 3a57e988ed2405cd3ee0bb807bee3d0cd5a26f5d
Author: sulabh at soc.pidgin.im
Date: 2009-07-19T08:31:44
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/63f378af2c370e793b90d83341d3b8b629691788

Modified files:
        libpurple/protocols/yahoo/yahoochat.c

ChangeLog: 

Fixes #1982

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoochat.c	af4583e253b3e8d0f38938488b19210489d6c2b4
+++ libpurple/protocols/yahoo/yahoochat.c	84af22a628265613aa590f435f7500a0ea4fbda8
@@ -209,6 +209,8 @@ void yahoo_process_conference_decline(Pu
 	char *room = NULL;
 	char *who = NULL;
 	char *msg = NULL;
+	PurpleConversation *c = NULL;
+	int utf8 = 0;
 
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
@@ -225,6 +227,9 @@ void yahoo_process_conference_decline(Pu
 			g_free(msg);
 			msg = yahoo_string_decode(gc, pair->value, FALSE);
 			break;
+		case 97:
+			utf8 = strtol(pair->value, NULL, 10);
+			break;
 		}
 	}
 	if (!purple_privacy_check(purple_connection_get_account(gc), who))
@@ -236,17 +241,24 @@ void yahoo_process_conference_decline(Pu
 
 	if (who && room) {
 		/* make sure we're in the room before we process a decline message for it */
-		if(yahoo_find_conference(gc, room)) {
-			char *tmp;
+		if((c = yahoo_find_conference(gc, room))) {
+			char *tmp = NULL, *msg_tmp = NULL;
+			if(msg)
+			{
+				msg_tmp = yahoo_string_decode(gc, msg, utf8);
+				msg = yahoo_codes_to_html(msg_tmp);
+				serv_got_chat_in(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(c)), who, 0, msg, time(NULL));
+				g_free(msg_tmp);
+				g_free(msg);
+			}
 
-			tmp = g_strdup_printf(_("%s declined your conference invitation to room \"%s\" because \"%s\"."),
-							who, room, msg?msg:"");
-			purple_notify_info(gc, NULL, _("Invitation Rejected"), tmp);
+			tmp = g_strdup_printf(_("%s has declined to join."), who);
+			purple_conversation_write(c, NULL, tmp, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, time(NULL));
+			
 			g_free(tmp);
 		}
 
 		g_free(room);
-		g_free(msg);
 	}
 }
 


More information about the Commits mailing list