changeset 12117:cb77957d644c

[gaim-migrate @ 14417] changelogify the awesome queueing system from Casey Harkins, add my own touch of awesomeness to it, and commit a patch I found somewhere earlier today to fix crashing on NetBSD. It might have been in the tracker, I'll have to hunt for it committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 16 Nov 2005 22:33:15 +0000
parents e75ef7aa913e
children 56a3649c7bed
files ChangeLog src/gtkblist.c src/gtkconv.h src/plugin.c
diffstat 4 files changed, 26 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Nov 16 18:17:01 2005 +0000
+++ b/ChangeLog	Wed Nov 16 22:33:15 2005 +0000
@@ -39,6 +39,7 @@
 	  with the same name are fixed (Andrew Hart)
 	* Added tab management options to the tab right-click menu (Sadrul Habib
 	  Chowdhury)
+	* Brand new message queueing system (Casey Harkins)
 
 	Sounds:
 	* Beautiful new default sounds (Brad Turcotte)
--- a/src/gtkblist.c	Wed Nov 16 18:17:01 2005 +0000
+++ b/src/gtkblist.c	Wed Nov 16 22:33:15 2005 +0000
@@ -3136,23 +3136,38 @@
                         GaimGtkBuddyList *gtkblist)
 {
 	GtkWidget *img = NULL;
+	GString *tooltip_text = NULL;
 
 	if(gtkblist->menutrayicon) {
 		gtk_widget_destroy(gtkblist->menutrayicon);
 		gtkblist->menutrayicon = NULL;
 	}
 
-	if(gaim_gtk_conversations_get_first_unseen(GAIM_CONV_TYPE_IM, GAIM_UNSEEN_TEXT))
+	if(gaim_gtk_conversations_get_first_unseen(GAIM_CONV_TYPE_IM, GAIM_UNSEEN_TEXT)) {
+		GList *convs = gaim_get_ims();
+		tooltip_text = g_string_new("");
+		while(convs) {
+			conv = convs->data;
+			if(GAIM_IS_GTK_CONVERSATION(conv)) {
+				GaimGtkConversation *gtkconv = GAIM_GTK_CONVERSATION(conv);
+				if(gtkconv->unseen_state >= GAIM_UNSEEN_TEXT) {
+					g_string_append_printf(tooltip_text,
+							_("Unread messages from %s\n"), gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
+				}
+			}
+			convs = convs->next;
+		}
+		/* get rid of the last newline */
+		tooltip_text = g_string_truncate(tooltip_text, tooltip_text->len -1);
 		img = gtk_image_new_from_stock(GAIM_STOCK_PENDING, GTK_ICON_SIZE_MENU);
 
-	if(img) {
 		gtkblist->menutrayicon = gtk_event_box_new();
 		gtk_container_add(GTK_CONTAINER(gtkblist->menutrayicon), img);
 		gtk_widget_show(img);
 		gtk_widget_show(gtkblist->menutrayicon);
 		g_signal_connect(G_OBJECT(gtkblist->menutrayicon), "button-press-event", G_CALLBACK(menutray_press_cb), NULL);
-		
-		gaim_gtk_menu_tray_append(GAIM_GTK_MENU_TRAY(gtkblist->menutray), gtkblist->menutrayicon, NULL);
+
+		gaim_gtk_menu_tray_append(GAIM_GTK_MENU_TRAY(gtkblist->menutray), gtkblist->menutrayicon, g_string_free(tooltip_text, FALSE));
 	}
 }
 
--- a/src/gtkconv.h	Wed Nov 16 18:17:01 2005 +0000
+++ b/src/gtkconv.h	Wed Nov 16 22:33:15 2005 +0000
@@ -219,18 +219,6 @@
  */
 void gaim_gtkconv_present_conversation(GaimConversation *conv);
 
-/**
- * Finds the first conversations of the given type which has an
- * unseen state greater than or equal to the given minimum
- * state.
- *
- * @param type      The type of conversation.
- * @param min_state The minimum unseen state.
- * @return          First conversation matching critera, or NULL.
- */
-GaimConversation * gaim_gtk_conversations_get_first_unseen(
-		GaimConversationType type, GaimUnseenState min_state);
-
 GaimGtkWindow *gaim_gtkconv_get_window(GaimGtkConversation *gtkconv);
 GdkPixbuf *gaim_gtkconv_get_tab_icon(GaimConversation *conv, gboolean small_icon);
 void gaim_gtkconv_new(GaimConversation *conv);
--- a/src/plugin.c	Wed Nov 16 18:17:01 2005 +0000
+++ b/src/plugin.c	Wed Nov 16 22:33:15 2005 +0000
@@ -467,11 +467,15 @@
 			for (l = prpl_info->protocol_options; l != NULL; l = l->next)
 				gaim_account_option_destroy(l->data);
 
-			if (prpl_info->user_splits != NULL)
+			if (prpl_info->user_splits != NULL) {
 				g_list_free(prpl_info->user_splits);
+				prpl_info->user_splits = NULL;
+			}
 
-			if (prpl_info->protocol_options != NULL)
+			if (prpl_info->protocol_options != NULL) {
 				g_list_free(prpl_info->protocol_options);
+				prpl_info->protocol_options = NULL;
+			}
 		}
 	}
 	else {