--- a/libpurple/conversation.c Thu Jun 12 21:33:01 2014 +0200
+++ b/libpurple/conversation.c Thu Jun 12 21:39:38 2014 +0200
@@ -672,8 +672,14 @@
- if (ops && ops->write_conv)
- ops->write_conv(conv, pmsg);
+ if (PURPLE_IS_CHAT_CONVERSATION(conv) && ops->write_chat) + ops->write_chat(PURPLE_CHAT_CONVERSATION(conv), pmsg); + else if (PURPLE_IS_IM_CONVERSATION(conv) && ops->write_im) + ops->write_im(PURPLE_IM_CONVERSATION(conv), pmsg); + else if (ops->write_conv) + ops->write_conv(conv, pmsg); add_message_to_history(conv,
(purple_message_get_flags(pmsg) & PURPLE_MESSAGE_SEND) ? purple_message_get_recipient(pmsg) : purple_message_get_author(pmsg),
--- a/libpurple/conversationtypes.c Thu Jun 12 21:33:01 2014 +0200
+++ b/libpurple/conversationtypes.c Thu Jun 12 21:39:38 2014 +0200
@@ -355,24 +355,18 @@
im_conversation_write_message(PurpleConversation *conv, PurpleMessage *msg)
- PurpleConversationUiOps *ops;
PurpleIMConversation *im = PURPLE_IM_CONVERSATION(conv);
g_return_if_fail(im != NULL);
g_return_if_fail(msg != NULL);
- ops = purple_conversation_get_ui_ops(conv);
is_recv = (purple_message_get_flags(msg) & PURPLE_MESSAGE_RECV);
purple_im_conversation_set_typing_state(im, PURPLE_IM_NOT_TYPING);
- /* Pass this on to either the ops structure or the default write func. */
- if (ops != NULL && ops->write_im != NULL)
- ops->write_im(im, msg);
- _purple_conversation_write_common(conv, msg);
+ _purple_conversation_write_common(conv, msg); /**************************************************************************
@@ -800,7 +794,6 @@
chat_conversation_write_message(PurpleConversation *conv, PurpleMessage *msg)
- PurpleConversationUiOps *ops;
PurpleChatConversationPrivate *priv = PURPLE_CHAT_CONVERSATION_GET_PRIVATE(conv);
PurpleMessageFlags flags;
@@ -830,13 +823,7 @@
- ops = purple_conversation_get_ui_ops(conv);
- /* Pass this on to either the ops structure or the default write func. */
- if (ops != NULL && ops->write_chat != NULL)
- ops->write_chat(PURPLE_CHAT_CONVERSATION(conv), msg);
- _purple_conversation_write_common(conv, msg);
+ _purple_conversation_write_common(conv, msg);