[gaim-migrate @ 1579]

Wed, 14 Mar 2001 06:47:46 +0000

author
Rob Flynn <gaim@robflynn.com>
date
Wed, 14 Mar 2001 06:47:46 +0000
changeset 1569
844e5cee381b
parent 1568
d7d491511e8c
child 1570
de731694417b

[gaim-migrate @ 1579]
Plugin tells you when people are online.

plugins/msn/msn.c file | annotate | diff | comparison | revisions
--- a/plugins/msn/msn.c	Wed Mar 14 06:31:01 2001 +0000
+++ b/plugins/msn/msn.c	Wed Mar 14 06:47:46 2001 +0000
@@ -132,8 +132,44 @@
 
 	printf("MSN ==> %s\n", buf);
 
-	/* Check to see what was just sent back to us.  We should be seeing a VER tag. */
-	if (!strncmp("LST ", buf, 4))
+	if (!strncmp("NLN ", buf, 4) || !strncmp("ILN ", buf, 4))
+	{
+		int status;
+		int query;
+		char **res;
+
+		res = g_strsplit(buf, " ", 0);
+
+		if (!strcmp(res[0], "NLN"))
+			query = 1;
+		else
+			query = 2;
+
+		if (!strcasecmp(res[query], "NLN"))
+			status = UC_NORMAL;
+		else if (!strcasecmp(res[query], "BSY"))
+			status = UC_NORMAL | (MSN_BUSY << 5);
+		else if (!strcasecmp(res[query], "IDL"))
+			status = UC_NORMAL | (MSN_IDLE << 5);
+		else if (!strcasecmp(res[query], "BRB"))
+			status = UC_NORMAL | (MSN_BRB << 5);
+		else if (!strcasecmp(res[query], "AWY"))
+			status = UC_UNAVAILABLE;
+		else if (!strcasecmp(res[query], "PHN"))
+			status = UC_NORMAL | (MSN_PHONE << 5);
+		else if (!strcasecmp(res[query], "LUN"))
+			status = UC_NORMAL | (MSN_LUNCH << 5);
+		else
+			status = UC_NORMAL;
+
+		serv_got_update(gc, res[query+1], 1, 0, 0, 0, status, 0);
+
+		g_strfreev(res);
+
+		return;
+
+	}
+	else if (!strncmp("LST ", buf, 4))
 	{
 		char **res;
 

mercurial