diff options
Diffstat (limited to 'libpurple/protocols/msn/msn.c')
-rw-r--r-- | libpurple/protocols/msn/msn.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/libpurple/protocols/msn/msn.c b/libpurple/protocols/msn/msn.c index 9fba5b236e..defbcd40a1 100644 --- a/libpurple/protocols/msn/msn.c +++ b/libpurple/protocols/msn/msn.c @@ -27,6 +27,7 @@ #include "msn.h" #include "accountopt.h" +#include "contact.h" #include "msg.h" #include "page.h" #include "pluginpref.h" @@ -949,7 +950,10 @@ msn_send_im(PurpleConnection *gc, const char *who, const char *message, } msn_import_html(message, &msgformat, &msgtext); - if(msn_user_is_online(account, who)|| + /* this is incorrect, we should try to initiate a connection to the + buddy first, and only falls back if that fails. Otherwise we can + only send offline message to invisible buddies */ + if (msn_user_is_online(account, who)|| msn_user_is_yahoo(account, who)){ /*User online,then send Online Instant Message*/ @@ -1016,7 +1020,7 @@ msn_send_im(PurpleConnection *gc, const char *who, const char *message, } msn_message_destroy(msg); - }else { + } else { /*send Offline Instant Message,only to MSN Passport User*/ MsnSession *session; char *friendname; @@ -1027,8 +1031,11 @@ msn_send_im(PurpleConnection *gc, const char *who, const char *message, friendname = msn_encode_mime(account->username); msn_oim_prep_send_msg_info(session->oim, purple_account_get_username(account), - friendname, who, message); + friendname, who, msgtext); msn_oim_send_msg(session->oim); + + g_free(msgformat); + g_free(msgtext); g_free(friendname); } @@ -1240,10 +1247,10 @@ msn_add_permit(PurpleConnection *gc, const char *who) msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL); /* delete contact from Block list and add it to Allow in the callback */ - msn_del_contact_from_list(session->contact, NULL, who, MSN_LIST_BL); + msn_del_contact_from_list(session, NULL, who, MSN_LIST_BL); } else { /* just add the contact to Allow list */ - msn_add_contact_to_list(session->contact, NULL, who, MSN_LIST_AL); + msn_add_contact_to_list(session, NULL, who, MSN_LIST_AL); } @@ -1268,10 +1275,10 @@ msn_add_deny(PurpleConnection *gc, const char *who) msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL); /* delete contact from Allow list and add it to Block in the callback */ - msn_del_contact_from_list(session->contact, NULL, who, MSN_LIST_AL); + msn_del_contact_from_list(session, NULL, who, MSN_LIST_AL); } else { /* just add the contact to Block list */ - msn_add_contact_to_list(session->contact, NULL, who, MSN_LIST_BL); + msn_add_contact_to_list(session, NULL, who, MSN_LIST_BL); } msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL); @@ -1294,7 +1301,7 @@ msn_rem_permit(PurpleConnection *gc, const char *who) msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_AL); - msn_del_contact_from_list(session->contact, NULL, who, MSN_LIST_AL); + msn_del_contact_from_list(session, NULL, who, MSN_LIST_AL); if (user != NULL && user->list_op & MSN_LIST_RL_OP) msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_BL); @@ -1317,7 +1324,7 @@ msn_rem_deny(PurpleConnection *gc, const char *who) msn_userlist_rem_buddy_from_list(userlist, who, MSN_LIST_BL); - msn_del_contact_from_list(session->contact, NULL, who, MSN_LIST_BL); + msn_del_contact_from_list(session, NULL, who, MSN_LIST_BL); if (user != NULL && user->list_op & MSN_LIST_RL_OP) msn_userlist_add_buddy_to_list(userlist, who, MSN_LIST_AL); |