1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 20:33:13 +02:00

Update watch_notification argument name

Fix WATCH crash caused by that argument
This commit is contained in:
k4be
2021-08-24 20:19:50 +02:00
parent fe51aaf357
commit f4a915bbb7
4 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -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
+3 -3
View File
@@ -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"))
+3 -3
View File
@@ -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));
+6 -6
View File
@@ -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 : "<N/A>"),
(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 : "<N/A>"),
@@ -379,7 +379,7 @@ int watch_notification(Client *client, Watch *watch, Link *lp, int reply)
(IsHidden(client) ? client->user->virthost : client->
user->realhost) : "<N/A>"), 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 : "<N/A>"),
(IsUser(client) ?