[IRCServices Coding] 5.1 Suggestion: Aliases.
Craig McLure
Craig at frostycoolslug.com
Sun Jan 22 03:40:42 PST 2006
I understand that it could be done as a module, and it was in
consideration when i added it in, but in all fairness, it was a choice
between coding, testing, debugging, etc of a module, vs. a one liner
into the nickserv command table. Time was an issue as well, which was
why i made the core choice.
Glad you're thinking about it though :)
Andrew Church wrote:
>> On chatspike, i've modified a few files for 'convieniance' purposes,
>> adding things like id -> handle_identify and what not, what would be
>> nice, if it were possible to configure some of these in the
>> configuration file, rather than having to modifying the core :)
>
> You could just make a module with something like
>
> extern char *s_NickServ;
> int do_privmsg(const char *source, const char *target, char *buf)
> {
> if (irc_stricmp(target, s_NickServ) == 0
> && stricmp(buf, "ID", 2)
> && isspace(buf[2]
> ) {
> memmove(buf+8, buf+2, strlen(buf+8));
> memcpy(buf, "IDENTIFY", 8);
> }
> return 0;
> }
> int init_module()
> {
> // ...
> add_callback_pri(NULL, "m_privmsg", do_privmsg, CBPRI_MAX); // called first
> // ...
> }
>
> which is rather kludgey in that it relies on `buf' being writeable and
> having room for 6 more bytes (which should always be true), but it doesn't
> require modifying the core. I'll think about a more general solution,
> though.
>
> --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-coding
>
>