Mercurial > pidgin.yaz
comparison libpurple/protocols/yahoo/yahoochat.c @ 27693:0501a295985e
Fixes #1982
author | Sulabh Mahajan <sulabh@soc.pidgin.im> |
---|---|
date | Sun, 19 Jul 2009 08:31:44 +0000 |
parents | d6377ec7bcd8 |
children | e1cd44c7c7af 908be3822215 |
comparison
equal
deleted
inserted
replaced
27692:93e6cf770ea8 | 27693:0501a295985e |
---|---|
207 { | 207 { |
208 GSList *l; | 208 GSList *l; |
209 char *room = NULL; | 209 char *room = NULL; |
210 char *who = NULL; | 210 char *who = NULL; |
211 char *msg = NULL; | 211 char *msg = NULL; |
212 PurpleConversation *c = NULL; | |
213 int utf8 = 0; | |
212 | 214 |
213 for (l = pkt->hash; l; l = l->next) { | 215 for (l = pkt->hash; l; l = l->next) { |
214 struct yahoo_pair *pair = l->data; | 216 struct yahoo_pair *pair = l->data; |
215 | 217 |
216 switch (pair->key) { | 218 switch (pair->key) { |
223 break; | 225 break; |
224 case 14: | 226 case 14: |
225 g_free(msg); | 227 g_free(msg); |
226 msg = yahoo_string_decode(gc, pair->value, FALSE); | 228 msg = yahoo_string_decode(gc, pair->value, FALSE); |
227 break; | 229 break; |
230 case 97: | |
231 utf8 = strtol(pair->value, NULL, 10); | |
232 break; | |
228 } | 233 } |
229 } | 234 } |
230 if (!purple_privacy_check(purple_connection_get_account(gc), who)) | 235 if (!purple_privacy_check(purple_connection_get_account(gc), who)) |
231 { | 236 { |
232 g_free(room); | 237 g_free(room); |
234 return; | 239 return; |
235 } | 240 } |
236 | 241 |
237 if (who && room) { | 242 if (who && room) { |
238 /* make sure we're in the room before we process a decline message for it */ | 243 /* make sure we're in the room before we process a decline message for it */ |
239 if(yahoo_find_conference(gc, room)) { | 244 if((c = yahoo_find_conference(gc, room))) { |
240 char *tmp; | 245 char *tmp = NULL, *msg_tmp = NULL; |
241 | 246 if(msg) |
242 tmp = g_strdup_printf(_("%s declined your conference invitation to room \"%s\" because \"%s\"."), | 247 { |
243 who, room, msg?msg:""); | 248 msg_tmp = yahoo_string_decode(gc, msg, utf8); |
244 purple_notify_info(gc, NULL, _("Invitation Rejected"), tmp); | 249 msg = yahoo_codes_to_html(msg_tmp); |
250 serv_got_chat_in(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(c)), who, 0, msg, time(NULL)); | |
251 g_free(msg_tmp); | |
252 g_free(msg); | |
253 } | |
254 | |
255 tmp = g_strdup_printf(_("%s has declined to join."), who); | |
256 purple_conversation_write(c, NULL, tmp, PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, time(NULL)); | |
257 | |
245 g_free(tmp); | 258 g_free(tmp); |
246 } | 259 } |
247 | 260 |
248 g_free(room); | 261 g_free(room); |
249 g_free(msg); | |
250 } | 262 } |
251 } | 263 } |
252 | 264 |
253 void yahoo_process_conference_logon(PurpleConnection *gc, struct yahoo_packet *pkt) | 265 void yahoo_process_conference_logon(PurpleConnection *gc, struct yahoo_packet *pkt) |
254 { | 266 { |