changeset 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 01cae9259e2f
files src/buddy.c src/protocols/jabber/jabber.c src/protocols/oscar/oscar.c
diffstat 3 files changed, 32 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddy.c	Thu Mar 13 09:50:41 2003 +0000
+++ b/src/buddy.c	Thu Mar 13 10:16:59 2003 +0000
@@ -552,25 +552,25 @@
 		ihrs = (t - b->idle) / 3600;
 		imin = ((t - b->idle) / 60) % 60;
 		if (ihrs)
-			idletime = g_strdup_printf(_("<b>Idle:</b> %dh%02dm"), ihrs, imin);
+			idletime = g_strdup_printf(_("%dh%02dm"), ihrs, imin);
 		else
-			idletime = g_strdup_printf(_("<b>Idle:</b> %dm"), imin);
+			idletime = g_strdup_printf(_("%dm"), imin);
 	}
 
 	if (b->evil > 0)
-		warning = g_strdup_printf(_("<b>Warned:</b> %d%%"), b->evil);
+		warning = g_strdup_printf(_("%d%%"), b->evil);
 
 	text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>"
-			       "%s%s %s"  /* Alias */
-			       "%s%s %s"  /* Nickname */
-			       "%s%s"     /* Idle */
-			       "%s%s"     /* Warning */
+			       "%s %s"  /* Alias */
+			       "%s %s"  /* Nickname */
+			       "%s %s"     /* Idle */
+			       "%s %s"     /* Warning */
 			       "%s%s",    /* Status */
 			       b->name,
-			       b->alias && b->alias[0] ? "\n" : "", b->alias && b->alias[0] ? _("<b>Alias:</b> ") : "", b->alias ? b->alias : "", 
-			       b->server_alias ? "\n" : "", b->server_alias ? _("<b>Nickname:</b> ") : "", b->server_alias ? b->server_alias : "", 
-			       b->idle ? "\n" : "", b->idle ? idletime : "", 
-			       b->evil ? "\n" : "", b->evil ? warning : "",
+			       b->alias && b->alias[0] ? _("\n<b>Alias:</b>") : "", b->alias ? b->alias : "", 
+			       b->server_alias ? _("\n<b>Nickname:</b>") : "", b->server_alias ? b->server_alias : "", 
+			       b->idle ? _("\n<b>Idle:</b>") : "", b->idle ? idletime : "", 
+			       b->evil ? _("\n<b>Warned:</b>") : "", b->evil ? warning : "",
 			       statustext ? "\n" : "", statustext ? statustext : "");
 	if(warning)
 		g_free(warning);
--- a/src/protocols/jabber/jabber.c	Thu Mar 13 09:50:41 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Thu Mar 13 10:16:59 2003 +0000
@@ -3202,6 +3202,15 @@
 
 }
 
+static char *jabber_tooltip_text(struct buddy *b)
+{
+	struct jabber_data *jd = b->account->gc->proto_data;
+	char *text = jabber_lookup_away(jd->gjc, b->name);
+	if (text)
+		return strip_html(text);
+	return NULL;
+}
+
 static char *jabber_status_text(struct buddy *b)
 {
 	struct jabber_data *jd = b->account->gc->proto_data;
@@ -4162,6 +4171,7 @@
 	ret->name = g_strdup("Jabber");
 	ret->list_icon = jabber_list_icon;
 	ret->status_text = jabber_status_text;
+	ret->tooltip_text = jabber_tooltip_text;
 	ret->away_states = jabber_away_states;
 	ret->actions = jabber_actions;
 	ret->buddy_menu = jabber_buddy_menu;
--- 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, ...) {