changeset 1639:285dd96928cd

[gaim-migrate @ 1649] Dis would be a fun thing to have ;-) So I did it :) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Fri, 23 Mar 2001 21:15:52 +0000
parents f2645224b30a
children 5f3027fbce4c
files ChangeLog plugins/msn/msn.c
diffstat 2 files changed, 37 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Mar 23 18:01:53 2001 +0000
+++ b/ChangeLog	Fri Mar 23 21:15:52 2001 +0000
@@ -8,6 +8,7 @@
 	* Can use Alt to access menu, and Ctl-char for certain actions
 	  (thanks baldnik)
 	* Oscar blocking works (?)
+	* MSN can see status of other users
 
 version 0.11.0-pre7 (03/16/2001):
 	* Can build RPMs as non-root
--- a/plugins/msn/msn.c	Fri Mar 23 18:01:53 2001 +0000
+++ b/plugins/msn/msn.c	Fri Mar 23 21:15:52 2001 +0000
@@ -1074,6 +1074,41 @@
 	g_free(gc->proto_data);
 }
 
+static char *msn_get_away_text(int s)
+{
+	switch (s)
+	{
+		case MSN_BUSY :
+			return "Busy";
+		case MSN_BRB :
+			return "Be right back";
+		case MSN_AWAY :
+			return "Away from the computer";
+		case MSN_PHONE :
+			return "On the phone";
+		case MSN_LUNCH :
+			return "Out to lunch";
+		default:
+			return NULL;
+	}
+}
+			
+static void msn_buddy_menu(GtkWidget *menu, struct gaim_connection *gc, char *who)
+{
+	struct buddy *b = find_buddy(gc, who);
+	char buf[MSN_BUF_LEN];
+	GtkWidget *button;
+
+	if (!(b->uc >> 5))
+		return;
+
+	g_snprintf(buf, MSN_BUF_LEN, "Status: %s", msn_get_away_text(b->uc >> 5));
+	
+	button = gtk_menu_item_new_with_label(buf);
+	gtk_menu_append(GTK_MENU(menu), button);
+	gtk_widget_show(button);	
+}
+
 static char **msn_list_icon(int uc)
 {
 	if (uc == UC_UNAVAILABLE)
@@ -1091,7 +1126,7 @@
 	ret->protocol = PROTO_MSN;
 	ret->name = msn_name;
 	ret->list_icon = msn_list_icon;
-	ret->buddy_menu = NULL;
+	ret->buddy_menu = msn_buddy_menu;
 	ret->user_opts = NULL;
 	ret->login = msn_login;
 	ret->close = msn_close;