gobjectification.conversation: d2c95980: Use some of the new APIs.

sadrul at pidgin.im sadrul at pidgin.im
Sat Jul 24 23:10:45 EDT 2010


----------------------------------------------------------------------
Revision: d2c95980437273c94f72f8c878d95cde787db871
Parent:   e0159826a20b715a18ecda3790588dd954291cfa
Author:   sadrul at pidgin.im
Date:     07/24/10 22:02:58
Branch:   im.pidgin.gobjectification.conversation
URL: http://d.pidgin.im/viewmtn/revision/info/d2c95980437273c94f72f8c878d95cde787db871

Changelog: 

Use some of the new APIs.

Changes against parent e0159826a20b715a18ecda3790588dd954291cfa

  patched  libpurple/connection.c
  patched  libpurple/ft.c
  patched  libpurple/gsignal.c
  patched  libpurple/gsignal.h
  patched  libpurple/idle.c
  patched  libpurple/marshallers.list
  patched  libpurple/pounce.c
  patched  libpurple/prpl.c

-------------- next part --------------
============================================================
--- libpurple/prpl.c	5bfcfee5fbe1b2881e64e9a0d424423d640dd813
+++ libpurple/prpl.c	cfed394b718a619c65207d268986f3e85da7d618
@@ -413,10 +413,13 @@ purple_prpl_attention(PurpleConversation
 purple_prpl_attention(PurpleConversation *conv, const char *who,
 	guint type, PurpleMessageFlags flags, time_t mtime)
 {
+#warning Notify the conversation about an attention some other way.
+#if 0
 	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);
+#endif
 }
 
 void
@@ -475,6 +478,8 @@ got_attention(PurpleConnection *gc, int 
 static void
 got_attention(PurpleConnection *gc, int id, const char *who, guint type_code)
 {
+#warning Look at the attention system again
+#if 0
 	PurpleMessageFlags flags;
 	PurpleAttentionType *attn;
 	PurpleBuddy *buddy;
@@ -514,6 +519,7 @@ got_attention(PurpleConnection *gc, int 
 	/* TODO: sounds (depending on PurpleAttentionType), shaking, etc. */
 
 	g_free(description);
+#endif
 }
 
 void
============================================================
--- libpurple/ft.c	6acb60d7896e2e4b9963c127a1a8ced83e3864c7
+++ libpurple/ft.c	2bac0cba087b4fd0b14bfbdbc6afcb806a09819f
@@ -515,9 +515,12 @@ purple_xfer_ask_recv(PurpleXfer *xfer)
 						buddy ? purple_buddy_get_alias(buddy) : xfer->who);
 		}
 
-		if (xfer->message != NULL)
-			serv_got_im(purple_account_get_connection(xfer->account),
-								 xfer->who, xfer->message, 0, time(NULL));
+		if (xfer->message != NULL) {
+			PurpleMessage *msg = purple_message_new(xfer->who, NULL, xfer->message,
+					0, time(NULL));
+			if (!purple_im_new_with_receive(xfer->account, msg))
+				purple_message_free(msg);
+		}
 
 		if ((thumb = purple_xfer_get_thumbnail(xfer, &thumb_size))) {
 			purple_request_accept_cancel_with_icon(xfer, NULL, buf, NULL,
============================================================
--- libpurple/pounce.c	519900003d13231dc8a58aa940381f3752d6410c
+++ libpurple/pounce.c	bc4a3498652b93ca76725f879e2736fdd2661aec
@@ -1120,7 +1120,6 @@ purple_pounces_init(void)
 {
 	void *handle       = purple_pounces_get_handle();
 	void *blist_handle = purple_blist_get_handle();
-	void *conv_handle  = purple_conversations_get_handle();
 
 	pounce_handlers = g_hash_table_new_full(g_str_hash, g_str_equal,
 											g_free, free_pounce_handler);
@@ -1136,6 +1135,8 @@ purple_pounces_init(void)
 						handle, PURPLE_CALLBACK(buddy_state_cb),
 						GINT_TO_POINTER(PURPLE_POUNCE_SIGNOFF));
 
+#warning Listen to the right conversation signals
+#if 0
 	purple_signal_connect(conv_handle, "buddy-typing",
 						handle, PURPLE_CALLBACK(buddy_typing_cb), NULL);
 	purple_signal_connect(conv_handle, "buddy-typed",
@@ -1145,6 +1146,7 @@ purple_pounces_init(void)
 
 	purple_signal_connect(conv_handle, "received-im-msg",
 						handle, PURPLE_CALLBACK(received_message_cb), NULL);
+#endif
 }
 
 void
============================================================
--- libpurple/connection.c	d36fbbf98acb87d37c6ac5ff11e505d0905946b9
+++ libpurple/connection.c	74bc77bef1346017ee2934cfadce7a5f4656271e
@@ -864,14 +864,14 @@ purple_connection_dispose(GObject *obj)
 	if (prpl_info->close)
 		(prpl_info->close)(pc);
 
-	/* Clear out the proto data that was freed in the prpl close method*/
+	/* Clear out the proto data that was freed in the prpl close method.
+	 *
+	 * : Do we really want to do it from here? Wouldn't it be better to unset these
+	 * from the prpl's 'close'? */
 	buddies = purple_find_buddies(account, NULL);
 	while (buddies != NULL) {
-#warning Uncomment when PurpleBuddy is a GObject
-#if 0
 		PurpleBuddy *buddy = buddies->data;
 		purple_object_set_protocol_data(PURPLE_OBJECT(buddy),NULL);
-#endif
 		buddies = g_slist_delete_link(buddies, buddies);
 	}
 
============================================================
--- libpurple/idle.c	884bc1f2a99f496f546fcc0e43ea229ffc1d09cf
+++ libpurple/idle.c	9a06e48cadd5932b202b2b8f8debe4ea569ed5f3
@@ -319,9 +319,12 @@ purple_idle_init()
 void
 purple_idle_init()
 {
+#warning Listen to the right conversation signal.
+#if 0
 	purple_signal_connect(purple_conversations_get_handle(), "sent-im-msg",
 						purple_idle_get_handle(),
 						PURPLE_CALLBACK(im_msg_sent_cb), NULL);
+#endif
 	purple_g_signal_connect(PURPLE_TYPE_CONNECTION, "signing-on",
 						PURPLE_CALLBACK(signing_on_cb), NULL);
 	purple_g_signal_connect(PURPLE_TYPE_CONNECTION, "signing-off",
============================================================
--- libpurple/marshallers.list	c5a4cd7ed04de076d46c5bdc1484ae828e1c11bc
+++ libpurple/marshallers.list	ca23f22ad80228517e1b7670fc8d2a08dfbf1c6d
@@ -13,3 +13,5 @@ VOID:STRING,STRING,OBJECT,OBJECT
 VOID:ENUM,STRING,STRING,BOOLEAN
 VOID:FLAGS,FLAGS
 VOID:STRING,STRING,OBJECT,OBJECT
+BOOLEAN:POINTER
+
============================================================
--- libpurple/gsignal.c	a0e28ada68a8fc818468aa82048a2596a5934d89
+++ libpurple/gsignal.c	8e094bd69206eb47288978dc3005118974e7222f
@@ -195,3 +195,20 @@ purple_g_signal_handle_free(PurpleGSigna
 	g_free(handle);
 }
 
+
+gboolean
+purple_signal_boolean_accumulator(GSignalInvocationHint *ihint,
+				  GValue                *return_accu,
+				  const GValue          *handler_return,
+				  gpointer               dummy)
+{
+	gboolean continue_emission;
+	gboolean signal_handled;
+
+	signal_handled = g_value_get_boolean (handler_return);
+	g_value_set_boolean (return_accu, signal_handled);
+	continue_emission = !signal_handled;
+
+	return continue_emission;
+}
+
============================================================
--- libpurple/gsignal.h	c521addcd1783a613f26e60bf290b0579b4b305a
+++ libpurple/gsignal.h	8bf02e33965d5ab0218b69eb19d3fbfd0d05fdfc
@@ -44,6 +44,12 @@ void purple_g_signal_handle_free(PurpleG
 PurpleGSignalHandle *purple_g_signal_handle_copy(const PurpleGSignalHandle *handle);
 void purple_g_signal_handle_free(PurpleGSignalHandle *handle);
 
+gboolean purple_signal_boolean_accumulator(GSignalInvocationHint *ihint,
+				  GValue                *return_accu,
+				  const GValue          *handler_return,
+				  gpointer               dummy);
+
+
 G_END_DECLS
 
 #endif /* PURPLE_SIGNALS_H */


More information about the Commits mailing list