diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-19 21:16:42 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-19 21:16:42 +0000 |
commit | 31f1e7ad092f8bf16ee653cc105eea4a769650ca (patch) | |
tree | dced0411d5fbe803fe92ea54cb03d36c0a817563 /src/modules | |
parent | 869bd02318d94a38369a125726b8edeb54ba0706 (diff) |
Convert channel::name to std::string, this was a beastie!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9770 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
36 files changed, 123 insertions, 123 deletions
diff --git a/src/modules/extra/m_sqlutils.cpp b/src/modules/extra/m_sqlutils.cpp index 3f7c63714..eea748db4 100644 --- a/src/modules/extra/m_sqlutils.cpp +++ b/src/modules/extra/m_sqlutils.cpp @@ -210,13 +210,13 @@ public: { if(iter->second != chan) { - ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: ID associated with channel %s doesn't have the same Channel* associated with it in the map (erasing anyway)", chan->name); + ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: ID associated with channel %s doesn't have the same Channel* associated with it in the map (erasing anyway)", chan->name.c_str()); } idchan.erase(iter); } else { - ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: channel %s was extended with sqlutils_queryids but there was nothing matching in the map", chan->name); + ServerInstance->Logs->Log("m_sqlutils",DEBUG, "BUG: channel %s was extended with sqlutils_queryids but there was nothing matching in the map", chan->name.c_str()); } } diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 0a1555b29..28e5a54ac 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -26,7 +26,7 @@ class AuditoriumMode : public ModeHandler { if (IS_LOCAL(source) && (channel->GetStatus(source) < STATUS_OP)) { - source->WriteNumeric(482, "%s %s :Only channel operators may %sset channel mode +u", source->nick.c_str(), channel->name, adding ? "" : "un"); + source->WriteNumeric(482, "%s %s :Only channel operators may %sset channel mode +u", source->nick.c_str(), channel->name.c_str(), adding ? "" : "un"); return MODEACTION_DENY; } else @@ -120,9 +120,9 @@ class ModuleAuditorium : public Module { silent = true; /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */ - user->WriteFrom(user, "JOIN %s", channel->name); + user->WriteFrom(user, "JOIN %s", channel->name.c_str()); if (ShowOps) - channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "JOIN %s", channel->name); + channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "JOIN %s", channel->name.c_str()); } } @@ -132,12 +132,12 @@ class ModuleAuditorium : public Module { silent = true; /* Because we silenced the event, make sure it reaches the user whos leaving (but only them of course) */ - user->WriteFrom(user, "PART %s%s%s", channel->name, + user->WriteFrom(user, "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :", partmessage.empty() ? "" : partmessage.c_str()); if (ShowOps) { - channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "PART %s%s%s", channel->name, partmessage.empty() ? "" : " :", + channel->WriteAllExcept(user, false, channel->GetStatus(user) >= STATUS_OP ? 0 : '@', except_list, "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :", partmessage.empty() ? "" : partmessage.c_str()); } } @@ -149,11 +149,11 @@ class ModuleAuditorium : public Module { silent = true; /* Send silenced event only to the user being kicked and the user doing the kick */ - source->WriteFrom(source, "KICK %s %s %s", chan->name, user->nick.c_str(), reason.c_str()); + source->WriteFrom(source, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str()); if (ShowOps) - chan->WriteAllExcept(source, false, chan->GetStatus(source) >= STATUS_OP ? 0 : '@', except_list, "KICK %s %s %s", chan->name, user->nick.c_str(), reason.c_str()); + chan->WriteAllExcept(source, false, chan->GetStatus(source) >= STATUS_OP ? 0 : '@', except_list, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str()); else - user->WriteFrom(source, "KICK %s %s %s", chan->name, user->nick.c_str(), reason.c_str()); + user->WriteFrom(source, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str()); } } diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index 22c7c03b4..a8add0c72 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -64,7 +64,7 @@ class BanRedirect : public ModeWatcher if(adding && (channel->bans.size() > static_cast<unsigned>(maxbans))) { - source->WriteNumeric(478, "%s %s :Channel ban list for %s is full (maximum entries for this channel is %ld)", source->nick.c_str(), channel->name, channel->name, maxbans); + source->WriteNumeric(478, "%s %s :Channel ban list for %s is full (maximum entries for this channel is %ld)", source->nick.c_str(), channel->name.c_str(), channel->name.c_str(), maxbans); return false; } @@ -116,9 +116,9 @@ class BanRedirect : public ModeWatcher { if(Srv->IsChannel(mask[CHAN].c_str())) { - if(irc::string(channel->name) == irc::string(mask[CHAN].c_str())) + if (assign(channel->name) == mask[CHAN]) { - source->WriteNumeric(690, "%s %s :You cannot set a ban redirection to the channel the ban is on", source->nick.c_str(), channel->name); + source->WriteNumeric(690, "%s %s :You cannot set a ban redirection to the channel the ban is on", source->nick.c_str(), channel->name.c_str()); return false; } else @@ -170,7 +170,7 @@ class BanRedirect : public ModeWatcher } else { - source->WriteNumeric(403, "%s %s :Invalid channel name in redirection (%s)", source->nick.c_str(), channel->name, mask[CHAN].c_str()); + source->WriteNumeric(403, "%s %s :Invalid channel name in redirection (%s)", source->nick.c_str(), channel->name.c_str(), mask[CHAN].c_str()); return false; } } @@ -298,12 +298,12 @@ class ModuleBanRedirect : public Module if(destchan && ServerInstance->Modules->Find("m_redirect.so") && destchan->IsModeSet('L') && destchan->limit && (destchan->GetUserCounter() >= destchan->limit)) { - user->WriteNumeric(474, "%s %s :Cannot join channel (You are banned)", user->nick.c_str(), chan->name); + user->WriteNumeric(474, "%s %s :Cannot join channel (You are banned)", user->nick.c_str(), chan->name.c_str()); return 1; } else { - user->WriteNumeric(474, "%s %s :Cannot join channel (You are banned)", user->nick.c_str(), chan->name); + user->WriteNumeric(474, "%s %s :Cannot join channel (You are banned)", user->nick.c_str(), chan->name.c_str()); user->WriteNumeric(470, "%s :You are being automatically redirected to %s", user->nick.c_str(), redir->targetchan.c_str()); nofollow = true; Channel::JoinUser(ServerInstance, user, redir->targetchan.c_str(), false, "", false, ServerInstance->Time()); diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index 1fd9717d1..29e481c1e 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -86,7 +86,7 @@ public: } if ( ((caps*100)/(int)text.length()) >= percent ) { - user->WriteServ( "404 %s %s :Your line cannot be more than %d%% capital letters if it is %d or more letters long", user->nick.c_str(), c->name, percent, minlen); + user->WriteServ( "404 %s %s :Your line cannot be more than %d%% capital letters if it is %d or more letters long", user->nick.c_str(), c->name.c_str(), percent, minlen); return 1; } } diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index d48fab5ba..72f41801e 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -63,7 +63,7 @@ class ModuleBlockColour : public Module case 21: case 22: case 31: - user->WriteNumeric(404, "%s %s :Can't send colours to channel (+c set)",user->nick.c_str(), c->name); + user->WriteNumeric(404, "%s %s :Can't send colours to channel (+c set)",user->nick.c_str(), c->name.c_str()); return 1; break; } diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index 0d73e6bac..4ade3e347 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -115,7 +115,7 @@ class ModuleCensor : public Module { if (index->second.empty()) { - user->WriteNumeric(936, "%s %s %s :Your message contained a censored word, and was blocked", user->nick.c_str(), ((Channel*)dest)->name, index->first.c_str()); + user->WriteNumeric(936, "%s %s %s :Your message contained a censored word, and was blocked", user->nick.c_str(), ((Channel*)dest)->name.c_str(), index->first.c_str()); return 1; } diff --git a/src/modules/m_chancreate.cpp b/src/modules/m_chancreate.cpp index 3ce63567e..8633ddc05 100644 --- a/src/modules/m_chancreate.cpp +++ b/src/modules/m_chancreate.cpp @@ -41,7 +41,7 @@ class ModuleChanCreate : public Module virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) { if (channel->GetUserCounter() == 1) - ServerInstance->SNO->WriteToSnoMask('j', "Channel %s created by %s!%s@%s", channel->name, user->nick.c_str(), user->ident.c_str(), user->host.c_str()); + ServerInstance->SNO->WriteToSnoMask('j', "Channel %s created by %s!%s@%s", channel->name.c_str(), user->nick.c_str(), user->ident.c_str(), user->host.c_str()); } }; diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index ff3e4ca96..d8066cc27 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -31,7 +31,7 @@ class ChanFilter : public ListModeBase { if ((word.length() > 35) || (word.empty())) { - user->WriteNumeric(935, "%s %s %s :word is too %s for censor list",user->nick.c_str(), chan->name,word.c_str(), (word.empty() ? "short" : "long")); + user->WriteNumeric(935, "%s %s %s :word is too %s for censor list",user->nick.c_str(), chan->name.c_str(), word.c_str(), (word.empty() ? "short" : "long")); return false; } @@ -40,18 +40,18 @@ class ChanFilter : public ListModeBase virtual bool TellListTooLong(User* user, Channel* chan, std::string &word) { - user->WriteNumeric(939, "%s %s %s :Channel spamfilter list is full",user->nick.c_str(), chan->name, word.c_str()); + user->WriteNumeric(939, "%s %s %s :Channel spamfilter list is full", user->nick.c_str(), chan->name.c_str(), word.c_str()); return true; } virtual void TellAlreadyOnList(User* user, Channel* chan, std::string &word) { - user->WriteNumeric(937, "%s %s :The word %s is already on the spamfilter list",user->nick.c_str(), chan->name,word.c_str()); + user->WriteNumeric(937, "%s %s :The word %s is already on the spamfilter list",user->nick.c_str(), chan->name.c_str(), word.c_str()); } virtual void TellNotSet(User* user, Channel* chan, std::string &word) { - user->WriteNumeric(938, "%s %s :No such spamfilter word is set",user->nick.c_str(), chan->name); + user->WriteNumeric(938, "%s %s :No such spamfilter word is set",user->nick.c_str(), chan->name.c_str()); } }; @@ -101,7 +101,7 @@ class ModuleChanFilter : public Module { if (line.find(i->mask.c_str()) != std::string::npos) { - user->WriteNumeric(936, "%s %s %s :Your message contained a censored word, and was blocked",user->nick.c_str(), chan->name, i->mask.c_str()); + user->WriteNumeric(936, "%s %s %s :Your message contained a censored word, and was blocked",user->nick.c_str(), chan->name.c_str(), i->mask.c_str()); return 1; } } diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp index 5070f190a..9e09b7cf3 100644 --- a/src/modules/m_chanlog.cpp +++ b/src/modules/m_chanlog.cpp @@ -40,7 +40,7 @@ class ChannelLogStream : public LogStream char buf[MAXBUF]; snprintf(buf, MAXBUF, "\2%s\2: %s", type.c_str(), msg.c_str()); - c->WriteChannelWithServ(ServerInstance->Config->ServerName, "PRIVMSG %s :%s", c->name, buf); + c->WriteChannelWithServ(ServerInstance->Config->ServerName, "PRIVMSG %s :%s", c->name.c_str(), buf); ServerInstance->PI->SendChannelPrivmsg(c, 0, buf); Logging = false; } diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 9363bac4b..e44e496f8 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -103,10 +103,10 @@ class FounderProtectBase { if (i->first->GetExt(item)) { - user->WriteServ("%d %s %s %s", list, user->nick.c_str(), channel->name,i->first->nick.c_str()); + user->WriteServ("%d %s %s %s", list, user->nick.c_str(), channel->name.c_str(), i->first->nick.c_str()); } } - user->WriteServ("%d %s %s :End of channel %s list", end, user->nick.c_str(), channel->name, type.c_str()); + user->WriteServ("%d %s %s :End of channel %s list", end, user->nick.c_str(), channel->name.c_str(), type.c_str()); } User* FindAndVerify(std::string ¶meter, Channel* channel) @@ -206,7 +206,7 @@ class ChanFounder : public ModeHandler, public FounderProtectBase else { // whoops, someones being naughty! - source->WriteNumeric(468, "%s %s :Only servers may set channel mode +q",source->nick.c_str(), channel->name); + source->WriteNumeric(468, "%s %s :Only servers may set channel mode +q", source->nick.c_str(), channel->name.c_str()); parameter.clear(); return MODEACTION_DENY; } @@ -273,7 +273,7 @@ class ChanProtect : public ModeHandler, public FounderProtectBase else { // bzzzt, wrong answer! - source->WriteNumeric(482, "%s %s :You are not a channel founder",source->nick.c_str(), channel->name); + source->WriteNumeric(482, "%s %s :You are not a channel founder", source->nick.c_str(), channel->name.c_str()); return MODEACTION_DENY; } } @@ -388,7 +388,7 @@ class ModuleChanProtect : public Module // will appear in the names list for the user.. remove if desired -Special if (FirstInGetsFounder && channel->GetUserCounter() == 1) - user->WriteServ("MODE %s +q %s", channel->name, user->nick.c_str()); + user->WriteServ("MODE %s +q %s", channel->name.c_str(), user->nick.c_str()); } virtual int OnAccessCheck(User* source,User* dest,Channel* channel,int access_type) @@ -408,8 +408,8 @@ class ModuleChanProtect : public Module if ((ServerInstance->ULine(source->nick.c_str())) || (ServerInstance->ULine(source->server)) || (!*source->server)) return ACR_ALLOW; - std::string founder = "cm_founder_"+std::string(channel->name); - std::string protect = "cm_protect_"+std::string(channel->name); + std::string founder("cm_founder_"+channel->name); + std::string protect("cm_protect_"+channel->name); switch (access_type) { @@ -417,12 +417,12 @@ class ModuleChanProtect : public Module case AC_DEOP: if (dest->GetExt(founder)) { - source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're a channel founder"); + source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't deop "+dest->nick+" as they're a channel founder"); return ACR_DENY; } if ((dest->GetExt(protect)) && (!source->GetExt(protect))) { - source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're protected (+a)"); + source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't deop "+dest->nick+" as they're protected (+a)"); return ACR_DENY; } break; @@ -431,12 +431,12 @@ class ModuleChanProtect : public Module case AC_KICK: if (dest->GetExt(founder)) { - source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't kick "+std::string(dest->nick)+" as they're a channel founder"); + source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't kick "+dest->nick+" as they're a channel founder"); return ACR_DENY; } if ((dest->GetExt(protect)) && (!source->GetExt(protect))) { - source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't kick "+std::string(dest->nick)+" as they're protected (+a)"); + source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't kick "+dest->nick+" as they're protected (+a)"); return ACR_DENY; } break; @@ -445,12 +445,12 @@ class ModuleChanProtect : public Module case AC_DEHALFOP: if (dest->GetExt(founder)) { - source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't de-halfop "+std::string(dest->nick)+" as they're a channel founder"); + source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't de-halfop "+dest->nick+" as they're a channel founder"); return ACR_DENY; } if ((dest->GetExt(protect)) && (!source->GetExt(protect))) { - source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't de-halfop "+std::string(dest->nick)+" as they're protected (+a)"); + source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't de-halfop "+dest->nick+" as they're protected (+a)"); return ACR_DENY; } break; @@ -459,12 +459,12 @@ class ModuleChanProtect : public Module case AC_DEVOICE: if (dest->GetExt(founder)) { - source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't devoice "+std::string(dest->nick)+" as they're a channel founder"); + source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't devoice "+dest->nick+" as they're a channel founder"); return ACR_DENY; } if ((dest->GetExt(protect)) && (!source->GetExt(protect))) { - source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't devoice "+std::string(dest->nick)+" as they're protected (+a)"); + source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't devoice "+dest->nick+" as they're protected (+a)"); return ACR_DENY; } break; diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index 80be98223..be57f8af1 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -69,7 +69,7 @@ class CommandCycle : public Command } else { - user->WriteNumeric(442, "%s %s :You're not on that channel", user->nick.c_str(), channel->name); + user->WriteNumeric(442, "%s %s :You're not on that channel", user->nick.c_str(), channel->name.c_str()); } return CMD_FAILURE; diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp index e8c51d79a..20255abf6 100644 --- a/src/modules/m_delayjoin.cpp +++ b/src/modules/m_delayjoin.cpp @@ -29,7 +29,7 @@ class DelayJoinMode : public ModeHandler { if (IS_LOCAL(source) && (channel->GetStatus(source) < STATUS_OP)) { - source->WriteNumeric(482, "%s %s :Only channel operators may %sset channel mode +D", source->nick.c_str(), channel->name, adding ? "" : "un"); + source->WriteNumeric(482, "%s %s :Only channel operators may %sset channel mode +D", source->nick.c_str(), channel->name.c_str(), adding ? "" : "un"); return MODEACTION_DENY; } else @@ -104,10 +104,10 @@ class ModuleDelayJoin : public Module { silent = true; /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */ - user->WriteFrom(user, "JOIN %s", channel->name); + user->WriteFrom(user, "JOIN %s", channel->name.c_str()); /* This metadata tells the module the user is delayed join on this specific channel */ - user->Extend(std::string("delayjoin_")+channel->name); + user->Extend("delayjoin_"+channel->name); /* This metadata tells the module the user is delayed join on at least one (or more) channels. * It is only cleared when the user is no longer on ANY +D channels. @@ -121,11 +121,11 @@ class ModuleDelayJoin : public Module { if (channel->IsModeSet('D')) { - if (user->GetExt(std::string("delayjoin_")+channel->name)) + if (user->GetExt("delayjoin_"+channel->name)) { silent = true; /* Because we silenced the event, make sure it reaches the user whos leaving (but only them of course) */ - user->WriteFrom(user, "PART %s%s%s", channel->name, partmessage.empty() ? "" : " :", partmessage.empty() ? "" : partmessage.c_str()); + user->WriteFrom(user, "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :", partmessage.empty() ? "" : partmessage.c_str()); } } } @@ -135,10 +135,10 @@ class ModuleDelayJoin : public Module if (chan->IsModeSet('D')) { /* Send silenced event only to the user being kicked and the user doing the kick */ - if (user->GetExt(std::string("delayjoin_")+chan->name)) + if (user->GetExt("delayjoin_"+chan->name)) { silent = true; - user->WriteFrom(source, "KICK %s %s %s", chan->name, user->nick.c_str(), reason.c_str()); + user->WriteFrom(source, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str()); } } } @@ -169,18 +169,18 @@ class ModuleDelayJoin : public Module Channel* channel = (Channel*) dest; - if (!user->GetExt(std::string("delayjoin_")+channel->name)) + if (!user->GetExt("delayjoin_"+channel->name)) return; /* Display the join to everyone else (the user who joined got it earlier) */ - this->WriteCommonFrom(user, channel, "JOIN %s", channel->name); + this->WriteCommonFrom(user, channel, "JOIN %s", channel->name.c_str()); std::string n = this->ServerInstance->Modes->ModeString(user, channel); if (n.length() > 0) - this->WriteCommonFrom(user, channel, "MODE %s +%s", channel->name, n.c_str()); + this->WriteCommonFrom(user, channel, "MODE %s +%s", channel->name.c_str(), n.c_str()); /* Shrink off the neccessary metadata for a specific channel */ - user->Shrink(std::string("delayjoin_")+channel->name); + user->Shrink("delayjoin_"+channel->name); /* Check if the user is left on any other +D channels, if so don't take away the * metadata that says theyre on one or more channels diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp index 59b4c6ff4..32e09ab57 100644 --- a/src/modules/m_invisible.cpp +++ b/src/modules/m_invisible.cpp @@ -100,7 +100,7 @@ class InvisibleMode : public ModeHandler CUList *ulist = f->first->GetUsers(); char tb[MAXBUF]; - snprintf(tb,MAXBUF,":%s %s %s", dest->GetFullHost().c_str(), adding ? "PART" : "JOIN", f->first->name); + snprintf(tb,MAXBUF,":%s %s %s", dest->GetFullHost().c_str(), adding ? "PART" : "JOIN", f->first->name.c_str()); std::string out = tb; std::string n = this->ServerInstance->Modes->ModeString(dest, f->first); @@ -111,7 +111,7 @@ class InvisibleMode : public ModeHandler { i->first->Write(out); if (!n.empty() && !adding) - i->first->WriteServ("MODE %s +%s", f->first->name, n.c_str()); + i->first->WriteServ("MODE %s +%s", f->first->name.c_str(), n.c_str()); } } } @@ -194,8 +194,8 @@ class ModuleInvisible : public Module { silent = true; /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */ - this->WriteCommonFrom(user, channel, "JOIN %s", channel->name); - ServerInstance->SNO->WriteToSnoMask('A', "\2NOTICE\2: Oper %s has joined %s invisibly (+Q)", user->GetFullHost().c_str(), channel->name); + this->WriteCommonFrom(user, channel, "JOIN %s", channel->name.c_str()); + ServerInstance->SNO->WriteToSnoMask('A', "\2NOTICE\2: Oper %s has joined %s invisibly (+Q)", user->GetFullHost().c_str(), channel->name.c_str()); } } @@ -211,7 +211,7 @@ class ModuleInvisible : public Module { silent = true; /* Because we silenced the event, make sure it reaches the user whos leaving (but only them of course) */ - this->WriteCommonFrom(user, channel, "PART %s%s%s", channel->name, + this->WriteCommonFrom(user, channel, "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :", partmessage.empty() ? "" : partmessage.c_str()); } diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index 4a92c996e..f6f58f0dc 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -135,7 +135,7 @@ class JoinFlood : public ModeHandler int nsecs = atoi(secs); if ((njoins<1) || (nsecs<1)) { - source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name); + source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name.c_str()); parameter.clear(); return MODEACTION_DENY; } @@ -184,7 +184,7 @@ class JoinFlood : public ModeHandler } else { - source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name); + source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name.c_str()); return MODEACTION_DENY; } } @@ -231,7 +231,7 @@ class ModuleJoinFlood : public Module { if (f->islocked()) { - user->WriteNumeric(609, "%s %s :This channel is temporarily unavailable (+j). Please try again later.",user->nick.c_str(),chan->name); + user->WriteNumeric(609, "%s %s :This channel is temporarily unavailable (+j). Please try again later.",user->nick.c_str(),chan->name.c_str()); return 1; } } @@ -255,7 +255,7 @@ class ModuleJoinFlood : public Module { f->clear(); f->lock(); - channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :This channel has been closed to new users for 60 seconds because there have been more than %d joins in %d seconds.", channel->name, f->joins, f->secs); + channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :This channel has been closed to new users for 60 seconds because there have been more than %d joins in %d seconds.", channel->name.c_str(), f->joins, f->secs); } } } diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index 1e7513eb1..fba478d01 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -145,7 +145,7 @@ public: { if (iter->first == user) { - user->WriteServ( "495 %s %s :You cannot rejoin this channel yet after being kicked (+J)", user->nick.c_str(), chan->name); + user->WriteServ( "495 %s %s :You cannot rejoin this channel yet after being kicked (+J)", user->nick.c_str(), chan->name.c_str()); return 1; } } diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 07b898110..12dc1c796 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -40,19 +40,19 @@ class CommandKnock : public Command if (c->HasUser(user)) { - user->WriteNumeric(480, "%s :Can't KNOCK on %s, you are already on that channel.", user->nick.c_str(), c->name); + user->WriteNumeric(480, "%s :Can't KNOCK on %s, you are already on that channel.", user->nick.c_str(), c->name.c_str()); return CMD_FAILURE; } if (c->IsModeSet('K')) { - user->WriteNumeric(480, "%s :Can't KNOCK on %s, +K is set.",user->nick.c_str(), c->name); + user->WriteNumeric(480, "%s :Can't KNOCK on %s, +K is set.",user->nick.c_str(), c->name.c_str()); return CMD_FAILURE; } if (!c->modes[CM_INVITEONLY]) { - user->WriteNumeric(480, "%s :Can't KNOCK on %s, channel is not invite only so knocking is pointless!",user->nick.c_str(), c->name); + user->WriteNumeric(480, "%s :Can't KNOCK on %s, channel is not invite only so knocking is pointless!",user->nick.c_str(), c->name.c_str()); return CMD_FAILURE; } @@ -62,8 +62,8 @@ class CommandKnock : public Command } line = line + parameters[parameters.size()-1]; - c->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :User %s is KNOCKing on %s (%s)", c->name, user->nick.c_str(), c->name, line.c_str()); - user->WriteServ("NOTICE %s :KNOCKing on %s",user->nick.c_str(),c->name); + c->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :User %s is KNOCKing on %s (%s)", c->name.c_str(), user->nick.c_str(), c->name.c_str(), line.c_str()); + user->WriteServ("NOTICE %s :KNOCKing on %s", user->nick.c_str(), c->name.c_str()); return CMD_SUCCESS; } }; diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index d6820b8ad..b0065f065 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -131,7 +131,7 @@ class MsgFlood : public ModeHandler int nsecs = atoi(secs); if ((nlines<1) || (nsecs<1)) { - source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name); + source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name.c_str()); parameter.clear(); return MODEACTION_DENY; } @@ -177,7 +177,7 @@ class MsgFlood : public ModeHandler } else { - source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name); + source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name.c_str()); parameter.clear(); return MODEACTION_DENY; } diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp index 2eb631fb2..3e811da93 100644 --- a/src/modules/m_nickflood.cpp +++ b/src/modules/m_nickflood.cpp @@ -135,7 +135,7 @@ class NickFlood : public ModeHandler int nsecs = atoi(secs); if ((nnicks<1) || (nsecs<1)) { - source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name); + source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name.c_str()); parameter.clear(); return MODEACTION_DENY; } @@ -184,7 +184,7 @@ class NickFlood : public ModeHandler } else { - source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name); + source->WriteNumeric(608, "%s %s :Invalid flood parameter",source->nick.c_str(),channel->name.c_str()); return MODEACTION_DENY; } } @@ -238,7 +238,7 @@ class ModuleNickFlood : public Module if (f->islocked()) { - user->WriteNumeric(447, "%s :%s has been locked for nickchanges for 60 seconds because there have been more than %d nick changes in %d seconds", user->nick.c_str(), channel->name, f->nicks, f->secs); + user->WriteNumeric(447, "%s :%s has been locked for nickchanges for 60 seconds because there have been more than %d nick changes in %d seconds", user->nick.c_str(), channel->name.c_str(), f->nicks, f->secs); return 1; } @@ -247,7 +247,7 @@ class ModuleNickFlood : public Module { f->clear(); f->lock(); - channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :No nick changes are allowed for 60 seconds because there have been more than %d nick changes in %d seconds.", channel->name, f->nicks, f->secs); + channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :No nick changes are allowed for 60 seconds because there have been more than %d nick changes in %d seconds.", channel->name.c_str(), f->nicks, f->secs); return 1; } } diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 3a9b1c9c2..557771697 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -84,7 +84,7 @@ class ModuleNoCTCP : public Module { if (strncmp(text.c_str(),"\1ACTION ",8)) { - user->WriteNumeric(492, "%s %s :Can't send CTCP to channel (+C set)",user->nick.c_str(), c->name); + user->WriteNumeric(492, "%s %s :Can't send CTCP to channel (+C set)",user->nick.c_str(), c->name.c_str()); return 1; } } diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp index dde96383f..0d6c56d99 100644 --- a/src/modules/m_noinvite.cpp +++ b/src/modules/m_noinvite.cpp @@ -40,7 +40,7 @@ class ModuleNoInvite : public Module { if (channel->IsModeSet('V')) { - user->WriteNumeric(492, "%s %s :Can't invite %s to channel (+V set)",user->nick.c_str(), channel->name, dest->nick.c_str()); + user->WriteNumeric(492, "%s %s :Can't invite %s to channel (+V set)",user->nick.c_str(), channel->name.c_str(), dest->nick.c_str()); return 1; } return 0; diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp index dbfa0c2ea..74701795b 100644 --- a/src/modules/m_nokicks.cpp +++ b/src/modules/m_nokicks.cpp @@ -54,7 +54,7 @@ class ModuleNoKicks : public Module else { // nobody else can (not even opers with override, and founders) - source->WriteNumeric(484, "%s %s :Can't kick user %s from channel (+Q set)",source->nick.c_str(), channel->name,dest->nick.c_str()); + source->WriteNumeric(484, "%s %s :Can't kick user %s from channel (+Q set)",source->nick.c_str(), channel->name.c_str(), dest->nick.c_str()); return ACR_DENY; } } diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp index c6301d19d..0e5e967bd 100644 --- a/src/modules/m_nonicks.cpp +++ b/src/modules/m_nonicks.cpp @@ -85,7 +85,7 @@ class ModuleNoNickChange : public Module if (CHANOPS_EXEMPT(ServerInstance, 'N') && curr->GetStatus(user) == STATUS_OP) continue; - user->WriteNumeric(447, "%s :Can't change nickname while on %s (+N is set)", user->nick.c_str(), curr->name); + user->WriteNumeric(447, "%s :Can't change nickname while on %s (+N is set)", user->nick.c_str(), curr->name.c_str()); return 1; } } diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index 920a0d134..bb5e62229 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -58,7 +58,7 @@ class ModuleNoNotice : public Module } else { - user->WriteNumeric(404, "%s %s :Can't send NOTICE to channel (+T set)",user->nick.c_str(), c->name); + user->WriteNumeric(404, "%s %s :Can't send NOTICE to channel (+T set)",user->nick.c_str(), c->name.c_str()); return 1; } } diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 148528174..4600760f2 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -69,7 +69,7 @@ class ModuleOperChans : public Module { if (chan->IsModeSet('O')) { - user->WriteNumeric(520, "%s %s :Only IRC operators may join the channel %s (+O is set)",user->nick.c_str(), chan->name,chan->name); + user->WriteNumeric(520, "%s %s :Only IRC operators may join the channel %s (+O is set)",user->nick.c_str(), chan->name.c_str(), chan->name.c_str()); return 1; } } diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index 8cbc1836d..1cdf39827 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -236,7 +236,7 @@ class ModuleOverride : public Module { if ((chan->modes[CM_INVITEONLY]) && (CanOverride(user,"INVITE"))) { - irc::string x = chan->name; + irc::string x(chan->name.c_str()); if (!user->IsInvited(x)) { if (RequireKey && keygiven != "override") @@ -248,12 +248,12 @@ class ModuleOverride : public Module if (NoisyOverride) chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass invite-only", cname, user->nick.c_str()); - ServerInstance->SNO->WriteToSnoMask('O',std::string(user->nick)+" used oper override to bypass +i on "+std::string(cname)); + ServerInstance->SNO->WriteToSnoMask('O', user->nick+" used oper override to bypass +i on "+std::string(cname)); } return -1; } - if ((*chan->key) && (CanOverride(user,"KEY")) && strcasecmp(keygiven.c_str(), chan->key)) + if ((chan->key.empty()) && (CanOverride(user,"KEY")) && keygiven != chan->key) { if (RequireKey && keygiven != "override") { @@ -264,7 +264,7 @@ class ModuleOverride : public Module if (NoisyOverride) chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel key", cname, user->nick.c_str()); - ServerInstance->SNO->WriteToSnoMask('O',std::string(user->nick)+" used oper override to bypass +k on "+std::string(cname)); + ServerInstance->SNO->WriteToSnoMask('O', user->nick+" used oper override to bypass +k on "+std::string(cname)); return -1; } @@ -279,7 +279,7 @@ class ModuleOverride : public Module if (NoisyOverride) chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel limit", cname, user->nick.c_str()); - ServerInstance->SNO->WriteToSnoMask('O',std::string(user->nick)+" used oper override to bypass +l on "+std::string(cname)); + ServerInstance->SNO->WriteToSnoMask('O', user->nick+" used oper override to bypass +l on "+std::string(cname)); return -1; } diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index 2a7ef4b54..289a73dca 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -65,9 +65,9 @@ class Redirect : public ModeHandler { for (chan_hash::const_iterator i = ServerInstance->chanlist->begin(); i != ServerInstance->chanlist->end(); i++) { - if ((i->second != channel) && (i->second->IsModeSet('L')) && (irc::string(i->second->GetModeParameter('L').c_str()) == irc::string(channel->name))) + if ((i->second != channel) && (i->second->IsModeSet('L')) && (irc::string(i->second->GetModeParameter('L').c_str()) == channel->name)) { - source->WriteNumeric(690, "%s :Circular or chained +L to %s not allowed (Already forwarded here from %s). Angry monkeys dispatched.",source->nick.c_str(),parameter.c_str(),i->second->name); + source->WriteNumeric(690, "%s :Circular or chained +L to %s not allowed (Already forwarded here from %s). Angry monkeys dispatched.",source->nick.c_str(), parameter.c_str(), i->second->name.c_str()); return MODEACTION_DENY; } } diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 9450899ed..f0eff03ca 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -105,7 +105,7 @@ class RemoveBase if (!channel->HasUser(target)) { - user->WriteServ( "NOTICE %s :*** The user %s is not on channel %s", user->nick.c_str(), target->nick.c_str(), channel->name); + user->WriteServ( "NOTICE %s :*** The user %s is not on channel %s", user->nick.c_str(), target->nick.c_str(), channel->name.c_str()); return CMD_FAILURE; } @@ -177,22 +177,22 @@ class RemoveBase /* Build up the part reason string. */ reason = std::string("Removed by ") + user->nick + ": " + reasonparam; - channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s removed %s from the channel", channel->name, user->nick.c_str(), target->nick.c_str()); - target->WriteServ("NOTICE %s :*** %s removed you from %s with the message: %s", target->nick.c_str(), user->nick.c_str(), channel->name, reasonparam.c_str()); + channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s removed %s from the channel", channel->name.c_str(), user->nick.c_str(), target->nick.c_str()); + target->WriteServ("NOTICE %s :*** %s removed you from %s with the message: %s", target->nick.c_str(), user->nick.c_str(), channel->name.c_str(), reasonparam.c_str()); if (!channel->PartUser(target, reason.c_str())) delete channel; } else { - user->WriteServ( "NOTICE %s :*** You do not have access to /remove %s from %s", user->nick.c_str(), target->nick.c_str(), channel->name); + user->WriteServ( "NOTICE %s :*** You do not have access to /remove %s from %s", user->nick.c_str(), target->nick.c_str(), channel->name.c_str()); return CMD_FAILURE; } } else { /* m_nokicks.so was loaded and +Q was set, block! */ - user->WriteServ( "484 %s %s :Can't remove user %s from channel (+Q set)", user->nick.c_str(), channel->name, target->nick.c_str()); + user->WriteServ( "484 %s %s :Can't remove user %s from channel (+Q set)", user->nick.c_str(), channel->name.c_str(), target->nick.c_str()); return CMD_FAILURE; } diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index 007e6f890..e6bb24442 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -185,7 +185,7 @@ class ModuleSafeList : public Module if ((chan) && (chan->modes[CM_PRIVATE]) && (!IS_OPER(user))) { - bool display = (match(chan->name, ld->glob) || (*chan->topic && match(chan->topic, ld->glob))); + bool display = (match(chan->name, ld->glob) || (!chan->topic.empty() && match(chan->topic, ld->glob))); if ((users) && (display)) { int counter = snprintf(buffer, MAXBUF, "322 %s * %ld :", user->nick.c_str(), users); @@ -193,12 +193,12 @@ class ModuleSafeList : public Module user->WriteServ(std::string(buffer)); } } - else if ((chan) && ((((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET])))) || (has_user) || IS_OPER(user))) + else if ((chan) && ((((!(chan->IsModeSet('p'))) && (!(chan->IsModeSet('s'))))) || (has_user) || IS_OPER(user))) { - bool display = (match(chan->name, ld->glob) || (*chan->topic && match(chan->topic, ld->glob))); + bool display = (match(chan->name, ld->glob) || (!chan->topic.empty() && match(chan->topic, ld->glob))); if ((users) && (display)) { - int counter = snprintf(buffer, MAXBUF, "322 %s %s %ld :[+%s] %s",user->nick.c_str(), chan->name, users, chan->ChanModes(has_user || IS_OPER(user)), chan->topic); + int counter = snprintf(buffer, MAXBUF, "322 %s %s %ld :[+%s] %s", user->nick.c_str(), chan->name.c_str(), users, chan->ChanModes(has_user || IS_OPER(user)), chan->topic.c_str()); amount_sent += counter + ServerNameSize; user->WriteServ(std::string(buffer)); } diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index 92c9c6d3a..2ea856db2 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -165,7 +165,7 @@ class ModuleServices : public Module return 0; } // user messaging a +M channel and is not registered - user->WriteNumeric(477, "%s %s :You need a registered nickname to speak on this channel", user->nick.c_str(), c->name); + user->WriteNumeric(477, "%s %s :You need a registered nickname to speak on this channel", user->nick.c_str(), c->name.c_str()); return 1; } } @@ -206,7 +206,7 @@ class ModuleServices : public Module return 0; } // joining a +R channel and not identified - user->WriteNumeric(477, "%s %s :You need a registered nickname to join this channel", user->nick.c_str(), chan->name); + user->WriteNumeric(477, "%s %s :You need a registered nickname to join this channel", user->nick.c_str(), chan->name.c_str()); return 1; } } diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 630aab946..985c86143 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -95,7 +95,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p { std::deque<std::string> param_list; if (Utils->AnnounceTSChange && chan) - chan->WriteChannelWithServ(Instance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name, chan->name, (unsigned long) ourTS, (unsigned long) TS); + chan->WriteChannelWithServ(Instance->Config->ServerName, "NOTICE %s :TS for %s changed from %lu to %lu", chan->name.c_str(), chan->name.c_str(), (unsigned long) ourTS, (unsigned long) TS); ourTS = TS; if (!created) { diff --git a/src/modules/m_spanningtree/ftopic.cpp b/src/modules/m_spanningtree/ftopic.cpp index 80854f3b1..3ea775112 100644 --- a/src/modules/m_spanningtree/ftopic.cpp +++ b/src/modules/m_spanningtree/ftopic.cpp @@ -31,11 +31,11 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque<std::string> & Channel* c = this->Instance->FindChan(params[0]); if (c) { - if ((ts >= c->topicset) || (!*c->topic)) + if ((ts >= c->topicset) || (c->topic.empty())) { std::string oldtopic = c->topic; - strlcpy(c->topic,params[3].c_str(),MAXTOPIC); - strlcpy(c->setby,params[2].c_str(),127); + c->topic.assign(params[3], 0, MAXTOPIC); + c->setby.assign(params[2], 0, 127); c->topicset = ts; /* if the topic text is the same as the current topic, * dont bother to send the TOPIC command out, just silently @@ -46,11 +46,11 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque<std::string> & User* user = this->Instance->FindNick(source); if (!user) { - c->WriteChannelWithServ(Instance->Config->ServerName, "TOPIC %s :%s", c->name, c->topic); + c->WriteChannelWithServ(Instance->Config->ServerName, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str()); } else { - c->WriteChannel(user, "TOPIC %s :%s", c->name, c->topic); + c->WriteChannel(user, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str()); nsource = user->server; } } diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 40718cedb..8444bbec6 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -85,7 +85,7 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c) char list[MAXBUF]; size_t dlen, curlen; - dlen = curlen = snprintf(list,MAXBUF,":%s FJOIN %s %lu +%s",this->Instance->Config->GetSID().c_str(),c->name,(unsigned long)c->age, c->ChanModes(true)); + dlen = curlen = snprintf(list,MAXBUF,":%s FJOIN %s %lu +%s", this->Instance->Config->GetSID().c_str(), c->name.c_str(),(unsigned long)c->age, c->ChanModes(true)); int numusers = 0; char* ptr = list + dlen; bool looped_once = false; @@ -109,7 +109,7 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c) if (curlen > (480-NICKMAX)) { buffer.append(list).append("\r\n"); - dlen = curlen = snprintf(list,MAXBUF,":%s FJOIN %s %lu +%s",this->Instance->Config->GetSID().c_str(),c->name,(unsigned long)c->age, c->ChanModes(true)); + dlen = curlen = snprintf(list,MAXBUF,":%s FJOIN %s %lu +%s", this->Instance->Config->GetSID().c_str(), c->name.c_str(), (unsigned long)c->age, c->ChanModes(true)); ptr = list + dlen; ptrlen = 0; numusers = 0; @@ -193,9 +193,9 @@ void TreeSocket::SendChannelModes(TreeServer* Current) for (chan_hash::iterator c = this->Instance->chanlist->begin(); c != this->Instance->chanlist->end(); c++) { SendFJoins(Current, c->second); - if (*c->second->topic) + if (!c->second->topic.empty()) { - snprintf(data,MAXBUF,":%s FTOPIC %s %lu %s :%s",sn,c->second->name,(unsigned long)c->second->topicset,c->second->setby,c->second->topic); + snprintf(data,MAXBUF,":%s FTOPIC %s %lu %s :%s", sn, c->second->name.c_str(), (unsigned long)c->second->topicset, c->second->setby.c_str(), c->second->topic.c_str()); this->WriteLine(data); } FOREACH_MOD_I(this->Instance,I_OnSyncChannel,OnSyncChannel(c->second,(Module*)Utils->Creator,(void*)this)); diff --git a/src/modules/m_spanningtree/privmsg.cpp b/src/modules/m_spanningtree/privmsg.cpp index 5b2ea865a..cd49001a5 100644 --- a/src/modules/m_spanningtree/privmsg.cpp +++ b/src/modules/m_spanningtree/privmsg.cpp @@ -54,7 +54,7 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string if (s) { FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, channel, TYPE_CHANNEL, text, status, except_list)); - channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name, text.c_str()); + channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name.c_str(), text.c_str()); } } else diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index e8a40e844..5a0298b41 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -37,7 +37,7 @@ class SSLMode : public ModeHandler { if(!i->first->GetExt("ssl", dummy)) { - source->WriteNumeric(490, "%s %s :all members of the channel must be connected via SSL", source->nick.c_str(), channel->name); + source->WriteNumeric(490, "%s %s :all members of the channel must be connected via SSL", source->nick.c_str(), channel->name.c_str()); return MODEACTION_DENY; } } diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 13f9301d2..a2eda3112 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -90,14 +90,14 @@ class CommandTban : public Command T.mask = mask; T.expire = expire; TimedBanList.push_back(T); - channel->WriteAllExcept(user, true, '@', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name, user->nick.c_str(), mask.c_str(), duration); + channel->WriteAllExcept(user, true, '@', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration); if (ServerInstance->Config->AllowHalfop) - channel->WriteAllExcept(user, true, '%', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name, user->nick.c_str(), mask.c_str(), duration); + channel->WriteAllExcept(user, true, '%', tmp, "NOTICE %s :%s added a timed ban on %s lasting for %ld seconds.", channel->name.c_str(), user->nick.c_str(), mask.c_str(), duration); return CMD_SUCCESS; } return CMD_FAILURE; } - else user->WriteNumeric(482, "%s %s :You must be at least a%soperator to change modes on this channel",user->nick.c_str(), channel->name, + else user->WriteNumeric(482, "%s %s :You must be at least a%soperator to change modes on this channel",user->nick.c_str(), channel->name.c_str(), ServerInstance->Config->AllowHalfop ? " half-" : " channel "); return CMD_FAILURE; } @@ -129,7 +129,7 @@ class ModuleTimedBans : public Module virtual int OnDelBan(User* source, Channel* chan, const std::string &banmask) { irc::string listitem = banmask.c_str(); - irc::string thischan = chan->name; + irc::string thischan = chan->name.c_str(); for (timedbans::iterator i = TimedBanList.begin(); i < TimedBanList.end(); i++) { irc::string target = i->mask.c_str(); @@ -164,9 +164,9 @@ class ModuleTimedBans : public Module setban.push_back(mask); CUList empty; - cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name, safei->mask.c_str()); + cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name.c_str(), safei->mask.c_str()); if (ServerInstance->Config->AllowHalfop) - cr->WriteAllExcept(ServerInstance->FakeClient, true, '%', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name, safei->mask.c_str()); + cr->WriteAllExcept(ServerInstance->FakeClient, true, '%', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name.c_str(), safei->mask.c_str()); /* Removes the ban item for us, no ::erase() needed */ ServerInstance->PI->SendModeStr(safei->channel, std::string("-b ") + setban[2]); diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index ed65ce964..d87caea9d 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -50,29 +50,29 @@ class CommandUninvite : public Command { if (c->GetStatus(user) < STATUS_HOP) { - user->WriteNumeric(482, "%s %s :You must be at least a%soperator to change modes on this channel",user->nick.c_str(), c->name, + user->WriteNumeric(482, "%s %s :You must be at least a%soperator to change modes on this channel",user->nick.c_str(), c->name.c_str(), ServerInstance->Config->AllowHalfop ? " half-" : " channel "); return CMD_FAILURE; } } - irc::string xname(c->name); + irc::string xname(c->name.c_str()); if (!u->IsInvited(xname)) { - user->WriteNumeric(491, "%s %s %s :Is not invited to channel %s",user->nick.c_str(),u->nick.c_str(),c->name,c->name); + user->WriteNumeric(491, "%s %s %s :Is not invited to channel %s", user->nick.c_str(), u->nick.c_str(), c->name.c_str(), c->name.c_str()); return CMD_FAILURE; } if (!c->HasUser(user)) { - user->WriteNumeric(492, "%s %s :You're not on that channel!",user->nick.c_str(), c->name); + user->WriteNumeric(492, "%s %s :You're not on that channel!",user->nick.c_str(), c->name.c_str()); return CMD_FAILURE; } u->RemoveInvite(xname); - user->WriteNumeric(494, "%s %s %s :Uninvited",user->nick.c_str(),c->name,u->nick.c_str()); - u->WriteNumeric(493, "%s :You were uninvited from %s by %s",u->nick.c_str(),c->name,user->nick.c_str()); - c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s uninvited %s.", c->name, user->nick.c_str(), u->nick.c_str()); + user->WriteNumeric(494, "%s %s %s :Uninvited", user->nick.c_str(), c->name.c_str(), u->nick.c_str()); + u->WriteNumeric(493, "%s :You were uninvited from %s by %s", u->nick.c_str(), c->name.c_str(), user->nick.c_str()); + c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :*** %s uninvited %s.", c->name.c_str(), user->nick.c_str(), u->nick.c_str()); return CMD_SUCCESS; } |