chanrec* Server::GetChannelIndex(long index)
{
+ int target = 0;
for (chan_hash::iterator n = chanlist.begin(); n != chanlist.end(); n++, target++)
{
if (index == target)
return NULL;
}
+void Server::AddTimer(InspTimer* T)
+{
+ ::AddTimer(T);
+}
+
void Server::SendOpers(std::string s)
{
WriteOpers("%s",s.c_str());
{
chanuserlist userl;
userl.clear();
- std::map<char*,char*> *list = chan->GetUsers();
- for (std::map<char*,char*>::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)
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)
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
{
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)
return cmode(User,Chan);
}
-bool Server::IsOnChannel(userrec* User, chanrec* Chan)
-{
- return has_channel(User,Chan);
-}
-
std::string Server::GetServerName()
{
return Config->ServerName;