cpw.attention_ui: 61b5cc3e: Added connection flag ALLOW_ATTENTION

malu at pidgin.im malu at pidgin.im
Tue Oct 28 19:10:32 EDT 2008


-----------------------------------------------------------------
Revision: 61b5cc3ef097e47a37ab4af2243d1541595793d4
Ancestor: 3299913a3dbd223f05ac0895ff0daf7bb076c370
Author: malu at pidgin.im
Date: 2008-10-28T23:08:13
Branch: im.pidgin.cpw.attention_ui
URL: http://d.pidgin.im/viewmtn/revision/info/61b5cc3ef097e47a37ab4af2243d1541595793d4

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

ChangeLog: 

Added connection flag ALLOW_ATTENTION
Gray out attention button when the connection doesn't support sending attentions

-------------- next part --------------
============================================================
--- libpurple/connection.h	1bedab3e80682d43f51c28e7c6893169e597662a
+++ libpurple/connection.h	add43d3f8fa913f208c478a7deeac161f5002662
@@ -45,7 +45,8 @@ 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;
 
 typedef enum
============================================================
--- libpurple/protocols/jabber/jabber.c	25c5dc2195195c24fa521b7522018bbb3c945bca
+++ libpurple/protocols/jabber/jabber.c	9aa90dd8085645e03b05707c2f22ae8ac8857368
@@ -646,7 +646,8 @@ jabber_login(PurpleAccount *account)
 	JabberBuddy *my_jb = NULL;
 
 	gc->flags |= PURPLE_CONNECTION_HTML |
-		PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY;
+		PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY |
+		PURPLE_CONNECTION_ALLOW_ATTENTION;
 	js = gc->proto_data = g_new0(JabberStream, 1);
 	js->gc = gc;
 	js->fd = -1;
============================================================
--- libpurple/protocols/msn/msn.c	0e9706e5efe9d4476339e50f647e8eb3a8d10f71
+++ libpurple/protocols/msn/msn.c	e4bbf4b397f0a095d145b1e6ac651350a54a7be6
@@ -986,7 +986,8 @@ 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_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY |
+		PURPLE_CONNECTION_ALLOW_ATTENTION;
 
 	msn_session_set_login_step(session, MSN_LOGIN_STEP_START);
 
============================================================
--- libpurple/protocols/msnp9/msn.c	5e571e10e335bb53c0ac2c5a4ebb5c14627503a0
+++ libpurple/protocols/msnp9/msn.c	f82e91b006574a3fb2c39b74ce7563df40e8b9a6
@@ -775,7 +775,8 @@ 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_NO_FONTSIZE | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY |
+		PURPLE_CONNECTION_ALLOW_ATTENTION;
 
 	msn_session_set_login_step(session, MSN_LOGIN_STEP_START);
 
============================================================
--- libpurple/protocols/myspace/myspace.c	03f4a618f1c34ff94295a3978bf42fa5a9def896
+++ libpurple/protocols/myspace/myspace.c	fb546770d09df2066b2a0cfba09e06347ee61a35
@@ -289,7 +289,8 @@ 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;
+	gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_URLDESC |
+		PURPLE_CONNECTION_ALLOW_ATTENTION;
 
 	/* 1. connect to server */
 	purple_connection_update_progress(gc, _("Connecting"),
============================================================
--- libpurple/protocols/yahoo/yahoo.c	472ba9285bb399003e32bf296cfd2d0429c2e3cf
+++ libpurple/protocols/yahoo/yahoo.c	7c9e7bf75d71eaae230e2b776209259b85b97d64
@@ -2994,7 +2994,8 @@ 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;
+	gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC |
+		PURPLE_CONNECTION_ALLOW_ATTENTION;
 
 	purple_connection_update_progress(gc, _("Connecting"), 1, 2);
 
============================================================
--- pidgin/gtkimhtmltoolbar.c	b9e8f5d6be3dbedcf85406c560bca6b3cb242fba
+++ pidgin/gtkimhtmltoolbar.c	60ce0dc011d96cd2591036082a93f92249e3e679
@@ -1472,6 +1472,10 @@ static void gtk_imhtmltoolbar_init (GtkI
 		G_CALLBACK(gtk_button_clicked), toolbar->attention);
 	gtk_widget_show_all(attention_button);
 	
+	g_signal_connect(G_OBJECT(toolbar->attention), "notify::sensitive",
+			G_CALLBACK(button_sensitiveness_changed), attention_button);
+
+	
 	gtk_box_pack_start(GTK_BOX(hbox), box, FALSE, FALSE, 0);
 	g_object_set_data(G_OBJECT(hbox), "lean-view", box);
 	gtk_widget_show(box);
@@ -1557,9 +1561,12 @@ void gtk_imhtmltoolbar_switch_active_con
 void gtk_imhtmltoolbar_switch_active_conversation(GtkIMHtmlToolbar *toolbar,
 	PurpleConversation *conv)
 {
+	PurpleConnection *gc = purple_conversation_get_gc(conv);
 	purple_debug_info("gtkimhtmltoolbar", "switch active conversation to %p\n",
 		conv);
 	toolbar->active_conv = conv;
-	// gray out buttons...
+	
+	gtk_widget_set_sensitive(toolbar->attention, 
+		gc->flags & PURPLE_CONNECTION_ALLOW_ATTENTION);
 }
 


More information about the Commits mailing list