changeset 22570:1168dc635ac1

some other mobile stuff that Maiku fixed, fixes #2359
author Ka-Hing Cheung <khc@hxbc.us>
date Fri, 28 Mar 2008 07:58:20 +0000
parents 207f51e16b50
children 8041c74e36d7
files libpurple/protocols/msn/notification.c libpurple/protocols/msn/user.c
diffstat 2 files changed, 22 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/notification.c	Thu Mar 27 06:32:31 2008 +0000
+++ b/libpurple/protocols/msn/notification.c	Fri Mar 28 07:58:20 2008 +0000
@@ -1039,6 +1039,7 @@
 	PurpleConnection *gc;
 	MsnUser *user;
 	MsnObject *msnobj;
+	unsigned long clientid;
 	int wlmclient;
 	const char *state, *passport, *friendly;
 
@@ -1064,6 +1065,9 @@
 		msn_user_set_object(user, msnobj);
 	}
 
+	clientid = strtoul(cmd->params[5], NULL, 10);
+	user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE) || (user->phone.mobile && user->phone.mobile[0] == '+');
+
 	msn_user_set_state(user, state);
 	msn_user_update(user);
 }
@@ -1179,7 +1183,7 @@
 	}
 
 	clientid = strtoul(cmd->params[4], NULL, 10);
-	user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE);
+	user->mobile = (clientid & MSN_CLIENT_CAP_MSNMOBILE) || (user->phone.mobile && user->phone.mobile[0] == '+');
 
 	msn_user_set_state(user, state);
 	msn_user_update(user);
--- a/libpurple/protocols/msn/user.c	Thu Mar 27 06:32:31 2008 +0000
+++ b/libpurple/protocols/msn/user.c	Fri Mar 28 07:58:20 2008 +0000
@@ -97,8 +97,22 @@
 
 	if (user->status != NULL) {
 		gboolean offline = (strcmp(user->status, "offline") == 0);
-		purple_prpl_got_user_status(account, user->passport, user->status,
-				"message", user->statusline, NULL);
+
+		if (!offline) {
+			purple_prpl_got_user_status(account, user->passport, user->status,
+					"message", user->statusline, NULL);
+		} else {
+			if (user->mobile) {
+				purple_prpl_got_user_status(account, user->passport, "mobile", NULL);
+				purple_prpl_got_user_status(account, user->passport, "available", NULL);
+			} else {
+				purple_prpl_got_user_status(account, user->passport, user->status, NULL);
+			}
+		}
+
+		if (!offline || !user->mobile) {
+			purple_prpl_got_user_status_deactive(account, user->passport, "mobile");
+		}
 
 		if (!offline && user->media.title) {
 			purple_prpl_got_user_status(account, user->passport, "tune",
@@ -108,13 +122,7 @@
 					NULL);
 		} else {
 			purple_prpl_got_user_status_deactive(account, user->passport, "tune");
-		}
-
-		if (!offline && user->mobile) {
-			purple_prpl_got_user_status(account, user->passport, "mobile", NULL);
-		} else {
-			purple_prpl_got_user_status_deactive(account, user->passport, "mobile");
-		}
+		}			
 	}
 
 	if (user->idle)