diff --git a/include/modules.h b/include/modules.h index b552739a8..056378c8a 100644 --- a/include/modules.h +++ b/include/modules.h @@ -2151,10 +2151,10 @@ int hooktype_post_remote_nickchange(Client *client, MessageTag *mtags); * @param client The client whose state has changed * @param watch The watch list entry * @param lp The associated watch list entry for WATCHing user - * @param reply The numeric that is supposed to be sent as a notification (module-defined) + * @param event The event type (WATCH_EVENT_*) * @return The return value is ignored (use return 0) */ -int hooktype_watch_notification(Client *client, Watch *watch, Link *lp, int reply); +int hooktype_watch_notification(Client *client, Watch *watch, Link *lp, int event); /** Called when user name or user host has changed. * @param client The client whose user@host has changed diff --git a/src/modules/extended-monitor.c b/src/modules/extended-monitor.c index cd720cda4..a7e55bddb 100644 --- a/src/modules/extended-monitor.c +++ b/src/modules/extended-monitor.c @@ -28,7 +28,7 @@ int extended_monitor_away(Client *client, MessageTag *mtags, char *reason, int a int extended_monitor_account_login(Client *client, MessageTag *mtags); int extended_monitor_userhost_changed(Client *client, const char *olduser, const char *oldhost); int extended_monitor_realname_changed(Client *client, const char *oldinfo); -int extended_monitor_notification(Client *client, Watch *watch, Link *lp, int reply); +int extended_monitor_notification(Client *client, Watch *watch, Link *lp, int event); ModuleHeader MOD_HEADER = { @@ -108,7 +108,7 @@ int extended_monitor_realname_changed(Client *client, const char *oldinfo) return 0; } -int extended_monitor_notification(Client *client, Watch *watch, Link *lp, int reply) +int extended_monitor_notification(Client *client, Watch *watch, Link *lp, int event) { if (!(lp->flags & WATCH_FLAG_TYPE_MONITOR)) return 0; @@ -119,7 +119,7 @@ int extended_monitor_notification(Client *client, Watch *watch, Link *lp, int re if (has_common_channels(client, lp->value.client)) return 0; /* will be notified anyway */ - switch (reply) + switch (event) { case WATCH_EVENT_AWAY: if (HasCapability(lp->value.client, "away-notify")) diff --git a/src/modules/monitor.c b/src/modules/monitor.c index 3ce7ad376..d955ee6c8 100644 --- a/src/modules/monitor.c +++ b/src/modules/monitor.c @@ -33,7 +33,7 @@ int monitor_nickchange(Client *client, MessageTag *mtags, char *newnick); int monitor_post_nickchange(Client *client, MessageTag *mtags); int monitor_quit(Client *client, MessageTag *mtags, char *comment); int monitor_connect(Client *client); -int monitor_notification(Client *client, Watch *watch, Link *lp, int reply); +int monitor_notification(Client *client, Watch *watch, Link *lp, int event); ModuleHeader MOD_HEADER = { @@ -106,12 +106,12 @@ int monitor_connect(Client *client) return 0; } -int monitor_notification(Client *client, Watch *watch, Link *lp, int reply) +int monitor_notification(Client *client, Watch *watch, Link *lp, int event) { if (!(lp->flags & WATCH_FLAG_TYPE_MONITOR)) return 0; - switch (reply) + switch (event) { case WATCH_EVENT_ONLINE: sendnumeric(lp->value.client, RPL_MONONLINE, client->name, client->user->username, GetHost(client)); diff --git a/src/modules/watch.c b/src/modules/watch.c index e7e2d5bb7..fd42a3b66 100644 --- a/src/modules/watch.c +++ b/src/modules/watch.c @@ -30,7 +30,7 @@ int watch_away(Client *client, MessageTag *mtags, char *reason, int already_as_a int watch_nickchange(Client *client, MessageTag *mtags, char *newnick); int watch_post_nickchange(Client *client, MessageTag *mtags); int watch_user_connect(Client *client); -int watch_notification(Client *client, Watch *watch, Link *lp, int reply); +int watch_notification(Client *client, Watch *watch, Link *lp, int event); ModuleHeader MOD_HEADER = { @@ -346,19 +346,19 @@ int watch_user_connect(Client *client) return 0; } -int watch_notification(Client *client, Watch *watch, Link *lp, int reply) +int watch_notification(Client *client, Watch *watch, Link *lp, int event) { int awaynotify = 0; if (!(lp->flags & WATCH_FLAG_TYPE_WATCH)) return 0; - if ((reply == WATCH_EVENT_AWAY) || (reply == WATCH_EVENT_NOTAWAY) || (reply == WATCH_EVENT_REAWAY)) + if ((event == WATCH_EVENT_AWAY) || (event == WATCH_EVENT_NOTAWAY) || (event == WATCH_EVENT_REAWAY)) awaynotify = 1; if (!awaynotify) { - sendnumeric(lp->value.client, reply, + sendnumeric(lp->value.client, (event == WATCH_EVENT_OFFLINE)?RPL_MONOFFLINE:RPL_MONONLINE, client->name, (IsUser(client) ? client->user->username : ""), (IsUser(client) ? @@ -371,7 +371,7 @@ int watch_notification(Client *client, Watch *watch, Link *lp, int reply) if (!(lp->flags & WATCH_FLAG_AWAYNOTIFY)) return 0; /* skip away/unaway notification for users not interested in them */ - if (reply == WATCH_EVENT_NOTAWAY) + if (event == WATCH_EVENT_NOTAWAY) sendnumeric(lp->value.client, RPL_NOTAWAY, client->name, (IsUser(client) ? client->user->username : ""), @@ -379,7 +379,7 @@ int watch_notification(Client *client, Watch *watch, Link *lp, int reply) (IsHidden(client) ? client->user->virthost : client-> user->realhost) : ""), client->user->away_since); else /* RPL_GONEAWAY / RPL_REAWAY */ - sendnumeric(lp->value.client, (reply == WATCH_EVENT_AWAY)?RPL_GONEAWAY:RPL_REAWAY, + sendnumeric(lp->value.client, (event == WATCH_EVENT_AWAY)?RPL_GONEAWAY:RPL_REAWAY, client->name, (IsUser(client) ? client->user->username : ""), (IsUser(client) ?