pidgin: 8694cdf8: some other mobile stuff that Maiku fixed...

khc at pidgin.im khc at pidgin.im
Fri Mar 28 04:00:49 EDT 2008


-----------------------------------------------------------------
Revision: 8694cdf8884d0e71329ba9e829123eb4e3fc5fa7
Ancestor: bebaa6838815195a5c97614f4aaf7e0f13ef2da7
Author: khc at pidgin.im
Date: 2008-03-28T07:58:20
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8694cdf8884d0e71329ba9e829123eb4e3fc5fa7

Modified files:
        libpurple/protocols/msn/notification.c
        libpurple/protocols/msn/user.c

ChangeLog: 

some other mobile stuff that Maiku fixed, fixes #2359

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	64fd0c99502de78f5dcf67ade272a372af3520bd
+++ libpurple/protocols/msn/notification.c	fd21b93550aba8a1df08fab46314ece42fac476d
@@ -1039,6 +1039,7 @@ iln_cmd(MsnCmdProc *cmdproc, MsnCommand 
 	PurpleConnection *gc;
 	MsnUser *user;
 	MsnObject *msnobj;
+	unsigned long clientid;
 	int wlmclient;
 	const char *state, *passport, *friendly;
 
@@ -1064,6 +1065,9 @@ iln_cmd(MsnCmdProc *cmdproc, MsnCommand 
 		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 @@ nln_cmd(MsnCmdProc *cmdproc, MsnCommand 
 	}
 
 	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);
============================================================
--- libpurple/protocols/msn/user.c	28a85a6f38c3751df16f82bbc0f95d139aa3af38
+++ libpurple/protocols/msn/user.c	2272f47081b8555bba395a68ced9ca999b98ecbf
@@ -97,9 +97,23 @@ msn_user_update(MsnUser *user)
 
 	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",
 					PURPLE_TUNE_ARTIST, user->media.artist,
@@ -108,13 +122,7 @@ msn_user_update(MsnUser *user)
 					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)


More information about the Commits mailing list