diff options
Diffstat (limited to 'src/modules')
21 files changed, 66 insertions, 66 deletions
diff --git a/src/modules/m_spanningtree/kill.cpp b/src/modules/m_spanningtree/kill.cpp index ca68867e6..3fca0a0cb 100644 --- a/src/modules/m_spanningtree/kill.cpp +++ b/src/modules/m_spanningtree/kill.cpp @@ -42,7 +42,7 @@ bool TreeSocket::RemoteKill(const std::string &prefix, std::deque<std::string> & Utils->DoOneToAllButSender(prefix,"KILL",params,prefix); // NOTE: This is safe with kill hiding on, as RemoteKill is only reached if we have a server prefix. // in short this is not executed for USERS. - who->Write(":%s KILL %s :%s (%s)", prefix.c_str(), who->nick, prefix.c_str(), reason.c_str()); + who->Write(":%s KILL %s :%s (%s)", prefix.c_str(), who->nick.c_str(), prefix.c_str(), reason.c_str()); this->Instance->Users->QuitUser(who, reason); } return true; diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 4a401b8c8..585af8fe4 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -77,7 +77,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) { if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str())))) { - if (*user->oper) + if (IS_OPER(user)) { ShowLinks(Current->GetChild(q),user,hops+1); } @@ -94,7 +94,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops) else if ((Current->Hidden) && (!IS_OPER(user))) return; - user->WriteNumeric(364, "%s %s %s :%d %s", user->nick,Current->GetName().c_str(), + user->WriteNumeric(364, "%s %s %s :%d %s", user->nick.c_str(),Current->GetName().c_str(), (Utils->FlatLinks && (!IS_OPER(user))) ? ServerInstance->Config->ServerName : Parent.c_str(), (Utils->FlatLinks && (!IS_OPER(user))) ? 0 : hops, Current->GetDesc().c_str()); @@ -113,7 +113,7 @@ int ModuleSpanningTree::CountServs() void ModuleSpanningTree::HandleLinks(const std::vector<std::string>& parameters, User* user) { ShowLinks(Utils->TreeRoot,user,0); - user->WriteNumeric(365, "%s * :End of /LINKS list.",user->nick); + user->WriteNumeric(365, "%s * :End of /LINKS list.",user->nick.c_str()); return; } @@ -133,7 +133,7 @@ void ModuleSpanningTree::HandleLusers(const std::vector<std::string>& parameters /* If ulined are hidden and we're not an oper, count the number of ulined servers hidden, * locally and globally (locally means directly connected to us) */ - if ((Utils->HideULines) && (!*user->oper)) + if ((Utils->HideULines) && (!IS_OPER(user))) { for (server_hash::iterator q = Utils->serverlist.begin(); q != Utils->serverlist.end(); q++) { @@ -145,23 +145,23 @@ void ModuleSpanningTree::HandleLusers(const std::vector<std::string>& parameters } } } - user->WriteNumeric(251, "%s :There are %d users and %d invisible on %d servers",user->nick, + user->WriteNumeric(251, "%s :There are %d users and %d invisible on %d servers",user->nick.c_str(), n_users-ServerInstance->Users->ModeCount('i'), ServerInstance->Users->ModeCount('i'), ulined_count ? this->CountServs() - ulined_count : this->CountServs()); if (ServerInstance->Users->OperCount()) - user->WriteNumeric(252, "%s %d :operator(s) online",user->nick,ServerInstance->Users->OperCount()); + user->WriteNumeric(252, "%s %d :operator(s) online",user->nick.c_str(),ServerInstance->Users->OperCount()); if (ServerInstance->Users->UnregisteredUserCount()) - user->WriteNumeric(253, "%s %d :unknown connections",user->nick,ServerInstance->Users->UnregisteredUserCount()); + user->WriteNumeric(253, "%s %d :unknown connections",user->nick.c_str(),ServerInstance->Users->UnregisteredUserCount()); if (ServerInstance->ChannelCount()) - user->WriteNumeric(254, "%s %ld :channels formed",user->nick,ServerInstance->ChannelCount()); + user->WriteNumeric(254, "%s %ld :channels formed",user->nick.c_str(),ServerInstance->ChannelCount()); - user->WriteNumeric(255, "%s :I have %d clients and %d servers",user->nick,ServerInstance->Users->LocalUserCount(),ulined_local_count ? this->CountLocalServs() - ulined_local_count : this->CountLocalServs()); - user->WriteNumeric(265, "%s :Current Local Users: %d Max: %d",user->nick,ServerInstance->Users->LocalUserCount(),max_local); - user->WriteNumeric(266, "%s :Current Global Users: %d Max: %d",user->nick,n_users,max_global); + user->WriteNumeric(255, "%s :I have %d clients and %d servers",user->nick.c_str(),ServerInstance->Users->LocalUserCount(),ulined_local_count ? this->CountLocalServs() - ulined_local_count : this->CountLocalServs()); + user->WriteNumeric(265, "%s :Current Local Users: %d Max: %d",user->nick.c_str(),ServerInstance->Users->LocalUserCount(),max_local); + user->WriteNumeric(266, "%s :Current Global Users: %d Max: %d",user->nick.c_str(),n_users,max_global); return; } @@ -344,7 +344,7 @@ int ModuleSpanningTree::HandleVersion(const std::vector<std::string>& parameters if (found) { std::string Version = found->GetVersion(); - user->WriteNumeric(351, "%s :%s",user->nick,Version.c_str()); + user->WriteNumeric(351, "%s :%s",user->nick.c_str(),Version.c_str()); if (found == Utils->TreeRoot) { ServerInstance->Config->Send005(user); @@ -352,7 +352,7 @@ int ModuleSpanningTree::HandleVersion(const std::vector<std::string>& parameters } else { - user->WriteNumeric(402, "%s %s :No such server",user->nick,parameters[0].c_str()); + user->WriteNumeric(402, "%s %s :No such server",user->nick.c_str(),parameters[0].c_str()); } return 1; } @@ -390,7 +390,7 @@ void ModuleSpanningTree::RemoteMessage(User* user, const char* format, ...) else { if (IS_LOCAL(user)) - user->WriteServ("NOTICE %s :%s", user->nick, text); + user->WriteServ("NOTICE %s :%s", user->nick.c_str(), text); else ServerInstance->PI->SendUserNotice(user, text); } @@ -680,7 +680,7 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick) /** IMPORTANT: We don't update the TS if the oldnick is just a case change of the newnick! */ - if (irc::string(user->nick) != assign(oldnick)) + if (irc::string(user->nick.c_str()) != assign(oldnick)) user->age = ServerInstance->Time(); params.push_back(ConvToStr(user->age)); diff --git a/src/modules/m_spanningtree/modules.cpp b/src/modules/m_spanningtree/modules.cpp index 7a3c4717e..17321c5fd 100644 --- a/src/modules/m_spanningtree/modules.cpp +++ b/src/modules/m_spanningtree/modules.cpp @@ -62,19 +62,19 @@ bool TreeSocket::Modules(const std::string &prefix, std::deque<std::string> &par if (!flagstate[0]) strcpy(flagstate," <no flags>"); strlcpy(modulename,module_names[i].c_str(),256); - if (*source->oper) + if (IS_OPER(source)) { - snprintf(strbuf, MAXBUF, "::%s 702 %s :0x%08lx %d.%d.%d.%d %s (%s)",Instance->Config->ServerName,source->nick,(unsigned long)m, + snprintf(strbuf, MAXBUF, "::%s 702 %s :0x%08lx %d.%d.%d.%d %s (%s)",Instance->Config->ServerName,source->nick.c_str(),(unsigned long)m, V.Major,V.Minor,V.Revision,V.Build,ServerConfig::CleanFilename(modulename),flagstate+2); } else { - snprintf(strbuf, MAXBUF, "::%s 702 %s :%s",Instance->Config->ServerName,source->nick,ServerConfig::CleanFilename(modulename)); + snprintf(strbuf, MAXBUF, "::%s 702 %s :%s",Instance->Config->ServerName,source->nick.c_str(),ServerConfig::CleanFilename(modulename)); } par[1] = strbuf; Utils->DoOneToOne(Instance->Config->GetSID(), "PUSH", par, source->server); } - snprintf(strbuf, MAXBUF, "::%s 703 %s :End of MODULES list", Instance->Config->ServerName, source->nick); + snprintf(strbuf, MAXBUF, "::%s 703 %s :End of MODULES list", Instance->Config->ServerName, source->nick.c_str()); par[1] = strbuf; Utils->DoOneToOne(Instance->Config->GetSID(), "PUSH", par, source->server); return true; diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index c61211ff9..b1f63c01b 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -97,7 +97,7 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c) for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++) { // The first parameter gets a : before it - size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s,%s", !numusers ? ":" : "", this->Instance->Modes->ModeString(i->first, c, false).c_str(), i->first->uuid); + size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s,%s", !numusers ? ":" : "", this->Instance->Modes->ModeString(i->first, c, false).c_str(), i->first->uuid.c_str()); looped_once = true; @@ -221,19 +221,19 @@ void TreeSocket::SendUsers(TreeServer* Current) TreeServer* theirserver = Utils->FindServer(u->second->server); if (theirserver) { - snprintf(data,MAXBUF,":%s UID %s %lu %s %s %s %s +%s %s %lu :%s", theirserver->GetID().c_str(), u->second->uuid, - (unsigned long)u->second->age, u->second->nick, u->second->host, u->second->dhost, - u->second->ident, u->second->FormatModes(), u->second->GetIPString(), - (unsigned long)u->second->signon, u->second->fullname); + snprintf(data,MAXBUF,":%s UID %s %lu %s %s %s %s +%s %s %lu :%s", theirserver->GetID().c_str(), u->second->uuid.c_str(), + (unsigned long)u->second->age, u->second->nick.c_str(), u->second->host, u->second->dhost.c_str(), + u->second->ident.c_str(), u->second->FormatModes(), u->second->GetIPString(), + (unsigned long)u->second->signon, u->second->fullname.c_str()); this->WriteLine(data); if (IS_OPER(u->second)) { - snprintf(data,MAXBUF,":%s OPERTYPE %s", u->second->uuid, u->second->oper); + snprintf(data,MAXBUF,":%s OPERTYPE %s", u->second->uuid.c_str(), u->second->oper.c_str()); this->WriteLine(data); } if (IS_AWAY(u->second)) { - snprintf(data,MAXBUF,":%s AWAY :%s", u->second->uuid, u->second->awaymsg); + snprintf(data,MAXBUF,":%s AWAY :%s", u->second->uuid.c_str(), u->second->awaymsg.c_str()); this->WriteLine(data); } } diff --git a/src/modules/m_spanningtree/nickcollide.cpp b/src/modules/m_spanningtree/nickcollide.cpp index 5dcfcd615..d2adbc766 100644 --- a/src/modules/m_spanningtree/nickcollide.cpp +++ b/src/modules/m_spanningtree/nickcollide.cpp @@ -51,7 +51,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, c /* for brevity, don't use the User */ time_t localts = u->age; - const char *localident = u->ident; + const char *localident = u->ident.c_str(); const char *localip = u->GetIPString(); /* mmk. let's do this again. */ @@ -87,7 +87,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, c if (bChangeLocal) { - u->ForceNickChange(u->uuid); + u->ForceNickChange(u->uuid.c_str()); if (!bChangeRemote) return 1; @@ -110,7 +110,7 @@ int TreeSocket::DoCollision(User *u, time_t remotets, const char *remoteident, c if (remote) { /* buh.. nick change collide. force change their nick. */ - remote->ForceNickChange(remote->uuid); + remote->ForceNickChange(remote->uuid.c_str()); } else { diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp index 7afa44ae1..a5bd07416 100644 --- a/src/modules/m_spanningtree/opertype.cpp +++ b/src/modules/m_spanningtree/opertype.cpp @@ -35,7 +35,7 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa if (!u->IsModeSet('o')) this->Instance->Users->all_opers.push_back(u); u->modes[UM_OPERATOR] = 1; - strlcpy(u->oper,opertype.c_str(),NICKMAX-1); + u->oper.assign(opertype, 0, NICKMAX - 1); Utils->DoOneToAllButSender(u->uuid,"OPERTYPE",params,u->server); TreeServer* remoteserver = Utils->FindServer(u->server); @@ -57,7 +57,7 @@ bool TreeSocket::OperType(const std::string &prefix, std::deque<std::string> &pa } if (dosend) - this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick,u->ident,u->host,irc::Spacify(opertype.c_str())); + this->Instance->SNO->WriteToSnoMask('o',"From %s: User %s (%s@%s) is now an IRC operator of type %s",u->server, u->nick.c_str(),u->ident.c_str(),u->host,irc::Spacify(opertype.c_str())); } return true; } diff --git a/src/modules/m_spanningtree/override_admin.cpp b/src/modules/m_spanningtree/override_admin.cpp index 31d146eda..2122a3a24 100644 --- a/src/modules/m_spanningtree/override_admin.cpp +++ b/src/modules/m_spanningtree/override_admin.cpp @@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleAdmin(const std::vector<std::string>& parameters, Utils->DoOneToOne(user->uuid, "ADMIN", params, s->GetName()); } else - user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str()); + user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str()); return 1; } return 0; diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp index fa93f8280..01423b60a 100644 --- a/src/modules/m_spanningtree/override_map.cpp +++ b/src/modules/m_spanningtree/override_map.cpp @@ -82,16 +82,16 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, cha ServerInstance->Logs->Log("map",DEBUG,"Hidden? %d HideULines? %d GetName %s", Current->GetChild(q)->Hidden, Utils->HideULines, Current->GetChild(q)->GetName().c_str()); if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str())))) { - if (*user->oper) + if (IS_OPER(user)) { - ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!*user->oper)) ? depth : depth+2,matrix,totusers,totservers); + ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!IS_OPER(user))) ? depth : depth+2,matrix,totusers,totservers); ServerInstance->Logs->Log("map",DEBUG,"Show to oper"); } ServerInstance->Logs->Log("map",DEBUG,"Fall through"); } else { - ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!*user->oper)) ? depth : depth+2,matrix,totusers,totservers); + ShowMap(Current->GetChild(q),user,(Utils->FlatLinks && (!IS_OPER(user))) ? depth : depth+2,matrix,totusers,totservers); ServerInstance->Logs->Log("map",DEBUG,"Show to non oper"); } } @@ -117,7 +117,7 @@ int ModuleSpanningTree::HandleMap(const std::vector<std::string>& parameters, Us bool ret = false; if (!s) { - user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str()); + user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str()); ret = true; } else if (s && s != Utils->TreeRoot) @@ -196,10 +196,10 @@ int ModuleSpanningTree::HandleMap(const std::vector<std::string>& parameters, Us ServerInstance->Logs->Log("map",DEBUG,"local"); for (int t = 0; t < line; t++) { - user->WriteNumeric(6, "%s :%s",user->nick,&matrix[t][0]); + user->WriteNumeric(6, "%s :%s",user->nick.c_str(),&matrix[t][0]); } - user->WriteNumeric(270, "%s :%.0f server%s and %.0f user%s, average %.2f users per server",user->nick,totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users); - user->WriteNumeric(7, "%s :End of /MAP",user->nick); + user->WriteNumeric(270, "%s :%.0f server%s and %.0f user%s, average %.2f users per server",user->nick.c_str(),totservers,(totservers > 1 ? "s" : ""),totusers,(totusers > 1 ? "s" : ""),avg_users); + user->WriteNumeric(7, "%s :End of /MAP",user->nick.c_str()); } else { diff --git a/src/modules/m_spanningtree/override_modules.cpp b/src/modules/m_spanningtree/override_modules.cpp index 19c15b372..0a1dd2d3d 100644 --- a/src/modules/m_spanningtree/override_modules.cpp +++ b/src/modules/m_spanningtree/override_modules.cpp @@ -49,7 +49,7 @@ int ModuleSpanningTree::HandleModules(const std::vector<std::string>& parameters Utils->DoOneToOne(user->uuid, "MODULES", params, s->GetName()); } else - user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str()); + user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str()); return 1; } return 0; diff --git a/src/modules/m_spanningtree/override_motd.cpp b/src/modules/m_spanningtree/override_motd.cpp index 1090b2adb..3a1182973 100644 --- a/src/modules/m_spanningtree/override_motd.cpp +++ b/src/modules/m_spanningtree/override_motd.cpp @@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleMotd(const std::vector<std::string>& parameters, U Utils->DoOneToOne(user->uuid, "MOTD", params, s->GetName()); } else - user->WriteServ( "402 %s %s :No such server", user->nick, parameters[0].c_str()); + user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[0].c_str()); return 1; } return 0; diff --git a/src/modules/m_spanningtree/override_squit.cpp b/src/modules/m_spanningtree/override_squit.cpp index 581a00ef5..02833464f 100644 --- a/src/modules/m_spanningtree/override_squit.cpp +++ b/src/modules/m_spanningtree/override_squit.cpp @@ -40,7 +40,7 @@ int ModuleSpanningTree::HandleSquit(const std::vector<std::string>& parameters, { if (s == Utils->TreeRoot) { - user->WriteServ("NOTICE %s :*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)",user->nick,parameters[0].c_str()); + user->WriteServ("NOTICE %s :*** SQUIT: Foolish mortal, you cannot make a server SQUIT itself! (%s matches local server name)",user->nick.c_str(),parameters[0].c_str()); return 1; } @@ -48,19 +48,19 @@ int ModuleSpanningTree::HandleSquit(const std::vector<std::string>& parameters, if (sock) { - ServerInstance->SNO->WriteToSnoMask('l',"SQUIT: Server \002%s\002 removed from network by %s",parameters[0].c_str(),user->nick); + ServerInstance->SNO->WriteToSnoMask('l',"SQUIT: Server \002%s\002 removed from network by %s",parameters[0].c_str(),user->nick.c_str()); sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost()); ServerInstance->SE->DelFd(sock); sock->Close(); } else { - user->WriteServ("NOTICE %s :*** SQUIT may not be used to remove remote servers. Please use RSQUIT instead.",user->nick); + user->WriteServ("NOTICE %s :*** SQUIT may not be used to remove remote servers. Please use RSQUIT instead.",user->nick.c_str()); } } else { - user->WriteServ("NOTICE %s :*** SQUIT: The server \002%s\002 does not exist on the network.",user->nick,parameters[0].c_str()); + user->WriteServ("NOTICE %s :*** SQUIT: The server \002%s\002 does not exist on the network.",user->nick.c_str(),parameters[0].c_str()); } return 1; } diff --git a/src/modules/m_spanningtree/override_stats.cpp b/src/modules/m_spanningtree/override_stats.cpp index b22517b13..740694643 100644 --- a/src/modules/m_spanningtree/override_stats.cpp +++ b/src/modules/m_spanningtree/override_stats.cpp @@ -54,7 +54,7 @@ int ModuleSpanningTree::HandleStats(const std::vector<std::string>& parameters, } else { - user->WriteServ( "402 %s %s :No such server", user->nick, parameters[1].c_str()); + user->WriteServ( "402 %s %s :No such server", user->nick.c_str(), parameters[1].c_str()); } return 1; } @@ -72,7 +72,7 @@ int ModuleSpanningTree::OnStats(char statschar, User* user, string_list &results results.push_back(std::string(ServerInstance->Config->ServerName)+" 244 "+user->nick+" H * * "+Utils->LinkBlocks[i].Name.c_str()); } results.push_back(std::string(ServerInstance->Config->ServerName)+" 219 "+user->nick+" "+statschar+" :End of /STATS report"); - ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)",(!strcmp(user->server,ServerInstance->Config->ServerName) ? "Stats" : "Remote stats"),statschar,user->nick,user->ident,user->host); + ServerInstance->SNO->WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)",(!strcmp(user->server,ServerInstance->Config->ServerName) ? "Stats" : "Remote stats"),statschar,user->nick.c_str(),user->ident.c_str(),user->host); return 1; } diff --git a/src/modules/m_spanningtree/override_time.cpp b/src/modules/m_spanningtree/override_time.cpp index c24e6c95d..b0a37b7be 100644 --- a/src/modules/m_spanningtree/override_time.cpp +++ b/src/modules/m_spanningtree/override_time.cpp @@ -51,7 +51,7 @@ int ModuleSpanningTree::HandleTime(const std::vector<std::string>& parameters, U } else { - user->WriteNumeric(402, "%s %s :No such server",user->nick,parameters[0].c_str()); + user->WriteNumeric(402, "%s %s :No such server",user->nick.c_str(),parameters[0].c_str()); } } return 1; diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp index 8e4d20b6f..5d9705a87 100644 --- a/src/modules/m_spanningtree/override_whois.cpp +++ b/src/modules/m_spanningtree/override_whois.cpp @@ -47,8 +47,8 @@ int ModuleSpanningTree::HandleRemoteWhois(const std::vector<std::string>& parame } else if (!remote) { - user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick, parameters[1].c_str()); - user->WriteNumeric(318, "%s %s :End of /WHOIS list.",user->nick, parameters[1].c_str()); + user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), parameters[1].c_str()); + user->WriteNumeric(318, "%s %s :End of /WHOIS list.",user->nick.c_str(), parameters[1].c_str()); return 1; } } diff --git a/src/modules/m_spanningtree/privmsg.cpp b/src/modules/m_spanningtree/privmsg.cpp index 316ad2e5c..5b2ea865a 100644 --- a/src/modules/m_spanningtree/privmsg.cpp +++ b/src/modules/m_spanningtree/privmsg.cpp @@ -75,7 +75,7 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string if (s) { FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, user, TYPE_USER, text, status, except_list)); - user->Write(":%s %s %s :%s", s->GetName().c_str(), messagetype.c_str(), user->nick, text.c_str()); + user->Write(":%s %s %s :%s", s->GetName().c_str(), messagetype.c_str(), user->nick.c_str(), text.c_str()); } } diff --git a/src/modules/m_spanningtree/rconnect.cpp b/src/modules/m_spanningtree/rconnect.cpp index a25226828..78adae28c 100644 --- a/src/modules/m_spanningtree/rconnect.cpp +++ b/src/modules/m_spanningtree/rconnect.cpp @@ -42,17 +42,17 @@ CmdResult cmd_rconnect::Handle (const std::vector<std::string>& parameters, User { if (!Utils->FindServerMask(parameters[0])) { - user->WriteServ("NOTICE %s :*** RCONNECT: Server \002%s\002 isn't connected to the network!", user->nick, parameters[0].c_str()); + user->WriteServ("NOTICE %s :*** RCONNECT: Server \002%s\002 isn't connected to the network!", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } - user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick,parameters[0].c_str(),parameters[1].c_str()); + user->WriteServ("NOTICE %s :*** RCONNECT: Sending remote connect to \002%s\002 to connect server \002%s\002.",user->nick.c_str(),parameters[0].c_str(),parameters[1].c_str()); } /* Is this aimed at our server? */ if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0])) { /* Yes, initiate the given connect */ - ServerInstance->SNO->WriteToSnoMask('l',"Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick,parameters[0].c_str(),parameters[1].c_str()); + ServerInstance->SNO->WriteToSnoMask('l',"Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick.c_str(),parameters[0].c_str(),parameters[1].c_str()); std::vector<std::string> para; para.push_back(parameters[1]); std::string original_command = std::string("CONNECT ") + parameters[1]; diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index 2a906dfe0..e4c9519cc 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -44,7 +44,7 @@ CmdResult cmd_rsquit::Handle (const std::vector<std::string>& parameters, User * server_target = Utils->FindServerMask(parameters[0]); if (!server_target) { - user->WriteServ("NOTICE %s :*** RSQUIT: Server \002%s\002 isn't connected to the network!", user->nick, parameters[0].c_str()); + user->WriteServ("NOTICE %s :*** RSQUIT: Server \002%s\002 isn't connected to the network!", user->nick.c_str(), parameters[0].c_str()); return CMD_FAILURE; } @@ -63,7 +63,7 @@ CmdResult cmd_rsquit::Handle (const std::vector<std::string>& parameters, User * if (sock) { const char *reason = parameters.size() == 2 ? parameters[1].c_str() : "No reason"; - ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s (%s)", parameters[0].c_str(), user->nick, reason); + ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s (%s)", parameters[0].c_str(), user->nick.c_str(), reason); sock->Squit(server_target, std::string("Server quit by ") + user->GetFullRealHost() + " (" + reason + ")"); ServerInstance->SE->DelFd(sock); sock->Close(); @@ -79,7 +79,7 @@ void cmd_rsquit::NoticeUser(User* user, const std::string &msg) { if (IS_LOCAL(user)) { - user->WriteServ("NOTICE %s :%s",user->nick,msg.c_str()); + user->WriteServ("NOTICE %s :%s",user->nick.c_str(),msg.c_str()); } else { diff --git a/src/modules/m_spanningtree/svsnick.cpp b/src/modules/m_spanningtree/svsnick.cpp index adf8f012e..9b0d3bed3 100644 --- a/src/modules/m_spanningtree/svsnick.cpp +++ b/src/modules/m_spanningtree/svsnick.cpp @@ -52,7 +52,7 @@ bool TreeSocket::ForceNick(const std::string &prefix, std::deque<std::string> &p if (!u->ForceNickChange(params[1].c_str())) { /* buh. UID them */ - if (!u->ForceNickChange(u->uuid)) + if (!u->ForceNickChange(u->uuid.c_str())) { this->Instance->Users->QuitUser(u, "Nickname collision"); return true; diff --git a/src/modules/m_spanningtree/time.cpp b/src/modules/m_spanningtree/time.cpp index 4149aee58..5b6b8df82 100644 --- a/src/modules/m_spanningtree/time.cpp +++ b/src/modules/m_spanningtree/time.cpp @@ -67,7 +67,7 @@ bool TreeSocket::Time(const std::string &prefix, std::deque<std::string> ¶ms char tms[26]; snprintf(tms,26,"%s",asctime(timeinfo)); tms[24] = 0; - u->WriteNumeric(391, "%s %s :%s",u->nick,prefix.c_str(),tms); + u->WriteNumeric(391, "%s %s :%s",u->nick.c_str(),prefix.c_str(),tms); } else { diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 5d2471b2c..93d99c2ba 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -575,7 +575,7 @@ bool TreeSocket::ProcessLine(std::string &line) { int collideret = 0; /* x is local, who is remote */ - collideret = this->DoCollision(x, who->age, who->ident, who->GetIPString(), who->uuid); + collideret = this->DoCollision(x, who->age, who->ident.c_str(), who->GetIPString(), who->uuid.c_str()); if (collideret != 1) { /* diff --git a/src/modules/m_spanningtree/uid.cpp b/src/modules/m_spanningtree/uid.cpp index 7179e4ecc..f68da8a1c 100644 --- a/src/modules/m_spanningtree/uid.cpp +++ b/src/modules/m_spanningtree/uid.cpp @@ -111,12 +111,12 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa } (*(this->Instance->Users->clientlist))[tempnick] = _new; _new->SetFd(FD_MAGIC_NUMBER); - strlcpy(_new->nick, tempnick, NICKMAX - 1); + _new->nick.assign(tempnick, NICKMAX - 1); strlcpy(_new->host, params[3].c_str(),64); - strlcpy(_new->dhost, params[4].c_str(),64); + _new->dhost.assign(params[4], 0, 64); _new->server = this->Instance->FindServerNamePtr(remoteserver->GetName().c_str()); - strlcpy(_new->ident, params[5].c_str(),IDENTMAX + 1); - strlcpy(_new->fullname, params[9].c_str(),MAXGECOS); + _new->ident.assign(params[5], 0, IDENTMAX + 1); + _new->fullname.assign(params[9], 0, MAXGECOS); _new->registered = REG_ALL; _new->signon = signon; _new->age = age_t; @@ -157,7 +157,7 @@ bool TreeSocket::ParseUID(const std::string &source, std::deque<std::string> &pa dosend = false; if (dosend) - this->Instance->SNO->WriteToSnoMask('C',"Client connecting at %s: %s!%s@%s [%s] [%s]",_new->server,_new->nick,_new->ident,_new->host, _new->GetIPString(), _new->fullname); + this->Instance->SNO->WriteToSnoMask('C',"Client connecting at %s: %s!%s@%s [%s] [%s]",_new->server,_new->nick.c_str(),_new->ident.c_str(),_new->host, _new->GetIPString(), _new->fullname.c_str()); params[9] = ":" + params[9]; Utils->DoOneToAllButSender(source, "UID", params, source); |