ns_update.c

Go to the documentation of this file.
00001 /* NickServ core functions
00002  *
00003  * (C) 2003-2007 Anope Team
00004  * Contact us at info@anope.org
00005  *
00006  * Please read COPYING and README for further details.
00007  *
00008  * Based on the original code of Epona by Lara.
00009  * Based on the original code of Services by Andy Church. 
00010  * 
00011  * $Id: ns_update.c 1265 2007-08-26 15:33:06Z geniusdex $
00012  *
00013  */
00014 /*************************************************************************/
00015 
00016 #include "module.h"
00017 
00018 int do_nickupdate(User * u);
00019 void myNickServHelp(User * u);
00020 
00027 int AnopeInit(int argc, char **argv)
00028 {
00029     Command *c;
00030 
00031     moduleAddAuthor("Anope");
00032     moduleAddVersion("$Id: ns_update.c 1265 2007-08-26 15:33:06Z geniusdex $");
00033     moduleSetType(CORE);
00034 
00035     c = createCommand("UPDATE", do_nickupdate, NULL, NICK_HELP_UPDATE, -1,
00036                       -1, -1, -1);
00037     moduleAddCommand(NICKSERV, c, MOD_UNIQUE);
00038 
00039     moduleSetNickHelp(myNickServHelp);
00040 
00041     return MOD_CONT;
00042 }
00043 
00047 void AnopeFini(void)
00048 {
00049 
00050 }
00051 
00052 
00053 
00058 void myNickServHelp(User * u)
00059 {
00060     notice_lang(s_NickServ, u, NICK_HELP_CMD_UPDATE);
00061 }
00062 
00068 int do_nickupdate(User * u)
00069 {
00070     NickAlias *na;
00071 
00072     if (!nick_identified(u)) {
00073         notice_lang(s_NickServ, u, NICK_IDENTIFY_REQUIRED, s_NickServ);
00074     } else {
00075         na = u->na;
00076         if (NSModeOnID)
00077             do_setmodes(u);
00078         check_memos(u);
00079         if (na->last_realname)
00080             free(na->last_realname);
00081         na->last_realname = sstrdup(u->realname);
00082         na->status |= NS_IDENTIFIED;
00083         na->last_seen = time(NULL);
00084         if (ircd->vhost) {
00085             do_on_id(u);
00086         }
00087         notice_lang(s_NickServ, u, NICK_UPDATE_SUCCESS, s_NickServ);
00088     }
00089     return MOD_CONT;
00090 }

Generated on Sun Dec 30 09:26:48 2007 for Anope by  doxygen 1.5.1-20070107