[gaim-migrate @ 15891]

Wed, 15 Mar 2006 04:41:44 +0000

author
Mark Doliner <markdoliner@pidgin.im>
date
Wed, 15 Mar 2006 04:41:44 +0000
changeset 13516
bbc2d9f8e06f
parent 13515
0cea461e904c
child 13517
00bbaf8f5bf5

[gaim-migrate @ 15891]
Fix sf bug #1443092, Events logging not working properly?
"signed on" and "signed off" for people in your buddy list
are now correctly logged to the system log.

Richard, someone had already left a note in this function
to make a change after the string freeze (I think it was
you). We should still make a change after the string freeze,
but the change is different now than it was before this commit.

src/status.c file | annotate | diff | comparison | revisions
--- a/src/status.c	Tue Mar 14 23:56:57 2006 +0000
+++ b/src/status.c	Wed Mar 15 04:41:44 2006 +0000
@@ -616,34 +616,35 @@
 		const char *buddy_alias = gaim_buddy_get_alias(buddy);
 		char *tmp = NULL;
 
-		if (gaim_status_is_available(new_status))
+		if ((old_status != NULL) &&
+			!gaim_status_is_online(old_status) &&
+			gaim_status_is_online(new_status))
 		{
-			if (((old_status == NULL) || !gaim_status_is_online(old_status)))
-			{
-				tmp = g_strdup_printf(_("%s signed on"), buddy_alias);
-			}
-			else if (!gaim_status_is_available(old_status))
-			{
-				tmp = g_strdup_printf(_("%s came back"), buddy_alias);
-			}
+			tmp = g_strdup_printf(_("%s signed on"), buddy_alias);
 		}
-		else if ((old_status != NULL) && gaim_status_is_available(old_status))
+		else if ((old_status != NULL) &&
+				 gaim_status_is_online(old_status) &&
+				 !gaim_status_is_online(new_status))
 		{
-			if (!gaim_status_is_online(new_status))
-			{
-				tmp = g_strdup_printf(_("%s signed off"), buddy_alias);
-			}
-			else if (!gaim_status_is_available(new_status))
-			{
-				tmp = g_strdup_printf(_("%s went away"), buddy_alias);
-			}
+			tmp = g_strdup_printf(_("%s signed off"), buddy_alias);
 		}
-		else
+		else if (((old_status == NULL) || !gaim_status_is_available(old_status)) &&
+				 gaim_status_is_available(new_status))
 		{
-			/* XXX: Make this "%s is away" when strings thaw. */
+			tmp = g_strdup_printf(_("%s came back"), buddy_alias);
+		}
+		else if (((old_status == NULL) || gaim_status_is_available(old_status)) &&
+				 !gaim_status_is_available(new_status))
+		{
 			tmp = g_strdup_printf(_("%s went away"), buddy_alias);
 		}
 
+		/* After the string freeze, get rid of the above crap and use this. */
+		/*
+		tmp = g_strdup_printf(_("%s is now %s"), buddy_alias,
+							  gaim_status_get_name(new_status));
+		*/
+
 		if (tmp != NULL)
 		{
 			GaimLog *log = gaim_account_get_log(buddy->account, FALSE);

mercurial