changeset 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 e5aa4398003e
children b4b1be482b4e
files src/protocols/oscar/oscar.c
diffstat 1 files changed, 19 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Sat Aug 13 02:26:57 2005 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Aug 13 03:55:07 2005 +0000
@@ -6885,29 +6885,35 @@
 {
 	GaimConnection *gc;
 	OscarData *od;
-	GaimStatus *status;
+	GaimPresence *presence;
 	gchar *ret = NULL;
 
 	gc = gaim_account_get_connection(gaim_buddy_get_account(b));
 	od = gc->proto_data;
-	status = gaim_presence_get_active_status(gaim_buddy_get_presence(b));
-
-	if (gaim_status_is_available(status) == FALSE || (((b->uc & 0xffff0000) >> 16) & AIM_ICQ_STATE_CHAT)) {
-		if (aim_sn_is_icq(b->name))
-			ret = oscar_icqstatus((b->uc & 0xffff0000) >> 16);
-		else
-			ret = g_strdup(_("Away"));
-	} else if (GAIM_BUDDY_IS_ONLINE(b)) {
-		struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(b->account, b->name));
-		if ((bi != NULL) && (bi->availmsg != NULL))
-			ret = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg));
-	} else {
+	presence = gaim_buddy_get_presence(b);
+
+	if (!gaim_presence_is_online(presence))
+	{
 		char *gname = aim_ssi_itemlist_findparentname(od->sess->ssi.local, b->name);
 		if (aim_ssi_waitingforauth(od->sess->ssi.local, gname, b->name))
 			ret = g_strdup(_("Not Authorized"));
 		else
 			ret = g_strdup(_("Offline"));
 	}
+	else if (gaim_presence_is_available(presence))
+	{
+		struct buddyinfo *bi;
+		bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(b->account, b->name));
+		if ((bi != NULL) && (bi->availmsg != NULL))
+			ret = g_markup_escape_text(bi->availmsg, strlen(bi->availmsg));
+	}
+	else
+	{
+		if (aim_sn_is_icq(b->name))
+			ret = oscar_icqstatus((b->uc & 0xffff0000) >> 16);
+		else
+			ret = g_strdup(_("Away"));
+	}
 
 	return ret;
 }