Mercurial > pidgin
comparison src/protocols/oscar/oscar.c @ 11248:a2eababc78a8
[gaim-migrate @ 13417]
patch #1243645, from Sadrul Habib Chowdhury
Fix oscar, offline buddies shown as Away
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 13 Aug 2005 03:55:07 +0000 |
parents | 04fd99debeb9 |
children | ad9a61894d9b |
comparison
equal
deleted
inserted
replaced
11247:e5aa4398003e | 11248:a2eababc78a8 |
---|---|
6883 | 6883 |
6884 static char *oscar_status_text(GaimBuddy *b) | 6884 static char *oscar_status_text(GaimBuddy *b) |
6885 { | 6885 { |
6886 GaimConnection *gc; | 6886 GaimConnection *gc; |
6887 OscarData *od; | 6887 OscarData *od; |
6888 GaimStatus *status; | 6888 GaimPresence *presence; |
6889 gchar *ret = NULL; | 6889 gchar *ret = NULL; |
6890 | 6890 |
6891 gc = gaim_account_get_connection(gaim_buddy_get_account(b)); | 6891 gc = gaim_account_get_connection(gaim_buddy_get_account(b)); |
6892 od = gc->proto_data; | 6892 od = gc->proto_data; |
6893 status = gaim_presence_get_active_status(gaim_buddy_get_presence(b)); | 6893 presence = gaim_buddy_get_presence(b); |
6894 | 6894 |
6895 if (gaim_status_is_available(status) == FALSE || (((b->uc & 0xffff0000) >> 16) & AIM_ICQ_STATE_CHAT)) { | 6895 if (!gaim_presence_is_online(presence)) |
6896 if (aim_sn_is_icq(b->name)) | 6896 { |
6897 ret = oscar_icqstatus((b->uc & 0xffff0000) >> 16); | |
6898 else | |
6899 ret = g_strdup(_("Away")); | |
6900 } else if (GAIM_BUDDY_IS_ONLINE(b)) { | |
6901 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(b->account, b->name)); | |
6902 if ((bi != NULL) && (bi->availmsg != NULL)) | |
6903 ret = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg)); | |
6904 } else { | |
6905 char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, b->name); | 6897 char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, b->name); |
6906 if (aim_ssi_waitingforauth(od->sess->ssi.local, gname, b->name)) | 6898 if (aim_ssi_waitingforauth(od->sess->ssi.local, gname, b->name)) |
6907 ret = g_strdup(_("Not Authorized")); | 6899 ret = g_strdup(_("Not Authorized")); |
6908 else | 6900 else |
6909 ret = g_strdup(_("Offline")); | 6901 ret = g_strdup(_("Offline")); |
6902 } | |
6903 else if (gaim_presence_is_available(presence)) | |
6904 { | |
6905 struct buddyinfo *bi; | |
6906 bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(b->account, b->name)); | |
6907 if ((bi != NULL) && (bi->availmsg != NULL)) | |
6908 ret = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg)); | |
6909 } | |
6910 else | |
6911 { | |
6912 if (aim_sn_is_icq(b->name)) | |
6913 ret = oscar_icqstatus((b->uc & 0xffff0000) >> 16); | |
6914 else | |
6915 ret = g_strdup(_("Away")); | |
6910 } | 6916 } |
6911 | 6917 |
6912 return ret; | 6918 return ret; |
6913 } | 6919 } |
6914 | 6920 |