diff libpurple/protocols/jabber/buddy.c @ 29143:516e53916962

Tighter scoping and slightly less memory usage.
author Paul Aurich <paul@darkrain42.org>
date Sun, 06 Dec 2009 01:01:20 +0000
parents cfcf5076b73f
children b8d47ed6ceb1
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Sun Dec 06 00:52:10 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Sun Dec 06 01:01:20 2009 +0000
@@ -816,10 +816,7 @@
 	if (!jbi->jb->resources) {
 		/* the buddy is offline */
 		gboolean is_domain = jabber_jid_is_domain(jbi->jid);
-		gchar *status =
-			g_strdup_printf("%s%s%s",	_("Offline"),
-			                jbi->last_message ? ": " : "",
-			                jbi->last_message ? jbi->last_message : "");
+
 		if (jbi->last_seconds > 0) {
 			char *last = purple_str_seconds_to_string(jbi->last_seconds);
 			gchar *message = NULL;
@@ -836,9 +833,14 @@
 			g_free(message);
 		}
 
-		if (!is_domain)
+		if (!is_domain) {
+			gchar *status =
+				g_strdup_printf("%s%s%s",	_("Offline"),
+				                jbi->last_message ? ": " : "",
+				                jbi->last_message ? jbi->last_message : "");
 			purple_notify_user_info_prepend_pair(user_info, _("Status"), status);
-		g_free(status);
+			g_free(status);
+		}
 	}
 
 	g_free(resource_name);