# HG changeset patch # User Elliott Sales de Andrade # Date 1250992696 0 # Node ID afe6ce7cc64f3c1e6938b50612b9c21bd42dfa26 # Parent ea7e54c4d7fd5d1e51859de7a8bf971265a9aa0d Send proper emoticon messages in MSN chats. Apparently, this never worked at all even though I thought it did. Fixes #10027. diff -r ea7e54c4d7fd -r afe6ce7cc64f ChangeLog --- a/ChangeLog Sun Aug 23 01:03:07 2009 +0000 +++ b/ChangeLog Sun Aug 23 01:58:16 2009 +0000 @@ -4,6 +4,7 @@ libpurple: * Fix --disable-avahi to actually disable it in configure, as opposed to just making the warning non-fatal. + * Sending custom smileys in MSN chats is now supported. XMPP: * Prompt the user before cancelling a presence subscription. diff -r ea7e54c4d7fd -r afe6ce7cc64f libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Sun Aug 23 01:03:07 2009 +0000 +++ b/libpurple/protocols/msn/msn.c Sun Aug 23 01:58:16 2009 +0000 @@ -1082,12 +1082,10 @@ strobj = msn_object_to_string(obj); if (current) - g_string_append_printf(current, "\t%s\t%s", - emoticon->smile, strobj); + g_string_append_printf(current, "\t%s\t%s", emoticon->smile, strobj); else { current = g_string_new(""); - g_string_printf(current,"%s\t%s", - emoticon->smile, strobj); + g_string_printf(current, "%s\t%s", emoticon->smile, strobj); } g_free(strobj); @@ -1718,14 +1716,19 @@ { PurpleAccount *account; MsnSession *session; + const char *username; MsnSwitchBoard *swboard; MsnMessage *msg; char *msgformat; char *msgtext; size_t msglen; + MsnEmoticon *smile; + GSList *smileys; + GString *emoticons = NULL; account = purple_connection_get_account(gc); session = gc->proto_data; + username = purple_account_get_username(account); swboard = msn_session_find_swboard_with_id(session, id); if (swboard == NULL) @@ -1749,6 +1752,20 @@ msg = msn_message_new_plain(msgtext); msn_message_set_attr(msg, "X-MMS-IM-Format", msgformat); + + smileys = msn_msg_grab_emoticons(msg->body, username); + while (smileys) { + smile = (MsnEmoticon *)smileys->data; + emoticons = msn_msg_emoticon_add(emoticons, smile); + msn_emoticon_destroy(smile); + smileys = g_slist_delete_link(smileys, smileys); + } + + if (emoticons) { + msn_send_emoticons(swboard, emoticons); + g_string_free(emoticons, TRUE); + } + msn_switchboard_send_msg(swboard, msg, FALSE); msn_message_destroy(msg);