# HG changeset patch # User Eric Warmenhoven # Date 1004219117 0 # Node ID 5004f7eb3d4d236e0b8d751a38e17853bfda5054 # Parent b74421e92d55748a6f402e926ded2a5557dd2842 [gaim-migrate @ 2643] better ignoring committer: Tailor Script diff -r b74421e92d55 -r 5004f7eb3d4d src/buddy_chat.c --- a/src/buddy_chat.c Sat Oct 27 08:27:40 2001 +0000 +++ b/src/buddy_chat.c Sat Oct 27 21:45:17 2001 +0000 @@ -678,8 +678,18 @@ } while (ignore) { - if (!g_strcasecmp(who, ignore->data)) + char *ign = ignore->data; + if (!g_strcasecmp(who, ign)) + return; + if (*ign == '+' && !g_strcasecmp(who, ign + 1)) return; + if (*ign == '@') { + ign++; + if (*ign == '+' && !g_strcasecmp(who, ign + 1)) + return; + if (*ign != '+' && !g_strcasecmp(who, ign)) + return; + } ignore = ignore->next; } @@ -888,6 +898,15 @@ 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; @@ -906,18 +925,14 @@ names = names->next; } - if (!names) + if (!names) { + g_free(name); return; + } 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) { b->ignored = g_list_remove(b->ignored, ignored->data); b->ignored = g_list_append(b->ignored, name);