Mercurial > pidgin
changeset 2631:a2cf3cac7e66
[gaim-migrate @ 2644]
bah. this is better.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 27 Oct 2001 23:46:12 +0000 |
parents | 5004f7eb3d4d |
children | 11badfae115c |
files | src/buddy_chat.c src/conversation.c |
diffstat | 2 files changed, 15 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buddy_chat.c Sat Oct 27 21:45:17 2001 +0000 +++ b/src/buddy_chat.c Sat Oct 27 23:46:12 2001 +0000 @@ -898,15 +898,6 @@ char tmp[BUF_LONG]; - /* we need to check to see if they're ignored before we remove them from the list, - * because otherwise the name is free'd (ignored and in_room point to the same char*'s) - * and we can't search through ignored reliably anymore */ - while (ignored) { - if (!g_strcasecmp(old, ignored->data)) - break; - ignored = ignored->next; - } - while (names) { if (!g_strcasecmp((char *)names->data, old)) { char *tmp2 = names->data; @@ -933,9 +924,16 @@ b->in_room = g_list_insert_sorted(b->in_room, name, insertname); pos = g_list_index(b->in_room, name); + while (ignored) { + if (!g_strcasecmp(old, ignored->data)) + break; + ignored = ignored->next; + } + if (ignored) { + g_free(ignored->data); b->ignored = g_list_remove(b->ignored, ignored->data); - b->ignored = g_list_append(b->ignored, name); + b->ignored = g_list_append(b->ignored, g_strdup(name)); g_snprintf(tmp, sizeof(tmp), "X %s", name); list_item = gtk_list_item_new_with_label(tmp); } else @@ -984,6 +982,8 @@ if (!names) return; + /* don't remove them from ignored in case they re-enter */ + g_snprintf(tmp, sizeof(tmp), _("%d %s in room"), g_list_length(b->in_room), g_list_length(b->in_room) == 1 ? "person" : "people"); gtk_label_set_text(GTK_LABEL(b->count), tmp); @@ -1047,6 +1047,7 @@ } if (ignored) { + g_free(ignored->data); b->ignored = g_list_remove(b->ignored, ignored->data); g_snprintf(tmp, sizeof tmp, "%s", name); } else {
--- a/src/conversation.c Sat Oct 27 21:45:17 2001 +0000 +++ b/src/conversation.c Sat Oct 27 23:46:12 2001 +0000 @@ -723,8 +723,11 @@ gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); } } - if (event->keyval == 'l') + if (event->keyval == 'l') { gtk_imhtml_clear(GTK_IMHTML(c->text)); + g_string_free(c->history, TRUE); + c->history = g_string_new(""); + } if ((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) || (c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) { GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook);