Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: hs_autohost  (Read 4003 times)

0 Members and 1 Guest are viewing this topic.

Slutwig

  • Anope User
  • Offline Offline
  • Posts: 19
hs_autohost
« on: April 05, 2007, 07:27:18 PM »

Code: [Select]


// This is the host that will be set after the user's display name.
// Default entry will set hosts to [groupowner].users.elitistfaction.net
#define NETHOST "user.Univers.org"
// This is the message that will be sent to clients upon setting the vhost.
// Comment this line out to run silently.
#define MESSAGE "Your vhost has automatically been set to %s.%s"

int do_setUserHost(User * u);

int AnopeInit(int argc, char **argv)
{
    Command *c;
    c = createCommand("IDENTIFY", do_setUserHost, NULL, -1, -1, -1, -1,-1);
    moduleAddCommand(NICKSERV, c, MOD_TAIL);
    c = createCommand("REGISTER", do_setUserHost, NULL, -1, -1, -1, -1,-1);
    moduleAddCommand(NICKSERV, c, MOD_TAIL);
    c = createCommand("GROUP", do_setUserHost, NULL, -1, -1, -1, -1, -1);
    moduleAddCommand(NICKSERV, c, MOD_TAIL);
c = createCommand("ID", do_setUserHost, NULL, -1, -1, -1, -1, -1);
    moduleAddCommand(NICKSERV, c, MOD_TAIL);
    moduleAddAuthor(AUTHOR);

    moduleAddVersion(VERSION);
    alog("hs_autohost.c v%s by %s loaded", VERSION, AUTHOR);
    return MOD_CONT;
}

int do_setUserHost(User * u)
{
    NickAlias *na;

    char *vHost;
    char *vIdent;

    if (!(na = u->na)) {
        return MOD_CONT;
    }

    vHost = getvHost(u->nick);
    vIdent = getvIdent(u->nick);

    if ((na->status & NS_IDENTIFIED)) {
        if (!vHost) {
//SolidIRCd support added by BarkerJr
#ifdef IRC_SOLID
send_cmd(s_HostServ, "SVSMODE %s +v", u->nick);
send_cmd(ServerName, "SVHOST %s %s.%s", u->nick,
na->nc->display, NETHOST);
#else
            send_cmd(s_HostServ, "CHGHOST %s %s.%s", u->nick,
                     na->nc->display, NETHOST);
#endif
#ifdef MESSAGE
notice(s_HostServ, u->nick, MESSAGE, na->nc->display, NETHOST);
#endif
            return MOD_CONT;
        }
    }

    return MOD_CONT;
}



Basicly this the code for this module.

It's working fine, but if a user get some strange stuff on his nick, like ï / ^ or other. It won't work.

I'm looking to pu a filter for all thoses letter, for exemple to replace ï by i.

Thanks.
Logged

katsklaw

  • Guest
(No subject)
« Reply #1 on: April 05, 2007, 08:51:49 PM »

it would be more beneficial to fix the module instead of breaking the module/core to deny the usage of RFC compliant character sets.
Logged

Slutwig

  • Anope User
  • Offline Offline
  • Posts: 19
(No subject)
« Reply #2 on: April 05, 2007, 09:04:57 PM »

Quote
Originally posted by katsklaw
it would be more beneficial to fix the module instead of breaking the module/core to deny the usage of RFC compliant character sets.


Well, 'im looking ot fix the module one way or another, but don't really know how to do it ;(

[Edited on 5-4-2007 by Slutwig]
Logged
Pages: [1]   Go Up