diff src/protocols/oscar/oscar.c @ 4744:a0746ffce599

[gaim-migrate @ 5059] <i>None Advertised</i> is awful ugly. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 13 Mar 2003 10:16:59 +0000
parents f58f79816ee0
children ced41239ffd3
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Thu Mar 13 09:50:41 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Thu Mar 13 10:16:59 2003 +0000
@@ -2785,7 +2785,7 @@
 	guint bit = 1;
 
 	if (!caps) {
-		strncpy(buf, _("<i>none advertised</i>"), sizeof(buf));
+		return NULL;
 	} else while (bit <= 0x20000) {
 		if (bit & caps) {
 			switch (bit) {
@@ -2852,7 +2852,7 @@
 		}
 		bit <<= 1;
 	}
-	return buf;
+	return buf; 
 }
 
 static char *oscar_tooltip_text(struct buddy *b) {
@@ -2860,10 +2860,16 @@
 	struct oscar_data *od = gc->proto_data;
 	struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name));
 
-	if (bi)
-		return g_strdup_printf(_("<b>Online Since:</b> %s<b>Capabilities:</b> %s"), asctime(localtime(&bi->signon)), caps_string(bi->caps));
-	else
+	if (bi) {
+		char *caps = caps_string(bi->caps);
+		char *time = asctime(localtime(&bi->signon));
+		*(strchr(time, '\n')) = '\0';
+		return g_strdup_printf(_("<b>Online Since:</b> %s%s%s"), 
+				       time, 
+				       caps ? _("\n<b>Capabilities:</b> ") : "", caps ? caps : "");
+	} else {
 		return NULL;
+	}
 }
 
 static int gaim_parse_user_info(aim_session_t *sess, aim_frame_t *fr, ...) {