X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmessage.cpp;h=6d5941f7e7ea5042eaa1d795e593b552c3c2d0cd;hb=eb28eaea35d9d109a0b7b890de9d957d562da675;hp=e69ce94ab0f4ff37bd1f0953acab10deef40b247;hpb=0f61489ddb2f54d62c6a59e169901e4a17098230;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/message.cpp b/src/message.cpp index e69ce94ab..6d5941f7e 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -46,44 +46,7 @@ extern int MODCOUNT; extern std::vector modules; extern std::vector factory; extern time_t TIME; -extern ServerConfig* Config; - -int c_count(userrec* u) -{ - int z = 0; - for (std::vector::const_iterator i = u->chans.begin(); i != u->chans.end(); i++) - if ((*i)->channel) - z++; - return z; - -} - -void ChangeName(userrec* user, const char* gecos) -{ - if (user->fd > -1) - { - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnChangeLocalUserGECOS,OnChangeLocalUserGECOS(user,gecos)); - if (MOD_RESULT) - return; - FOREACH_MOD(I_OnChangeName,OnChangeName(user,gecos)); - } - strlcpy(user->fullname,gecos,MAXGECOS+1); -} - -void ChangeDisplayedHost(userrec* user, const char* host) -{ - if (user->fd > -1) - { - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnChangeLocalUserHost,OnChangeLocalUserHost(user,host)); - if (MOD_RESULT) - return; - FOREACH_MOD(I_OnChangeHost,OnChangeHost(user,host)); - } - strlcpy(user->dhost,host,63); - user->WriteServ("396 %s %s :is now your hidden host",user->nick,user->dhost); -} +extern InspIRCd* ServerInstance; /* verify that a user's ident and nickname is valid */ @@ -220,28 +183,3 @@ int cstatus(userrec *user, chanrec *chan) return STATUS_NORMAL; } -std::string chlist(userrec *user,userrec* source) -{ - std::string list; - - if (!user || !source) - return ""; - - for (std::vector::const_iterator i = user->chans.begin(); i != user->chans.end(); i++) - { - ucrec* rec = *i; - - if(rec->channel && rec->channel->name) - { - /* If the target is the same as the sender, let them see all their channels. - * If the channel is NOT private/secret OR the user shares a common channel - * If the user is an oper, and the option is set. - */ - if ((source == user) || (*source->oper && Config->OperSpyWhois) || (((!rec->channel->modes[CM_PRIVATE]) && (!rec->channel->modes[CM_SECRET])) || (rec->channel->HasUser(source)))) - { - list.append(cmode(user, rec->channel)).append(rec->channel->name).append(" "); - } - } - } - return list; -}