[IRCServices] 5.1 InspIRCd protocol

Robin Burchell surreal.w00t at gmail.com
Mon Sep 10 05:52:29 PDT 2007


Hm.

Are you sure on the omission of the +? While not too significant for
us (our parser assumes addition as the first state), it would be a bug
of sorts.

On 9/10/07, Andrew Church <achurch at achurch.org> wrote:
> >Our MODE command does not take a timestamp parameter.
> >
> >FMODE does, but will reject any timestamp of 0.
> >
> >(basically, use MODE, but with no timestamp)
>
> Hm.  Not sure why it worked for me anyway, but try the following patch:
>
> Index: modules/protocol/inspircd.c
> ===================================================================
> RCS file: /var/local/cvsroot/ircservices/modules/protocol/inspircd.c,v
> retrieving revision 2.9
> diff -u -r2.9 inspircd.c
> --- modules/protocol/inspircd.c 3 Sep 2007 11:26:34 -0000       2.9
> +++ modules/protocol/inspircd.c 10 Sep 2007 12:48:07 -0000
> @@ -332,8 +332,16 @@
>              User *u = get_user(av[2]);
>              if (c && u)
>                  clear_channel(c, CLEAR_BANS, u);
> -        } else {
> -            do_cmode(source, ac, av);
> +        } else if (ac >= 3) {
> +            char modestr[BUFSIZE];
> +            av[1] = av[0];  /* Remove the timestamp parameter */
> +            if (av[2][0] != '+' && av[2][0] != '-') {
> +                /* InspIRCd seems to omit the leading '+' when sending
> +                 * initial modes for the channel */
> +                snprintf(modestr, sizeof(modestr), "+%s", av[2]);
> +                av[2] = modestr;
> +            }
> +            do_cmode(source, ac-1, av+1);
>          }
>      } else {
>          if (ac < 2)
> @@ -1030,7 +1038,7 @@
>  {
>      protocol_name     = "InspIRCd";
>      protocol_version  = "1.1+";
> -    protocol_features = PF_SZLINE | PF_SVSJOIN | PF_MODETS_FIRST;
> +    protocol_features = PF_SZLINE | PF_SVSJOIN;
>      protocol_nickmax  = 30;
>
>      if (!register_messages(inspircd_messages)) {
>
>   --Andrew Church
>     achurch at achurch.org
>     http://achurch.org/
> ------------------------------------------------------------------
> To unsubscribe or change your subscription options, visit:
> http://lists.ircservices.za.net/mailman/listinfo/ircservices
>