pidgin: 5e9671c6: Mobile status are created as independant...

sadrul at pidgin.im sadrul at pidgin.im
Sat Jun 21 03:05:44 EDT 2008


-----------------------------------------------------------------
Revision: 5e9671c654b021e77695d4a863fb55e27a831901
Ancestor: 777e7e6c4fb02c0b0f0dc557554cfc83b92544ae
Author: sadrul at pidgin.im
Date: 2008-06-21T06:56:35
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5e9671c654b021e77695d4a863fb55e27a831901

Modified files:
        libpurple/server.c

ChangeLog: 

Mobile status are created as independant statuses, which cannot be the
'primary active status' (which is always an exclusive status) of a
presence. So we need to use purple_presence_is_status_primitive_active to
check if the mobile status is active or not. This should fix the bug
where auto-replies are sent to mobile users.

-------------- next part --------------
============================================================
--- libpurple/server.c	4f4199dafec797aa9d083d7af2263f9fed6bed65
+++ libpurple/server.c	73a18b2e00e11235eb9484d5bd5a9c33c1dcb248
@@ -727,6 +727,7 @@ void serv_got_im(PurpleConnection *gc, c
 		PurpleStatusPrimitive primitive;
 		const gchar *auto_reply_pref;
 		const char *away_msg = NULL;
+		gboolean mobile = FALSE;
 
 		auto_reply_pref = purple_prefs_get_string("/purple/away/auto_reply");
 
@@ -734,9 +735,10 @@ void serv_got_im(PurpleConnection *gc, c
 		status = purple_presence_get_active_status(presence);
 		status_type = purple_status_get_type(status);
 		primitive = purple_status_type_get_primitive(status_type);
+		mobile = purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_MOBILE);
 		if ((primitive == PURPLE_STATUS_AVAILABLE) ||
 			(primitive == PURPLE_STATUS_INVISIBLE) ||
-			(primitive == PURPLE_STATUS_MOBILE) ||
+			mobile ||
 		    !strcmp(auto_reply_pref, "never") ||
 		    (!purple_presence_is_idle(presence) && !strcmp(auto_reply_pref, "awayidle")))
 		{


More information about the Commits mailing list