[IRCServices Coding] Chanserv patch for reg chans only

Andrew Church achurch at achurch.org
Thu Mar 13 13:09:56 PST 2003

     Thanks for the suggestion.  I generally try to avoid adding features
into a stable branch, but I'll consider it.

>The other question I had was if I should depend on the result from
>get_channelinfo() or get_channel() to determine if a channel is
>registered.  I found the code for get_channelinfo() in tools/convert-db.c,
>and it seems to be a good bet for this, but I can't find the code for
>get_channel() anywhere.  The text shows up in channels.o, but I can't
>find the code in channels.c.  I feel a bit silly about this - I always
>thought I was fairly good at C.

     Both get_channel() and get_channelinfo() are defined by macros in
hash.h (the get_channelinfo() in convert-db.c is designed for the
convert-db tool and is not included in the main program).  get_channel()
looks up channels on the network, while get_channelinfo() looks them up in
the Services database, so you'll want to use the latter.

>This is a fairly unusual situation, but it might be more consistant if
>the ban wasn't set.  However, does this open services up for a DOS from
>a user repeatedly trying to join and getting kicked by chanserv?

     Unlikely, since the ircd would probably drop them for flooding before
Services took any serious performance hit.

  --Andrew Church
    achurch at achurch.org