diff src/protocols/msn/notification.c @ 5361:953aa05279f4

[gaim-migrate @ 5737] Merged the state code and away code into state.[ch]. You can now see what users are using MSN Mobile. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 13 May 2003 02:51:13 +0000
parents 91db34a45cbe
children ebebc833cf77
line wrap: on
line diff
--- a/src/protocols/msn/notification.c	Mon May 12 15:10:47 2003 +0000
+++ b/src/protocols/msn/notification.c	Tue May 13 02:51:13 2003 +0000
@@ -21,7 +21,7 @@
  */
 #include "msn.h"
 #include "notification.h"
-#include "away.h"
+#include "state.h"
 #include "error.h"
 #include "utils.h"
 
@@ -428,6 +428,34 @@
 }
 
 static gboolean
+__bpr_cmd(MsnServConn *servconn, const char *command, const char **params,
+		  size_t param_count)
+{
+	struct gaim_connection *gc = servconn->session->account->gc;
+	struct buddy *b;
+	const char *passport, *type, *value;
+	int status = 0;
+
+	passport = params[1];
+	type     = params[2];
+	value    = params[3];
+
+	if (!strcmp(type, "MOB")) {
+		if (value != NULL && !strcmp(value, "Y")) {
+			gaim_debug(GAIM_DEBUG_MISC, "msn",
+					   "%s has a pager\n", passport);
+			if ((b = gaim_find_buddy(gc->account, passport)) != NULL) {
+				status = b->uc | (1 << 5);
+
+				serv_got_update(gc, (char *)passport, 1, 0, 0, 0, status);
+			}
+		}
+	}
+
+	return TRUE;
+}
+
+static gboolean
 __fln_cmd(MsnServConn *servconn, const char *command, const char **params,
 		  size_t param_count)
 {
@@ -445,6 +473,7 @@
 	struct gaim_connection *gc = servconn->session->account->gc;
 	int status = 0;
 	const char *state, *passport, *friend;
+	struct buddy *b;
 
 	state    = params[1];
 	passport = params[2];
@@ -452,6 +481,9 @@
 
 	serv_got_alias(gc, (char *)passport, (char *)friend);
 
+	if ((b = gaim_find_buddy(gc->account, passport)) != NULL)
+		status |= ((((b->uc) >> 1) & 0xF0) << 1);
+
 	if (!g_ascii_strcasecmp(state, "BSY"))
 		status |= UC_UNAVAILABLE | (MSN_BUSY << 1);
 	else if (!g_ascii_strcasecmp(state, "IDL"))
@@ -1197,7 +1229,7 @@
 		msn_servconn_register_command(notification, "ADD",       __add_cmd);
 		msn_servconn_register_command(notification, "ADG",       __adg_cmd);
 		msn_servconn_register_command(notification, "BLP",       __blp_cmd);
-		msn_servconn_register_command(notification, "BPR",       __blank_cmd);
+		msn_servconn_register_command(notification, "BPR",       __bpr_cmd);
 		msn_servconn_register_command(notification, "CHG",       __blank_cmd);
 		msn_servconn_register_command(notification, "CHL",       __chl_cmd);
 		msn_servconn_register_command(notification, "FLN",       __fln_cmd);