summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Sales de Andrade <qulogic@pidgin.im>2010-05-11 04:53:03 +0000
committerElliott Sales de Andrade <qulogic@pidgin.im>2010-05-11 04:53:03 +0000
commit9a82879e7b573b6ec091aa9dea28ecb4f2a033c9 (patch)
treefcfd64d3b41d2cda6eedd4db7e42b6102d81a45b
parentc93a84386dedd6d037ea9faabd438cd83a18b643 (diff)
parentda737841ebeae6381e79e883cb1f988bb29ed51d (diff)
downloadpidgin-9a82879e7b573b6ec091aa9dea28ecb4f2a033c9.tar.gz
merge of 'fcc1b2569e6bb321d56d01d5f5be458cbffb6180'
and '50c2380f3607863a286545b573457ad36f80d903'
-rw-r--r--libpurple/protocols/msn/msg.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/libpurple/protocols/msn/msg.c b/libpurple/protocols/msn/msg.c
index 40830939a4..86b3eb22e6 100644
--- a/libpurple/protocols/msn/msg.c
+++ b/libpurple/protocols/msn/msg.c
@@ -939,8 +939,11 @@ datacast_inform_user(MsnSwitchBoard *swboard, const char *who,
char *username, *str;
PurpleAccount *account;
PurpleBuddy *b;
+ PurpleConnection *pc;
+ gboolean chat;
account = swboard->session->account;
+ pc = purple_account_get_connection(account);
if ((b = purple_find_buddy(account, who)) != NULL)
username = g_markup_escape_text(purple_buddy_get_alias(b), -1);
@@ -949,8 +952,14 @@ datacast_inform_user(MsnSwitchBoard *swboard, const char *who,
str = g_strdup_printf(msg, username, filename);
g_free(username);
+ swboard->flag |= MSN_SB_FLAG_IM;
+ if (swboard->current_users > 1)
+ chat = TRUE;
+ else
+ chat = FALSE;
+
if (swboard->conv == NULL) {
- if (swboard->current_users > 1)
+ if (chat)
swboard->conv = purple_find_chat(account->gc, swboard->chat_id);
else {
swboard->conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM,
@@ -959,9 +968,15 @@ datacast_inform_user(MsnSwitchBoard *swboard, const char *who,
swboard->conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, who);
}
}
- swboard->flag |= MSN_SB_FLAG_IM;
- purple_conversation_write(swboard->conv, NULL, str, PURPLE_MESSAGE_SYSTEM, time(NULL));
+ if (chat)
+ serv_got_chat_in(pc,
+ purple_conv_chat_get_id(PURPLE_CONV_CHAT(swboard->conv)),
+ who, PURPLE_MESSAGE_RECV|PURPLE_MESSAGE_SYSTEM, str,
+ time(NULL));
+ else
+ serv_got_im(pc, who, str, PURPLE_MESSAGE_RECV|PURPLE_MESSAGE_SYSTEM,
+ time(NULL));
g_free(str);
}