cpw.attention_ui: 7be6be91: Remove purple_conversation_attention (al...

malu at pidgin.im malu at pidgin.im
Mon Nov 16 16:10:57 EST 2009


-----------------------------------------------------------------
Revision: 7be6be91b84eee772bbb7f0b11fb818da17f908d
Ancestor: a0a5f86237f137efb59bb8ae94817f61b2945fd2
Author: malu at pidgin.im
Date: 2009-11-16T21:04:49
Branch: im.pidgin.cpw.attention_ui
URL: http://d.pidgin.im/viewmtn/revision/info/7be6be91b84eee772bbb7f0b11fb818da17f908d

Modified files:
        libpurple/conversation.c libpurple/conversation.h
        libpurple/protocols/jabber/jabber.c
        libpurple/protocols/msn/msn.c
        libpurple/protocols/yahoo/libymsg.c libpurple/prpl.c
        pidgin/gtkconv.c pidgin/gtkimhtmltoolbar.c

ChangeLog: 

Remove purple_conversation_attention (also let prpl_send_attention handle
the signalling)

-------------- next part --------------
============================================================
--- libpurple/conversation.c	ed41066084bcdc64fb4432a44dbee500fd5e917e
+++ libpurple/conversation.c	d272e427e9274e088c365ba0b1e0b5c7bf169a70
@@ -1017,16 +1017,6 @@ purple_conversation_write(PurpleConversa
 	g_free(displayed);
 }
 
-void
-purple_conversation_attention(PurpleConversation *conv, const char *who,
-	guint type, PurpleMessageFlags flags, time_t mtime)
-{
-	PurpleAccount *account = purple_conversation_get_account(conv);
-	purple_signal_emit(purple_conversations_get_handle(),
-		flags == PURPLE_MESSAGE_SEND ? "sent-attention" : "got-attention",
-		account, who, conv, type);
-}
-
 gboolean
 purple_conversation_has_focus(PurpleConversation *conv)
 {
============================================================
--- libpurple/conversation.h	c2f994dbeedd27e56faa7258bf9067a5cbf20b61
+++ libpurple/conversation.h	7eeea6684238d924832ee6c0089ae0cbc9448316
@@ -646,21 +646,6 @@ void purple_conversation_write(PurpleCon
 		time_t mtime);
 
 /**
- * Sends an attention to a conversation window.
- *
- * This is to be called by prpls to tell UIs to set off the action for
- * an attention message
- *
- * @param conv		The conversation
- * @param who		The user who sent the attention
- * @param type		The attention type (will be 0 for protocols that only have 1 type)
- * @param flags		The message flags (send, receive)
- * @param mtime		The time the attentsion was sent
- */
-void purple_conversation_attention(PurpleConversation *conv, const char *who,
-	guint attention_type, PurpleMessageFlags flags, time_t mtime);
-	
-/**
 	Set the features as supported for the given conversation.
 	@param conv      The conversation
 	@param features  Bitset defining supported features
============================================================
--- libpurple/protocols/jabber/jabber.c	dd910a4ddfdb715a98582d55aec036213c70c042
+++ libpurple/protocols/jabber/jabber.c	fca2cfd35487b136770a53dabab22de936b25e23
@@ -2890,7 +2890,6 @@ static PurpleCmdRet jabber_cmd_buzz(Purp
 	
 	description = 
 		g_strdup_printf(purple_attention_type_get_outgoing_desc(attn), alias);
-	purple_conversation_attention(conv, who, 0, PURPLE_MESSAGE_SEND, time(NULL));
 	purple_conversation_write(conv, NULL, description, 
 		PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_SYSTEM, time(NULL));
 	g_free(description);
============================================================
--- libpurple/protocols/msn/msn.c	6aa947026ca74692928d7a953e4886017801c56a
+++ libpurple/protocols/msn/msn.c	d435a1ddb0394f78484f94120f6829880efa2db0
@@ -193,8 +193,6 @@ msn_cmd_nudge(PurpleConversation *conv, 
 	username = purple_conversation_get_name(conv);
 
 	purple_prpl_send_attention(gc, username, MSN_NUDGE);
-	purple_conversation_attention(conv, username, 0, PURPLE_MESSAGE_SEND,
-		time(NULL));
 
 	return PURPLE_CMD_RET_OK;
 }
============================================================
--- libpurple/protocols/yahoo/libymsg.c	68a2686db64d77e9bc7102b5e495ece72cc455e5
+++ libpurple/protocols/yahoo/libymsg.c	f4a05e65a1b944a3e4836d667ebd2dea704ddcfe
@@ -5048,7 +5048,6 @@ yahoopurple_cmd_buzz(PurpleConversation 
 		return PURPLE_CMD_RET_FAILED;
 
 	purple_prpl_send_attention(account->gc, c->name, YAHOO_BUZZ);
-	purple_conversation_attention(c, c->name, 0, PURPLE_MESSAGE_SEND, time(NULL));
 
 	return PURPLE_CMD_RET_OK;
 }
============================================================
--- libpurple/prpl.c	3bce42f166ddd09f4a1ae31a01b5b088ce44315a
+++ libpurple/prpl.c	abdc382c9e5315fcd018cb69da8294596283e0ad
@@ -407,6 +407,16 @@ purple_prpl_get_statuses(PurpleAccount *
 	return statuses;
 }
 
+static void
+purple_prpl_attention(PurpleConversation *conv, const char *who,
+	guint type, PurpleMessageFlags flags, time_t mtime)
+{
+	PurpleAccount *account = purple_conversation_get_account(conv);
+	purple_signal_emit(purple_conversations_get_handle(),
+		flags == PURPLE_MESSAGE_SEND ? "sent-attention" : "got-attention",
+		account, who, conv, type);
+}
+
 void
 purple_prpl_send_attention(PurpleConnection *gc, const char *who, guint type_code)
 {
@@ -452,6 +462,7 @@ purple_prpl_send_attention(PurpleConnect
 
 	conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, gc->account, who);
 	purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, description, flags, mtime);
+	purple_prpl_attention(conv, who, type_code, PURPLE_MESSAGE_SEND, time(NULL));
 
 	g_free(description);
 }
@@ -510,7 +521,7 @@ purple_prpl_got_attention(PurpleConnecti
 	conv = 
 		purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, who, account);
 	if (conv)
-		purple_conversation_attention(conv, who, type_code, PURPLE_MESSAGE_RECV,
+		purple_prpl_attention(conv, who, type_code, PURPLE_MESSAGE_RECV,
 			time(NULL));
 }
 
============================================================
--- pidgin/gtkconv.c	5f87f6e5bbfdbade45911b47c7a81dabe1c8e320
+++ pidgin/gtkconv.c	8b98586ab0395e9e71f14c7bf18953341134b32c
@@ -1265,8 +1265,6 @@ menu_get_attention_cb(gpointer data, gui
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
 		purple_prpl_send_attention(purple_conversation_get_gc(conv), 
 			purple_conversation_get_name(conv), 0);
-		purple_conversation_attention(conv, purple_conversation_get_name(conv),
-			0, PURPLE_MESSAGE_SEND, time(NULL));
 	}
 }
 
============================================================
--- pidgin/gtkimhtmltoolbar.c	36d599dd4081b3c011c975d745578b90e3b37e24
+++ pidgin/gtkimhtmltoolbar.c	3b9597a822fc61f8634dc49c8f14608edd35ece4
@@ -930,9 +930,6 @@ static void send_attention_cb(GtkWidget 
 	PurpleConnection *gc = purple_conversation_get_gc(conv);
 
 	toggle_button_set_active_block(GTK_TOGGLE_BUTTON(attention), FALSE, toolbar);
-	/*toggle_button_set_active_block(GTK_TOGGLE_BUTTON(
-	    g_object_get_data(G_OBJECT(toolbar->imhtml), "attention")), FALSE, toolbar);*/
-	purple_conversation_attention(conv, who, 0, PURPLE_MESSAGE_SEND, time(NULL));
 	purple_prpl_send_attention(gc, who, 0);
 }
 


More information about the Commits mailing list