diff src/protocols/msn/msn.c @ 10063:4b4975b2b1d5

[gaim-migrate @ 11038] this lets you see who you have blocked and who doesn't have you on your list as emblems for msn. it looks like its extendable to the other protocols? thanks to Fernando Herrera for this. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 27 Sep 2004 02:50:48 +0000
parents 5d2a08d82e7a
children f948913f3c33
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Sun Sep 26 16:17:09 2004 +0000
+++ b/src/protocols/msn/msn.c	Mon Sep 27 02:50:48 2004 +0000
@@ -394,13 +394,30 @@
 	MsnUser *user;
 	GaimPresence *presence;
 	const char *emblems[4] = { NULL, NULL, NULL, NULL };
-	int i = 0;
+	int i = 1;
 
 	user = b->proto_data;
 	presence = gaim_buddy_get_presence(b);
 
+	if (user == NULL)
+	{
+		emblems[0] = "offline";
+	}
+	else
+	{
+		if (!(user->list_op & (1 << MSN_LIST_RL)))
+			emblems[0] = "nr";
+		if (user->list_op & (1 << MSN_LIST_BL))
+			emblems[i++] = "blocked";
+		if (user->mobile)
+			emblems[i++] = "wireless";
+	}
+
 	if (!gaim_presence_is_online(presence))
-		emblems[i++] = "offline";
+	{
+		if (emblems[0] == NULL)
+			emblems[0] = "offline";
+	}
 	else if (gaim_presence_is_status_active(presence, "busy") ||
 			 gaim_presence_is_status_active(presence, "phone"))
 		emblems[i++] = "occupied";
@@ -408,13 +425,6 @@
 			 gaim_presence_is_idle(presence))
 		emblems[i++] = "away";
 
-	if (user == NULL)
-	{
-		emblems[0] = "offline";
-	}
-	else if (user->mobile)
-		emblems[i++] = "wireless";
-
 	*se = emblems[0];
 	*sw = emblems[1];
 	*nw = emblems[2];
@@ -456,9 +466,17 @@
 							   _("Idle") : gaim_status_get_name(status));
 	}
 
-	g_string_append_printf(s, _("\n<b>%s:</b> %s"), _("Has you"),
-						   (user->list_op & (1 << MSN_LIST_RL)) ?
-						   _("Yes") : _("No"));
+	if (user)
+	{
+		g_string_append_printf(s, _("\n<b>%s:</b> %s"), _("Has you"),
+							   (user->list_op & (1 << MSN_LIST_RL)) ?
+							   _("Yes") : _("No"));
+
+		g_string_append_printf(s, _("\n<b>%s:</b> %s"), _("Blocked"),
+							   (user->list_op & (1 << MSN_LIST_BL)) ?
+							   _("Yes") : _("No"));
+	}
+
 
 	return g_string_free(s, FALSE);
 }