diff src/gtkstatusbox.c @ 13012:e3b9c6c7bcf6

[gaim-migrate @ 15365] Don't create duplicate transient statuses. So like, if you switch between "Available" and "Away" a bunch of times and use the same message everywhere, you'll only have one of each in your list of recent statuses committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 23 Jan 2006 04:54:37 +0000
parents d7b9fa3b7baf
children e8adf8183cf4
line wrap: on
line diff
--- a/src/gtkstatusbox.c	Mon Jan 23 04:25:04 2006 +0000
+++ b/src/gtkstatusbox.c	Mon Jan 23 04:54:37 2006 +0000
@@ -1067,9 +1067,17 @@
 
 		if (changed)
 		{
-			/* Create a new transient saved status */
-			saved_status = gaim_savedstatus_new(NULL, GPOINTER_TO_INT(data));
-			gaim_savedstatus_set_message(saved_status, message);
+			/* If we've used this type+message before, lookup the transient status */
+			saved_status = gaim_savedstatus_find_by_type_and_message(
+										GPOINTER_TO_INT(data), message);
+
+
+			/* If this type+message is unique then create a new transient saved status */
+			if (saved_status == NULL)
+			{
+				saved_status = gaim_savedstatus_new(NULL, GPOINTER_TO_INT(data));
+				gaim_savedstatus_set_message(saved_status, message);
+			}
 
 			/* Set the status for each account */
 			gaim_savedstatus_activate(saved_status);