[IRCServices] Some help on cooding

root of all evil climber at rionet.com.br
Thu Nov 11 10:47:30 PST 1999


Hi guys

 i dontknow if this is oftopyc, but the nickserv release and ghost seems a
quiteanoying to me, you have to use 3 comands to getyour nick back
/m nickserv release (nick) (pass)
/nick nick
/mnickserv identify (pass)

so, i tried todo things easyerwhitthis code :
static void do_release(User *u)
{
    char *nick = strtok(NULL, " ");
    char *pass = strtok(NULL, " ");    
    NickInfo *ni;
    

    if (!nick) {
	syntax_error(s_NickServ, u, "RELEASE", NICK_RELEASE_SYNTAX);
    } else if (!(ni = findnick(nick))) {
	notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
    } else if (!(ni->status & NS_KILL_HELD)) {
	notice_lang(s_NickServ, u, NICK_RELEASE_NOT_HELD, nick);
    } else if (pass) {
	int res = check_password(pass, ni->pass);
	if (res == 1) {	  
	    release(ni, 0);
	    notice_lang(s_NickServ, u, NICK_RELEASED);
	    send_cmd(s_NickServ, "SVSNICK %s %s :%lu", u->nick, nick,
		time(NULL));
 	    change_user_nick(u, nick); /* placede on Extern.h this function is
                                                        * from users.c */
	    /* indentify */
            ni->status |= NS_IDENTIFIED;
            ni->id_timestamp = u->signon;
            ni->last_seen = time(NULL);
            if (ni->last_usermask)
              free(ni->last_usermask);
            ni->last_usermask = smalloc(strlen(u->username)+strlen(u->host)+2);
            sprintf(ni->last_usermask, "%s@%s", u->username, u->host);
            if (ni->last_realname)
                free(ni->last_realname);
            ni->last_realname = sstrdup(u->realname);	    
	    send_cmd(s_NickServ,"SVSMODE %s :+r", u->nick);
            u->mode |= UMODE_R;            
            notice(s_NickServ, nick, "Password accepted - you are now recognized");
	log("%s: %s!%s@%s identified on RELEASE for nick %s", s_NickServ, u->nick, u->username, u->host, nick);
	check_memos(u);
             } else {
             notice_lang(s_NickServ, u, ACCESS_DENIED);               
	    if (res == 0) {
		log("%s: RELEASE: invalid password for %s by %s!%s@%s",
			s_NickServ, nick, u->nick, u->username, u->host);
		bad_password(u);
	    }
	}
    } 
}

/*end*/

Well, the problem is : this orks well on my testnet, (only onde ircd and
services ) on main network,  the SVSNICK may take a litle  time, so the SVSMODE
and the notice dont ket sent to the righ user (ircd returns User not found),
but the new nick is identifyed , only the +r flag and notice to user dont works)

Anyone knows a beter way to do this ? 
      
Realy sory for my english, and a keyboard whith broken space bar ( no joke :))
FiGhTER
Irc.rionet.com.br
BrasIRC.com.br (irc.brasirc.com.br)
 
---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.