Skip to content

Commit

Permalink
third/restrict-chans: don't restrict if services are down (PR #118 fr…
Browse files Browse the repository at this point in the history
…om ValwareIRC/patch-48)

restrict-chans: Don't restrict if users are unable to authenticate anyway
  • Loading branch information
syzop authored Jul 18, 2024
2 parents e3b2107 + 600974f commit cca3f93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion files/restrict-chans.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int isreg_check_join(Client *client, Channel *channel, const char *key, char **e
ModuleHeader MOD_HEADER =
{
"third/restrict-chans",
"1.2",
"1.3",
"Restrict channel creation to logged-in users",
"Valware",
"unrealircd-6",
Expand Down Expand Up @@ -58,6 +58,10 @@ MOD_TEST()

int isreg_check_join(Client *client, Channel *channel, const char *key, char **errmsg)
{
Client *serv_server;
if (!(serv_server = find_server(SASL_SERVER, NULL)) || !(serv_server = find_server(SERVICES_NAME, NULL)))
return HOOK_CONTINUE;

if (has_channel_mode(channel, 'P')) // it's permanent, continue;
return HOOK_CONTINUE;
if (channel->users == 0)
Expand All @@ -74,6 +78,10 @@ int isreg_check_join(Client *client, Channel *channel, const char *key, char **e

int isreg_can_join(Client *client, Channel *channel, const char *key)
{
Client *serv_server;
if (!(serv_server = find_server(SASL_SERVER, NULL)) || !(serv_server = find_server(SERVICES_NAME, NULL)))
return HOOK_CONTINUE;

if (has_channel_mode(channel, 'P')) // it's permanent, continue;
return HOOK_CONTINUE;
/* allow people to join permanent empty channels and allow opers to create new channels */
Expand Down

0 comments on commit cca3f93

Please sign in to comment.