# HG changeset patch # User Sadrul Habib Chowdhury # Date 1188043600 0 # Node ID c17e41049b61338f3c7e371de371dfeedc3f27f9 # Parent dc4e8460622f76527f30e035bb8614c980bed038 Do not duplicate the same message in the history, and store the correct information when sending a message. diff -r dc4e8460622f -r c17e41049b61 libpurple/conversation.c --- a/libpurple/conversation.c Sat Aug 25 11:36:02 2007 +0000 +++ b/libpurple/conversation.c Sat Aug 25 12:06:40 2007 +0000 @@ -211,6 +211,15 @@ { GList *list; PurpleConvMessage *msg; + + if (flags & PURPLE_MESSAGE_SEND) { + const char *me = NULL; + if (conv->account->gc) + me = conv->account->gc->display_name; + if (!me) + me = conv->account->username; + who = me; + } msg = g_new0(PurpleConvMessage, 1); PURPLE_DBUS_REGISTER_POINTER(msg, PurpleConvMessage); @@ -1145,10 +1154,9 @@ c = purple_conv_im_get_conversation(im); /* Pass this on to either the ops structure or the default write func. */ - if (c->ui_ops != NULL && c->ui_ops->write_im != NULL) { + if (c->ui_ops != NULL && c->ui_ops->write_im != NULL) c->ui_ops->write_im(c, who, message, flags, mtime); - add_message_to_history(c, who, message, flags, mtime); - } else + else purple_conversation_write(c, who, message, flags, mtime); } @@ -1472,10 +1480,9 @@ } /* Pass this on to either the ops structure or the default write func. */ - if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL) { + if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL) conv->ui_ops->write_chat(conv, who, message, flags, mtime); - add_message_to_history(conv, who, message, flags, mtime); - } else + else purple_conversation_write(conv, who, message, flags, mtime); }