changeset 13515:f5d4300aeed8

[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. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 15 Mar 2006 04:41:44 +0000
parents 6ad9d666e824
children 4279e5b5e9ac
files src/status.c
diffstat 1 files changed, 21 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- 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);