Anope IRC Services

Anope Development => Modules => Topic started by: katsklaw on September 01, 2007, 12:51:02 AM

Title: cs_join
Post by: katsklaw on September 01, 2007, 12:51:02 AM
This looks like a fine module for those interested in such features, however I think some of the code can be cleaned up.

Currently, n00bie, you check for each ircd that has +q/a and sets +ao and +o on all other ircds.

I think it might be easier and more dynamic to check for ircd->admin and if it returns 1 then set ircd->adminset

for example:


if (ircd->admin == 1) {
        anope_cmd_mode(s_ChanServ, av[0], "+%so %s %s", ircd->adminset, s_ChanServ, s_ChanServ);
} else{
        anope_cmd_mode(s_ChanServ, av[0], "+o %s", s_ChanServ);
}


This will also allow for additions of owner/admin supported IRCds as well as which character they use for admin without changing your source code at all.

If coded correctly it would replace all of this:


if (!stricmp(IRCDModule, "inspircd") ||
      !stricmp(IRCDModule, "plexus") ||
      !stricmp(IRCDModule, "ptlink") ||
      !stricmp(IRCDModule, "inspircd") ||
      !stricmp(IRCDModule, "ultimate2") ||
      !stricmp(IRCDModule, "unreal32") ||
      !stricmp(IRCDModule, "viagra")) {
         anope_cmd_mode(s_ChanServ, av[0], "+ao %s %s", s_ChanServ, s_ChanServ);
   } else {
      anope_cmd_mode(s_ChanServ, av[0], "+o %s", s_ChanServ);
   }


I also think you should allow Services Admins to use this command as well.

[Edited on 31-8-2007 by katsklaw]
Title:
Post by: n00bie on September 10, 2007, 07:53:05 AM
Sorry for seeing this thread lately katsklaw. I've updated the module and here are a few changes ^^

• Cleaned up minor codes
• Added check for EVENT_PART_CHANNEL to prevent from an invite bug. ChanServ will now PART the channel if there are less than BSMinUsers on the channel.
• Added and will now respect BSMinUsers directives from services.conf. ChanServ will NOT join if there are less than 'BSMinUsers' on the channel.
• Added command support for Services Admin
Title:
Post by: katsklaw on September 10, 2007, 12:56:59 PM
nothing to be sorry for, it's your module, you have every right to not reply at all if you wanted. :)