X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules.cpp;h=f5129c83724389877f26ce08bb6cf0133fa9b262;hb=6b43da7511ca875b64e58b84f72dd89485c0e7fd;hp=6f1236f605a00765d1d18898b39aa9dd64b0c5c3;hpb=c2906e93be35abeea3e652273a7ff1928db8aae3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules.cpp b/src/modules.cpp index 6f1236f60..f5129c837 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -414,6 +414,11 @@ chanrec* Server::GetChannelIndex(long index) return NULL; } +void Server::AddTimer(InspTimer* T) +{ + ::AddTimer(T); +} + void Server::SendOpers(std::string s) { WriteOpers("%s",s.c_str()); @@ -446,12 +451,9 @@ chanuserlist Server::GetUsers(chanrec* chan) { chanuserlist userl; userl.clear(); - std::map *list = chan->GetUsers(); - for (std::map::iterator i = list->begin(); i != list->end(); i++) - { - char* o = i->second; - userl.push_back((userrec*)o); - } + CUList *list = chan->GetUsers(); + for (CUList::iterator i = list->begin(); i != list->end(); i++) + userl.push_back(i->second); return userl; } void Server::ChangeUserNick(userrec* user, std::string nickname) @@ -481,9 +483,9 @@ bool Server::IsUlined(std::string server) return is_uline(server.c_str()); } -void Server::CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user) +bool Server::CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user) { - ServerInstance->Parser->CallHandler(commandname,parameters,pcnt,user); + return ServerInstance->Parser->CallHandler(commandname,parameters,pcnt,user); } bool Server::IsValidModuleCommand(std::string commandname, int pcnt, userrec* user) @@ -530,7 +532,7 @@ void Server::SendTo(userrec* Source, userrec* Dest, std::string s) if (!Source) { // if source is NULL, then the message originates from the local server - Write(Dest->fd,":%s %s",this->GetServerName().c_str(),s.c_str()); + WriteServ_NoFormat(Dest->fd,s.c_str()); } else { @@ -561,6 +563,22 @@ bool Server::CommonChannels(userrec* u1, userrec* u2) return (common_channels(u1,u2) != 0); } +void Server::DumpText(userrec* User, std::string LinePrefix, stringstream &TextStream) +{ + std::string CompleteLine = LinePrefix; + std::string Word = ""; + while (TextStream >> Word) + { + if (CompleteLine.length() + Word.length() + 3 > 500) + { + WriteServ_NoFormat(User->fd,CompleteLine.c_str()); + CompleteLine = LinePrefix; + } + CompleteLine = CompleteLine + Word + " "; + } + WriteServ_NoFormat(User->fd,CompleteLine.c_str()); +} + void Server::SendCommon(userrec* User, std::string text,bool IncludeSender) { if (IncludeSender) @@ -613,11 +631,6 @@ std::string Server::ChanMode(userrec* User, chanrec* Chan) return cmode(User,Chan); } -bool Server::IsOnChannel(userrec* User, chanrec* Chan) -{ - return has_channel(User,Chan); -} - std::string Server::GetServerName() { return Config->ServerName;