diff --git a/include/notify.h b/include/notify.h index 0f8ec2b..40687f7 100644 --- a/include/notify.h +++ b/include/notify.h @@ -49,8 +49,6 @@ typedef struct notify_alist extern char *get_notify_nicks (int, int, char *, int); void add_delay_notify (int); void notify_count (int, int *, int *); - void rebuild_notify_ison (int); - void rebuild_all_ison (void); void save_watch(FILE *); BUILT_IN_COMMAND(watchcmd); void show_watch_list (int); diff --git a/source/notify.c b/source/notify.c index 6c2ca24..f916533 100644 --- a/source/notify.c +++ b/source/notify.c @@ -47,38 +47,35 @@ void dispatch_notify_userhosts (void); void notify_userhost_dispatch (UserhostItem *, char *, char *); void notify_userhost_reply (char *, char *); -void rebuild_notify_ison (int server) +static void rebuild_notify_ison(int server) { - char *stuff; + NotifyList *notify_list; int i; - if (from_server == -1) + + if (server < 0 || server >= server_list_size()) return; - stuff = NOTIFY_LIST(from_server)->ison; - if (NOTIFY_LIST(from_server)->ison) - NOTIFY_LIST(from_server)->ison[0] = 0; + notify_list = NOTIFY_LIST(server); - for (i = 0; i < NOTIFY_MAX(from_server); i++) + if (notify_list->ison) + notify_list->ison[0] = 0; + + for (i = 0; i < notify_list->max; i++) { - m_s3cat(&(NOTIFY_LIST(from_server)->ison), - space, NOTIFY_ITEM(from_server, i)->nick); + m_s3cat(¬ify_list->ison, space, notify_list->list[i]->nick); } } -void rebuild_all_ison (void) +static void rebuild_notify_ison_all(void) { int i; - int ofs = from_server; + for (i = 0; i < server_list_size(); i++) { - from_server = i; rebuild_notify_ison(i); } - from_server = ofs; } - - void ison_notify(char *AskedFor, char *AreOn) { char *NextAsked; @@ -324,7 +321,7 @@ BUILT_IN_COMMAND(notify) } new_free(&list); - rebuild_all_ison(); + rebuild_notify_ison_all(); if (no_nicks) show_notify_list(0); }