changeset 29706:163f6c3cbdd9

Remove purple_conversation_attention (also let prpl_send_attention handle the signalling)
author Marcus Lundblad <ml@update.uu.se>
date Mon, 16 Nov 2009 21:04:49 +0000
parents ad119b77f941
children 47b3a53ce497
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
diffstat 8 files changed, 12 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/conversation.c	Mon Nov 16 20:49:04 2009 +0000
+++ b/libpurple/conversation.c	Mon Nov 16 21:04:49 2009 +0000
@@ -1017,16 +1017,6 @@
 	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)
 {
--- a/libpurple/conversation.h	Mon Nov 16 20:49:04 2009 +0000
+++ b/libpurple/conversation.h	Mon Nov 16 21:04:49 2009 +0000
@@ -646,21 +646,6 @@
 		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
--- a/libpurple/protocols/jabber/jabber.c	Mon Nov 16 20:49:04 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Mon Nov 16 21:04:49 2009 +0000
@@ -2890,7 +2890,6 @@
 	
 	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);
--- a/libpurple/protocols/msn/msn.c	Mon Nov 16 20:49:04 2009 +0000
+++ b/libpurple/protocols/msn/msn.c	Mon Nov 16 21:04:49 2009 +0000
@@ -193,8 +193,6 @@
 	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;
 }
--- a/libpurple/protocols/yahoo/libymsg.c	Mon Nov 16 20:49:04 2009 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c	Mon Nov 16 21:04:49 2009 +0000
@@ -5048,7 +5048,6 @@
 		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;
 }
--- a/libpurple/prpl.c	Mon Nov 16 20:49:04 2009 +0000
+++ b/libpurple/prpl.c	Mon Nov 16 21:04:49 2009 +0000
@@ -407,6 +407,16 @@
 	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 @@
 
 	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 @@
 	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));
 }
 
--- a/pidgin/gtkconv.c	Mon Nov 16 20:49:04 2009 +0000
+++ b/pidgin/gtkconv.c	Mon Nov 16 21:04:49 2009 +0000
@@ -1265,8 +1265,6 @@
 	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));
 	}
 }
 
--- a/pidgin/gtkimhtmltoolbar.c	Mon Nov 16 20:49:04 2009 +0000
+++ b/pidgin/gtkimhtmltoolbar.c	Mon Nov 16 21:04:49 2009 +0000
@@ -930,9 +930,6 @@
 	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);
 }