cpw.attention_ui: ed75ebee: Removed _ALLOW_ATTENTION from connection...

malu at pidgin.im malu at pidgin.im
Wed Oct 29 16:20:33 EDT 2008


-----------------------------------------------------------------
Revision: ed75ebee744ce69a5813fad939bc54b825b8e7c4
Ancestor: 61b5cc3ef097e47a37ab4af2243d1541595793d4
Author: malu at pidgin.im
Date: 2008-10-29T20:17:21
Branch: im.pidgin.cpw.attention_ui
URL: http://d.pidgin.im/viewmtn/revision/info/ed75ebee744ce69a5813fad939bc54b825b8e7c4

Modified files:
        libpurple/connection.h libpurple/protocols/jabber/jabber.c
        libpurple/protocols/msn/msn.c
        libpurple/protocols/myspace/myspace.c
        libpurple/protocols/yahoo/yahoo.c pidgin/gtkimhtmltoolbar.c

ChangeLog: 

Removed _ALLOW_ATTENTION from connection flags
Look at the existence of prpl->send_attention to gray out attention button

-------------- next part --------------
============================================================
--- libpurple/connection.h	add43d3f8fa913f208c478a7deeac161f5002662
+++ libpurple/connection.h	ae7f90a3475f070af5b53e7b2180c46e5e67b17e
@@ -45,7 +45,6 @@ typedef enum
 	PURPLE_CONNECTION_NO_URLDESC = 0x0040,  /**< Connection does not support descriptions with links */ 
 	PURPLE_CONNECTION_NO_IMAGES = 0x0080,  /**< Connection does not support sending of images */
 	PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100, /**< Connection supports sending and receiving custom smileys */
-	PURPLE_CONNECTION_ALLOW_ATTENTION = 0x0200, /**< Connection supports sending attention */
 	
 } PurpleConnectionFlags;
 
============================================================
--- libpurple/protocols/jabber/jabber.c	9aa90dd8085645e03b05707c2f22ae8ac8857368
+++ libpurple/protocols/jabber/jabber.c	25c5dc2195195c24fa521b7522018bbb3c945bca
@@ -646,8 +646,7 @@ jabber_login(PurpleAccount *account)
 	JabberBuddy *my_jb = NULL;
 
 	gc->flags |= PURPLE_CONNECTION_HTML |
-		PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY |
-		PURPLE_CONNECTION_ALLOW_ATTENTION;
+		PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY;
 	js = gc->proto_data = g_new0(JabberStream, 1);
 	js->gc = gc;
 	js->fd = -1;
============================================================
--- libpurple/protocols/msn/msn.c	e4bbf4b397f0a095d145b1e6ac651350a54a7be6
+++ libpurple/protocols/msn/msn.c	0e9706e5efe9d4476339e50f647e8eb3a8d10f71
@@ -986,8 +986,7 @@ msn_login(PurpleAccount *account)
 
 	gc->proto_data = session;
 	gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO | PURPLE_CONNECTION_NO_BGCOLOR |
-		PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY |
-		PURPLE_CONNECTION_ALLOW_ATTENTION;
+		PURPLE_CONNECTION_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY;
 
 	msn_session_set_login_step(session, MSN_LOGIN_STEP_START);
 
============================================================
--- libpurple/protocols/myspace/myspace.c	fb546770d09df2066b2a0cfba09e06347ee61a35
+++ libpurple/protocols/myspace/myspace.c	03f4a618f1c34ff94295a3978bf42fa5a9def896
@@ -289,8 +289,7 @@ msim_login(PurpleAccount *acct)
 
 	gc = purple_account_get_connection(acct);
 	gc->proto_data = msim_session_new(acct);
-	gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_URLDESC |
-		PURPLE_CONNECTION_ALLOW_ATTENTION;
+	gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_URLDESC;
 
 	/* 1. connect to server */
 	purple_connection_update_progress(gc, _("Connecting"),
============================================================
--- libpurple/protocols/yahoo/yahoo.c	7c9e7bf75d71eaae230e2b776209259b85b97d64
+++ libpurple/protocols/yahoo/yahoo.c	472ba9285bb399003e32bf296cfd2d0429c2e3cf
@@ -2994,8 +2994,7 @@ static void yahoo_login(PurpleAccount *a
 	PurpleConnection *gc = purple_account_get_connection(account);
 	struct yahoo_data *yd = gc->proto_data = g_new0(struct yahoo_data, 1);
 	PurpleStatus *status = purple_account_get_active_status(account);
-	gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC |
-		PURPLE_CONNECTION_ALLOW_ATTENTION;
+	gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC;
 
 	purple_connection_update_progress(gc, _("Connecting"), 1, 2);
 
============================================================
--- pidgin/gtkimhtmltoolbar.c	60ce0dc011d96cd2591036082a93f92249e3e679
+++ pidgin/gtkimhtmltoolbar.c	15fcd213c523a774a8e2a2d87307e4396f236d95
@@ -1562,11 +1562,16 @@ void gtk_imhtmltoolbar_switch_active_con
 	PurpleConversation *conv)
 {
 	PurpleConnection *gc = purple_conversation_get_gc(conv);
+	PurplePlugin *prpl = purple_connection_get_prpl(gc);
+	
 	purple_debug_info("gtkimhtmltoolbar", "switch active conversation to %p\n",
 		conv);
 	toolbar->active_conv = conv;
 	
-	gtk_widget_set_sensitive(toolbar->attention, 
-		gc->flags & PURPLE_CONNECTION_ALLOW_ATTENTION);
+	/* gray out attention button on protocols that don't support it
+	 for the time being it is always disabled for chats */
+	gtk_widget_set_sensitive(toolbar->attention,
+		purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM && 
+							 PURPLE_PLUGIN_PROTOCOL_INFO(prpl)->send_attention != NULL);
 }
 


More information about the Commits mailing list