]> jfr.im git - solanum.git/blobdiff - extensions/chm_sslonly_compat.c
Rework channel mode handling
[solanum.git] / extensions / chm_sslonly_compat.c
index 9ee1ca251ce6d09a33665bf30a5d840ac96426d5..3dca2834e9d98bdd4b57e681080d2e2c77f0c913 100644 (file)
@@ -15,39 +15,31 @@ static const char chm_sslonly_compat_desc[] =
 static int _modinit(void);
 static void _moddeinit(void);
 static void chm_sslonly(struct Client *source_p, struct Channel *chptr,
-       int alevel, int parc, int *parn,
-       const char **parv, int *errors, int dir, char c, long mode_type);
+       int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
 
 DECLARE_MODULE_AV2(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_sslonly_compat_desc);
 
 static int
 _modinit(void)
 {
-       chmode_table['S'].set_func = chm_sslonly;
-       chmode_table['S'].mode_type = 0;
-
+       chmode_table['S'] = (struct ChannelMode){ chm_sslonly, 0, 0 };
        return 0;
 }
 
 static void
 _moddeinit(void)
 {
-       chmode_table['S'].set_func = chm_nosuch;
-       chmode_table['S'].mode_type = 0;
+       chmode_table['S'] = (struct ChannelMode){ chm_nosuch, 0, 0 };
 }
 
 static void
 chm_sslonly(struct Client *source_p, struct Channel *chptr,
-       int alevel, int parc, int *parn,
-       const char **parv, int *errors, int dir, char c, long mode_type)
+       int alevel, const char *arg, int *errors, int dir, char c, long mode_type)
 {
-       int newparn = 0;
-       const char *newparv[] = { "$~z" };
-
        if (MyClient(source_p))
-               chm_ban(source_p, chptr, alevel, 1, &newparn, newparv,
+               chm_ban(source_p, chptr, alevel, "$~z",
                                errors, dir, 'b', CHFL_BAN);
        else
-               chm_nosuch(source_p, chptr, alevel, parc, parn, parv,
+               chm_nosuch(source_p, chptr, alevel, NULL,
                                errors, dir, c, mode_type);
 }