Use server argument instead of from_server in rebuild_notify_ison()
It is only called in one place, where from_server is already set to the same as the argument. Rename rebuild_all_ison() to rebuild_notify_ison_all(). Make rebuild_notify_ison() and rebuild_notify_ison_all() static, they are only called from this file.
This commit is contained in:
@@ -49,8 +49,6 @@ typedef struct notify_alist
|
|||||||
extern char *get_notify_nicks (int, int, char *, int);
|
extern char *get_notify_nicks (int, int, char *, int);
|
||||||
void add_delay_notify (int);
|
void add_delay_notify (int);
|
||||||
void notify_count (int, int *, int *);
|
void notify_count (int, int *, int *);
|
||||||
void rebuild_notify_ison (int);
|
|
||||||
void rebuild_all_ison (void);
|
|
||||||
void save_watch(FILE *);
|
void save_watch(FILE *);
|
||||||
BUILT_IN_COMMAND(watchcmd);
|
BUILT_IN_COMMAND(watchcmd);
|
||||||
void show_watch_list (int);
|
void show_watch_list (int);
|
||||||
|
|||||||
@@ -47,38 +47,35 @@ void dispatch_notify_userhosts (void);
|
|||||||
void notify_userhost_dispatch (UserhostItem *, char *, char *);
|
void notify_userhost_dispatch (UserhostItem *, char *, char *);
|
||||||
void notify_userhost_reply (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;
|
int i;
|
||||||
if (from_server == -1)
|
|
||||||
|
if (server < 0 || server >= server_list_size())
|
||||||
return;
|
return;
|
||||||
stuff = NOTIFY_LIST(from_server)->ison;
|
|
||||||
|
|
||||||
if (NOTIFY_LIST(from_server)->ison)
|
notify_list = NOTIFY_LIST(server);
|
||||||
NOTIFY_LIST(from_server)->ison[0] = 0;
|
|
||||||
|
|
||||||
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),
|
m_s3cat(¬ify_list->ison, space, notify_list->list[i]->nick);
|
||||||
space, NOTIFY_ITEM(from_server, i)->nick);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void rebuild_all_ison (void)
|
static void rebuild_notify_ison_all(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int ofs = from_server;
|
|
||||||
for (i = 0; i < server_list_size(); i++)
|
for (i = 0; i < server_list_size(); i++)
|
||||||
{
|
{
|
||||||
from_server = i;
|
|
||||||
rebuild_notify_ison(i);
|
rebuild_notify_ison(i);
|
||||||
}
|
}
|
||||||
from_server = ofs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ison_notify(char *AskedFor, char *AreOn)
|
void ison_notify(char *AskedFor, char *AreOn)
|
||||||
{
|
{
|
||||||
char *NextAsked;
|
char *NextAsked;
|
||||||
@@ -324,7 +321,7 @@ BUILT_IN_COMMAND(notify)
|
|||||||
}
|
}
|
||||||
|
|
||||||
new_free(&list);
|
new_free(&list);
|
||||||
rebuild_all_ison();
|
rebuild_notify_ison_all();
|
||||||
if (no_nicks)
|
if (no_nicks)
|
||||||
show_notify_list(0);
|
show_notify_list(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user