libpurple/protocols/gg/message-prpl.c

changeset 40541
9ceb8d25d4d9
parent 40538
222423055d93
child 40885
87f6241da196
equal deleted inserted replaced
40540:168407b6f9fd 40541:9ceb8d25d4d9
233 PURPLE_MESSAGE_RECV, msg->time); 233 PURPLE_MESSAGE_RECV, msg->time);
234 } else if (msg->type == GGP_MESSAGE_GOT_TYPE_CHAT) { 234 } else if (msg->type == GGP_MESSAGE_GOT_TYPE_CHAT) {
235 ggp_chat_got_message(gc, msg->chat_id, msg->text, msg->time, 235 ggp_chat_got_message(gc, msg->chat_id, msg->text, msg->time,
236 msg->user); 236 msg->user);
237 } else if (msg->type == GGP_MESSAGE_GOT_TYPE_MULTILOGON) { 237 } else if (msg->type == GGP_MESSAGE_GOT_TYPE_MULTILOGON) {
238 GDateTime *dt = NULL;
239 PurpleAccount *account = NULL;
238 PurpleIMConversation *im = ggp_message_get_conv(gc, msg->user); 240 PurpleIMConversation *im = ggp_message_get_conv(gc, msg->user);
239 PurpleMessage *pmsg; 241 PurpleMessage *pmsg;
240 242 const gchar *me = NULL;
241 pmsg = purple_message_new_outgoing(NULL, msg->text, 0); 243
242 purple_message_set_time(pmsg, msg->time); 244 account = purple_connection_get_account(gc);
245 me = purple_account_get_name_for_display(account);
246
247 pmsg = purple_message_new_outgoing(me, NULL, msg->text, 0);
248
249 dt = g_date_time_new_from_unix_local((gint64)msg->time);
250 purple_message_set_timestamp(pmsg, dt);
251 g_date_time_unref(dt);
243 252
244 purple_conversation_write_message(PURPLE_CONVERSATION(im), pmsg); 253 purple_conversation_write_message(PURPLE_CONVERSATION(im), pmsg);
245 } else 254
255 g_object_unref(G_OBJECT(pmsg));
256 } else {
246 purple_debug_error("gg", "ggp_message_got_display: " 257 purple_debug_error("gg", "ggp_message_got_display: "
247 "unexpected message type: %d\n", msg->type); 258 "unexpected message type: %d\n", msg->type);
259 }
248 } 260 }
249 261
250 static gboolean ggp_message_format_from_gg_found_img(const GMatchInfo *info, 262 static gboolean ggp_message_format_from_gg_found_img(const GMatchInfo *info,
251 GString *res, gpointer data) 263 GString *res, gpointer data)
252 { 264 {

mercurial