comparison src/protocols/msn/msn.c @ 8518:833dd756dcc3

[gaim-migrate @ 9257] Patch by David Vermeille to add outgoing formatting support for MSN. I'd like to thank him, as a number of people have attempted this patch and ended up discouraged when told it would break core/UI split. David went ahead and stuck through it, and we now have some decent support. I also realized during this that we weren't processing certain incoming colors correctly, so that's taken care of now. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 28 Mar 2004 21:38:22 +0000
parents 711927294475
children 45e8c6cbd4a5
comparison
equal deleted inserted replaced
8517:5cb93726e4d5 8518:833dd756dcc3
485 485
486 if (session->http_method) 486 if (session->http_method)
487 msn_http_session_init(session); 487 msn_http_session_init(session);
488 488
489 gc->proto_data = session; 489 gc->proto_data = session;
490 gc->flags |= GAIM_CONNECTION_HTML;
490 491
491 gaim_connection_update_progress(gc, _("Connecting"), 0, MSN_CONNECT_STEPS); 492 gaim_connection_update_progress(gc, _("Connecting"), 0, MSN_CONNECT_STEPS);
492 493
493 /* Hmm, I don't like this. */ 494 /* Hmm, I don't like this. */
494 username = msn_normalize(account, gaim_account_get_username(account)); 495 username = msn_normalize(account, gaim_account_get_username(account));
530 swboard = msn_session_find_switch_with_passport(session, who); 531 swboard = msn_session_find_switch_with_passport(session, who);
531 532
532 if (g_ascii_strcasecmp(who, gaim_account_get_username(account))) { 533 if (g_ascii_strcasecmp(who, gaim_account_get_username(account))) {
533 MsnMessage *msg; 534 MsnMessage *msg;
534 MsnUser *user; 535 MsnUser *user;
536 char *msgformat;
537 char *msgtext;
535 538
536 user = msn_user_new(session, who, NULL); 539 user = msn_user_new(session, who, NULL);
540
541 msn_import_html(message, &msgformat, &msgtext);
537 542
538 msg = msn_message_new(); 543 msg = msn_message_new();
539 msn_message_set_receiver(msg, user); 544 msn_message_set_receiver(msg, user);
540 msn_message_set_attr(msg, "X-MMS-IM-Format", 545 msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat);
541 "FN=MS%20Sans%20Serif; EF=; CO=0; PF=0"); 546 msn_message_set_body(msg, msgtext);
542 msn_message_set_body(msg, message); 547
548 g_free(msgformat);
549 g_free(msgtext);
543 550
544 if (swboard != NULL) { 551 if (swboard != NULL) {
545 if (!msn_switchboard_send_msg(swboard, msg)) 552 if (!msn_switchboard_send_msg(swboard, msg))
546 msn_switchboard_destroy(swboard); 553 msn_switchboard_destroy(swboard);
547 } 554 }