Mercurial > pidgin.yaz
changeset 4777:e23a7e166680
[gaim-migrate @ 5097]
- a couple compile cleanups
- status messages and tooltips won't crash gaim when people put up certain
away messages
- yahoo status messages will show the current "custom" message instead of
the previous one
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 14 Mar 2003 22:49:32 +0000 |
parents | 6219ffd18c63 |
children | 85c6c3a60503 |
files | src/buddy.c src/html.c src/protocols/jabber/jabber.c src/protocols/yahoo/yahoo.c src/prpl.c src/prpl.h |
diffstat | 6 files changed, 51 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buddy.c Fri Mar 14 17:41:41 2003 +0000 +++ b/src/buddy.c Fri Mar 14 22:49:32 2003 +0000 @@ -358,13 +358,13 @@ node = g_value_get_pointer(&val); if (GAIM_BLIST_NODE_IS_BUDDY(node)) { if (position == GTK_TREE_VIEW_DROP_AFTER) { - gaim_blist_add_buddy(b, node->parent, node); + gaim_blist_add_buddy(b, (struct group *)node->parent, node); } else if (position == GTK_TREE_VIEW_DROP_BEFORE) { - gaim_blist_add_buddy(b, node->parent, node->prev); + gaim_blist_add_buddy(b, (struct group *)node->parent, node->prev); } } else if (GAIM_BLIST_NODE_IS_GROUP(node)) { - gaim_blist_add_buddy(b, node, NULL); - } + gaim_blist_add_buddy(b, (struct group *)node, NULL); + } gtk_tree_path_free(path); } }
--- a/src/html.c Fri Mar 14 17:41:41 2003 +0000 +++ b/src/html.c Fri Mar 14 22:49:32 2003 +0000 @@ -56,16 +56,20 @@ for (i = 0, j = 0; text2[i]; i++) { if (text2[i] == '<') { k = i + 1; - while (text2[k]) { - if (text2[k] == '<') { - visible = 1; - break; + if(g_ascii_isspace(text2[k])) { + visible = 1; + } else { + while (text2[k]) { + if (text2[k] == '<') { + visible = 1; + break; + } + if (text2[k] == '>') { + visible = 0; + break; + } + k++; } - if (text2[k] == '>') { - visible = 0; - break; - } - k++; } } else if (text2[i] == '>' && !visible) { visible = 1;
--- a/src/protocols/jabber/jabber.c Fri Mar 14 17:41:41 2003 +0000 +++ b/src/protocols/jabber/jabber.c Fri Mar 14 22:49:32 2003 +0000 @@ -3190,14 +3190,20 @@ { jab_res_info jri = jabber_find_resource(b->account->gc, b->name); if(jri) { - char *text = strip_html(jabber_lookup_away(GC_GJ(b->account->gc), + char *stripped = strip_html(jabber_lookup_away(GC_GJ(b->account->gc), b->name)); - char *ret = g_strdup_printf(_("<b>Status:</b> %s%s%s"), + char *text = NULL; + char *ret; + if(stripped) + text = g_markup_escape_text(stripped, strlen(stripped)); + ret = g_strdup_printf(_("<b>Status:</b> %s%s%s"), jabber_get_state_string(jri->state), text ? ": " : "", text ? text : ""); - if(text) + if(stripped) { + g_free(stripped); g_free(text); + } return ret; } return NULL; @@ -3206,13 +3212,16 @@ static char *jabber_status_text(struct buddy *b) { if (b->uc & UC_UNAVAILABLE) { - char *ret = strip_html(jabber_lookup_away(GC_GJ(b->account->gc), + char *stripped = strip_html(jabber_lookup_away(GC_GJ(b->account->gc), b->name)); - if(!ret) { + char *ret; + if(!stripped) { jab_res_info jri = jabber_find_resource(b->account->gc, b->name); if(jri) - ret = g_strdup(jabber_get_state_string(jri->state)); + stripped = g_strdup(jabber_get_state_string(jri->state)); } + ret = g_markup_escape_text(stripped, strlen(stripped)); + g_free(stripped); return ret; } return NULL;
--- a/src/protocols/yahoo/yahoo.c Fri Mar 14 17:41:41 2003 +0000 +++ b/src/protocols/yahoo/yahoo.c Fri Mar 14 22:49:32 2003 +0000 @@ -413,10 +413,6 @@ } if (g_hash_table_lookup(yd->games, name)) gamestate = YAHOO_STATUS_GAME; - if (state == YAHOO_STATUS_AVAILABLE) - serv_got_update(gc, name, 1, 0, 0, 0, gamestate); - else - serv_got_update(gc, name, 1, 0, 0, 0, (state << 2) | UC_UNAVAILABLE | gamestate); if (state == YAHOO_STATUS_CUSTOM) { gpointer val = g_hash_table_lookup(yd->hash, name); if (val) { @@ -427,6 +423,10 @@ g_hash_table_insert(yd->hash, g_strdup(name), msg ? g_strdup(msg) : g_malloc0(1)); } + if (state == YAHOO_STATUS_AVAILABLE) + serv_got_update(gc, name, 1, 0, 0, 0, gamestate); + else + serv_got_update(gc, name, 1, 0, 0, 0, (state << 2) | UC_UNAVAILABLE | gamestate); break; case 60: /* no clue */ break; @@ -1078,8 +1078,14 @@ if (b->uc & UC_UNAVAILABLE) { if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM) return g_strdup(yahoo_get_status_string(b->uc >> 2)); - else - return strip_html(g_hash_table_lookup(yd->hash, b->name)); + else { + char *stripped = strip_html(g_hash_table_lookup(yd->hash, b->name)); + if(stripped) { + char *ret = g_markup_escape_text(stripped, strlen(stripped)); + g_free(stripped); + return ret; + } + } } return NULL; } @@ -1095,8 +1101,10 @@ else status = strip_html(g_hash_table_lookup(yd->hash, b->name)); if(status) { - ret = g_strdup_printf(_("<b>Status:</b> %s"), status); + char *escaped = g_markup_escape_text(status, strlen(status)); + ret = g_strdup_printf(_("<b>Status:</b> %s"), escaped); g_free(status); + g_free(escaped); return ret; } }
--- a/src/prpl.c Fri Mar 14 17:41:41 2003 +0000 +++ b/src/prpl.c Fri Mar 14 22:49:32 2003 +0000 @@ -553,7 +553,7 @@ return ((x->gc != y->gc) || g_strcasecmp(x->who, y->who)); } -void set_icon_data(struct gaim_connection *gc, char *who, void *data, int len) +void set_icon_data(struct gaim_connection *gc, const char *who, void *data, int len) { struct gaim_conversation *conv; struct icon_data tmp; @@ -650,7 +650,7 @@ } } -void *get_icon_data(struct gaim_connection *gc, char *who, int *len) +void *get_icon_data(struct gaim_connection *gc, const char *who, int *len) { struct icon_data tmp = { gc, normalize(who), NULL, 0 }; GList *l = g_list_find_custom(icons, &tmp, find_icon_data);
--- a/src/prpl.h Fri Mar 14 17:41:41 2003 +0000 +++ b/src/prpl.h Fri Mar 14 22:49:32 2003 +0000 @@ -433,7 +433,7 @@ * @param data The icon data. * @param len The length of @a data. */ -void set_icon_data(struct gaim_connection *gc, char *who, void *data, int len); +void set_icon_data(struct gaim_connection *gc, const char *who, void *data, int len); /** * Retrieves the buddy icon data for a user. @@ -444,7 +444,7 @@ * * @return The buddy icon data. */ -void *get_icon_data(struct gaim_connection *gc, char *who, int *len); +void *get_icon_data(struct gaim_connection *gc, const char *who, int *len); /* stuff to load/unload PRPLs as necessary */