im.pidgin.pidgin: b1278944ccaa36c30b7f00edf5b79dc38347c931

sadrul at pidgin.im sadrul at pidgin.im
Mon Nov 26 00:45:42 EST 2007


-----------------------------------------------------------------
Revision: b1278944ccaa36c30b7f00edf5b79dc38347c931
Ancestor: 30553187b82f795a4c65a0bf7f1e7e6c3fc4ff57
Author: sadrul at pidgin.im
Date: 2007-11-26T05:39:37
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/jabber/presence.c

ChangeLog: 

We need to work with the exclusive status.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/presence.c	244be4e1a8a142434cae293487e2814f770094f7
+++ libpurple/protocols/jabber/presence.c	c62477cd09bf9a3f65fe6cc8929d91929aaf3906
@@ -99,8 +99,6 @@ void jabber_presence_send(PurpleAccount 
 {
 	PurpleConnection *gc = NULL;
 	JabberStream *js = NULL;
-	gboolean disconnected;
-	int primitive;
 	xmlnode *presence, *x, *photo;
 	char *stripped = NULL;
 	JabberBuddyState state;
@@ -108,23 +106,27 @@ void jabber_presence_send(PurpleAccount 
 	const char *artist = NULL, *title = NULL, *source = NULL, *uri = NULL, *track = NULL;
 	int length = -1;
 	gboolean allowBuzz;
-	PurplePresence *p = purple_account_get_presence(account);
+	PurplePresence *p;
 	PurpleStatus *tune;
 
+	if (purple_account_is_disconnected(account))
+		return;
+
+	p = purple_account_get_presence(account);
 	if (NULL == status) {
 		status = purple_presence_get_active_status(p);
 	}
 
-	if(!purple_status_is_active(status))
-		return;
+	if (purple_status_is_exclusive(status)) {
+		/* An exclusive status can't be deactivated. You should just
+		 * activate some other exclusive status. */
+		if (!purple_status_is_active(status))
+			return;
+	} else {
+		/* Work with the exclusive status. */
+		status = purple_presence_get_active_status(p);
+	}
 
-	disconnected = purple_account_is_disconnected(account);
-
-	if(disconnected)
-		return;
-
-	primitive = purple_status_type_get_primitive(purple_status_get_type(status));
-
 	gc = purple_account_get_connection(account);
 	js = gc->proto_data;
 


More information about the Commits mailing list