comparison src/protocols/msn/switchboard.c @ 6358:8ba58b296cc1

[gaim-migrate @ 6862] This should fix a problem I encountered when I realized again that Qt sucks and likes to crash when I have certain tags not closed. The format string conversion code in MSN was taken from the old MSN prpl, and that code didn't close tags. This should fix that problem. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 03 Aug 2003 02:16:15 +0000
parents 82e7eaa67406
children 42fdf16f1dad
comparison
equal deleted inserted replaced
6357:1fa4410d2e13 6358:8ba58b296cc1
291 { 291 {
292 GaimConnection *gc = servconn->session->account->gc; 292 GaimConnection *gc = servconn->session->account->gc;
293 MsnSwitchBoard *swboard = servconn->data; 293 MsnSwitchBoard *swboard = servconn->data;
294 char *body; 294 char *body;
295 const char *value; 295 const char *value;
296 char *format;
297 int flags = 0; 296 int flags = 0;
298 297
299 body = g_strdup(msn_message_get_body(msg)); 298 body = g_strdup(msn_message_get_body(msg));
300 299
301 gaim_debug(GAIM_DEBUG_INFO, "msn", "Checking User-Agent...\n"); 300 gaim_debug(GAIM_DEBUG_INFO, "msn", "Checking User-Agent...\n");
307 flags |= IM_FLAG_GAIMUSER; 306 flags |= IM_FLAG_GAIMUSER;
308 } 307 }
309 } 308 }
310 309
311 if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) { 310 if ((value = msn_message_get_attr(msg, "X-MMS-IM-Format")) != NULL) {
312 format = msn_parse_format(value); 311 char *pre_format, *post_format;
313 312
314 body = g_strdup_printf("%s%s", format, body); 313 msn_parse_format(value, &pre_format, &post_format);
314
315 body = g_strdup_printf("%s%s%s", pre_format, body, post_format);
316
317 g_free(pre_format);
318 g_free(post_format);
315 } 319 }
316 320
317 if (swboard->chat != NULL) 321 if (swboard->chat != NULL)
318 serv_got_chat_in(gc, gaim_chat_get_id(GAIM_CHAT(swboard->chat)), 322 serv_got_chat_in(gc, gaim_chat_get_id(GAIM_CHAT(swboard->chat)),
319 servconn->msg_passport, 0, body, time(NULL)); 323 servconn->msg_passport, 0, body, time(NULL));