# HG changeset patch # User Ma Yuan # Date 1156674857 0 # Node ID 3b971c87279d93b2edf4ee563341198f0b316fc6 # Parent c590e780b3a0f177bbf545e682019169e306932a [gaim-migrate @ 17056] fix the bug to send Yahoo User offline Message committed by MaYuan committer: Ethan Blanton diff -r c590e780b3a0 -r 3b971c87279d src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Sun Aug 27 08:03:32 2006 +0000 +++ b/src/protocols/msn/msn.c Sun Aug 27 10:34:17 2006 +0000 @@ -824,7 +824,8 @@ account = gaim_connection_get_account(gc); msn_import_html(message, &msgformat, &msgtext); - if(msn_user_is_online(account, who)){ + if(msn_user_is_online(account, who)|| + msn_user_is_yahoo(account, who)){ /*User online,then send Online Instant Message*/ if (strlen(msgtext) + strlen(msgformat) + strlen(VERSION) > 1564) @@ -849,8 +850,9 @@ MsnSwitchBoard *swboard; session = gc->proto_data; - if(strstr(who,"yahoo") != NULL){ - gaim_debug_info("MaYuan","send to Yahoo!\n"); + if(msn_user_is_yahoo(account,who)){ + /*we send the online and offline Message to Yahoo User via UBM*/ + gaim_debug_info("MaYuan","send to Yahoo User\n"); uum_send_msg(session,msg); }else{ gaim_debug_info("MaYuan","send via switchboard\n"); @@ -885,7 +887,7 @@ msn_message_destroy(msg); }else { - /*send Offline Instant Message*/ + /*send Offline Instant Message,only to MSN Passport User*/ MsnSession *session; MsnOim *oim; char *friendname; diff -r c590e780b3a0 -r 3b971c87279d src/protocols/msn/user.c --- a/src/protocols/msn/user.c Sun Aug 27 08:03:32 2006 +0000 +++ b/src/protocols/msn/user.c Sun Aug 27 10:34:17 2006 +0000 @@ -315,6 +315,15 @@ return GAIM_BUDDY_IS_ONLINE(buddy); } +/*check to see if user is yahoo user? + * TODO: we need to identify it via contact parse + */ +gboolean +msn_user_is_yahoo(GaimAccount *account ,const char *name) +{ + return (strstr(name,"yahoo") != NULL); +} + void msn_user_remove_group_id(MsnUser *user, const char * id) { diff -r c590e780b3a0 -r 3b971c87279d src/protocols/msn/user.h --- a/src/protocols/msn/user.h Sun Aug 27 08:03:32 2006 +0000 +++ b/src/protocols/msn/user.h Sun Aug 27 10:34:17 2006 +0000 @@ -301,6 +301,11 @@ gboolean msn_user_is_online(GaimAccount *account, const char *name); +/** + * check to see if user is Yahoo User + */ +gboolean +msn_user_is_yahoo(GaimAccount *account ,const char *name); /*@}*/ #endif /* _MSN_USER_H_ */