From 2708eea5d13c249143b83fbaa8b552992f0ac8b6 Mon Sep 17 00:00:00 2001 From: Adam- Date: Mon, 4 Jan 2010 05:45:58 +0000 Subject: Removed NICKMAX and CHANMAX, replaced user->nick, c->name, and ci->name with std::string git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2732 5417fbe8-f217-4b02-8779-1006273d7864 --- src/actions.c | 6 +-- src/bots.cpp | 2 +- src/botserv.c | 41 +++++++++---------- src/channels.c | 87 ++++++++++++++++++++-------------------- src/chanserv.c | 45 +++++++++++---------- src/commands.c | 12 +++--- src/config.c | 8 ++-- src/core/bs_act.c | 6 +-- src/core/bs_assign.c | 2 +- src/core/bs_badwords.c | 22 +++++------ src/core/bs_bot.c | 6 +-- src/core/bs_info.c | 6 +-- src/core/bs_say.c | 6 +-- src/core/bs_set.c | 24 +++++------ src/core/bs_unassign.c | 2 +- src/core/cs_access.c | 42 ++++++++++---------- src/core/cs_akick.c | 56 +++++++++++++------------- src/core/cs_ban.c | 8 ++-- src/core/cs_clear.c | 4 +- src/core/cs_drop.c | 6 +-- src/core/cs_forbid.c | 14 +++---- src/core/cs_info.c | 4 +- src/core/cs_invite.c | 6 +-- src/core/cs_kick.c | 8 ++-- src/core/cs_list.c | 10 ++--- src/core/cs_modes.c | 10 ++--- src/core/cs_register.c | 9 +++-- src/core/cs_set.c | 94 ++++++++++++++++++++++---------------------- src/core/cs_suspend.c | 20 +++++----- src/core/cs_topic.c | 10 ++--- src/core/cs_unban.c | 4 +- src/core/cs_xop.c | 30 +++++++------- src/core/db_plain.cpp | 12 +++--- src/core/hs_del.c | 2 +- src/core/hs_delall.c | 2 +- src/core/hs_set.c | 4 +- src/core/hs_setall.c | 4 +- src/core/ms_cancel.c | 2 +- src/core/ms_check.c | 2 +- src/core/ms_list.c | 4 +- src/core/ms_read.c | 4 +- src/core/ms_sendall.c | 2 +- src/core/ns_access.c | 10 +---- src/core/ns_alist.c | 4 +- src/core/ns_drop.c | 8 ++-- src/core/ns_forbid.c | 8 ++-- src/core/ns_getemail.c | 2 +- src/core/ns_getpass.c | 8 ++-- src/core/ns_ghost.c | 14 +++---- src/core/ns_group.c | 32 +++++++-------- src/core/ns_identify.c | 10 ++--- src/core/ns_logout.c | 2 +- src/core/ns_recover.c | 4 +- src/core/ns_register.c | 40 +++++++++---------- src/core/ns_release.c | 2 +- src/core/ns_resetpass.c | 6 +-- src/core/ns_saset.c | 6 +-- src/core/ns_sendpass.c | 2 +- src/core/ns_set.c | 4 +- src/core/ns_status.c | 27 +++++-------- src/core/ns_suspend.c | 12 +++--- src/core/os_akill.c | 16 +++----- src/core/os_chankill.c | 13 +++--- src/core/os_chanlist.c | 6 +-- src/core/os_clearmodes.c | 2 +- src/core/os_defcon.c | 8 ++-- src/core/os_global.c | 4 +- src/core/os_jupe.c | 4 +- src/core/os_kick.c | 6 +-- src/core/os_mode.c | 2 +- src/core/os_news.c | 8 ++-- src/core/os_noop.c | 8 ++-- src/core/os_oline.c | 4 +- src/core/os_quit.c | 4 +- src/core/os_reload.c | 2 +- src/core/os_restart.c | 4 +- src/core/os_session.c | 4 +- src/core/os_set.c | 8 ++-- src/core/os_sgline.c | 4 +- src/core/os_shutdown.c | 4 +- src/core/os_sqline.c | 4 +- src/core/os_staff.c | 2 +- src/core/os_svsnick.c | 8 ++-- src/core/os_szline.c | 4 +- src/core/os_umode.c | 4 +- src/core/os_userlist.c | 6 +-- src/core/ss_main.c | 2 +- src/hostserv.c | 2 +- src/memoserv.c | 14 +++---- src/messages.c | 2 +- src/misc.c | 4 +- src/modes.cpp | 14 +++---- src/modulemanager.cpp | 4 +- src/modules/cs_appendtopic.c | 10 ++--- src/modules/cs_enforce.c | 14 +++---- src/modules/cs_tban.c | 4 +- src/modules/hs_request.c | 10 ++--- src/nickserv.c | 21 +++++----- src/operserv.c | 4 +- src/protocol.cpp | 6 +-- src/protocol/bahamut.c | 20 +++++----- src/protocol/inspircd11.c | 26 ++++++------ src/protocol/inspircd12.cpp | 30 +++++++------- src/protocol/ratbox.c | 32 +++++++-------- src/protocol/unreal32.c | 22 +++++------ src/regchannel.cpp | 4 +- src/sessions.c | 2 +- src/users.c | 46 +++++++++++----------- 108 files changed, 624 insertions(+), 657 deletions(-) (limited to 'src') diff --git a/src/actions.c b/src/actions.c index 6ed840653..0e15f2cf4 100644 --- a/src/actions.c +++ b/src/actions.c @@ -97,8 +97,8 @@ void sqline(const std::string &mask, const std::string &reason) cunext = cu->next; if (is_oper(cu->user)) continue; - av[0] = c->name; - av[1] = cu->user->nick; + av[0] = c->name.c_str(); + av[1] = cu->user->nick.c_str(); av[2] = reason.c_str(); ircdproto->SendKick(findbot(Config.s_OperServ), c, cu->user, "Q-Lined: %s", av[2]); do_kick(Config.s_ChanServ, 3, av); @@ -158,7 +158,7 @@ void common_unban(ChannelInfo *ci, const std::string &nick) for (ban = ci->c->bans->entries; ban; ban = next) { next = ban->next; - if (entry_match(ban, u->nick, u->GetIdent().c_str(), u->host, ip) || entry_match(ban, u->nick, u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip)) + if (entry_match(ban, u->nick.c_str(), u->GetIdent().c_str(), u->host, ip) || entry_match(ban, u->nick.c_str(), u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip)) ci->c->RemoveMode(NULL, CMODE_BAN, ban->mask); } } diff --git a/src/bots.cpp b/src/bots.cpp index cae202bf2..ddd517b77 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -167,7 +167,7 @@ void BotInfo::UnAssign(User *u, ChannelInfo *ci) if (ci->c && ci->c->usercount >= Config.BSMinUsers) { if (u) - ircdproto->SendPart(ci->bi, ci->c, "UNASSIGN from %s", u->nick); + ircdproto->SendPart(ci->bi, ci->c, "UNASSIGN from %s", u->nick.c_str()); else ircdproto->SendPart(ci->bi, ci->c, ""); } diff --git a/src/botserv.c b/src/botserv.c index bbe3f30c9..f145e7028 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -91,7 +91,7 @@ void botserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { *s = 0; } - ircdproto->SendCTCP(findbot(Config.s_BotServ), u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(Config.s_BotServ), u->nick.c_str(), "PING %s", s); } else { mod_run_cmd(Config.s_BotServ, u, BOTSERV, cmd); } @@ -114,7 +114,7 @@ void botmsgs(User * u, BotInfo * bi, char *buf) if (!(s = strtok(NULL, ""))) { *s = 0; } - ircdproto->SendCTCP(bi, u->nick, "PING %s", s); + ircdproto->SendCTCP(bi, u->nick.c_str(), "PING %s", s); } else if (cmd && bi->cmdTable) { @@ -145,7 +145,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) /* Answer to ping if needed, without breaking the buffer. */ if (!strnicmp(buf, "\1PING", 5)) { - ircdproto->SendCTCP(ci->bi, u->nick, "PING %s", buf); + ircdproto->SendCTCP(ci->bi, u->nick.c_str(), "PING %s", buf); } /* If it's a /me, cut the CTCP part at the beginning (not @@ -409,7 +409,7 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf) /* return if the user is on the ignore list */ - if (get_ignore(u->nick) != NULL) { + if (get_ignore(u->nick.c_str()) != NULL) { return; } @@ -650,7 +650,7 @@ void bot_join(ChannelInfo * ci) "%s invited %s into the channel.", ci->bi->nick, ci->bi->nick); } - ircdproto->SendJoin(ci->bi, ci->c->name, ci->c->creation_time); + ircdproto->SendJoin(ci->bi, ci->c->name.c_str(), ci->c->creation_time); ci->c->SetMode(NULL, CMODE_PROTECT, ci->bi->nick); ci->c->SetMode(NULL, CMODE_OP, ci->bi->nick); FOREACH_MOD(I_OnBotJoin, OnBotJoin(ci, ci->bi)); @@ -707,8 +707,8 @@ static void bot_kick(ChannelInfo * ci, User * u, int message, ...) vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); - av[0] = ci->name; - av[1] = u->nick; + av[0] = ci->name.c_str(); + av[1] = u->nick.c_str(); av[2] = buf; ircdproto->SendKick(ci->bi, ci->c, u, "%s", av[2]); do_kick(ci->bi->nick, 3, av); @@ -732,20 +732,18 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick, if ((ModeManager::FindUserModeByName(UMODE_PROTECTED))) { if (is_protected(u) && (requester != u)) { - ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", - getstring(ACCESS_DENIED)); + ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", getstring(ACCESS_DENIED)); return; } } - if (ci->HasFlag(CI_PEACE) && stricmp(requester->nick, nick) && (get_access(u, ci) >= get_access(requester, ci))) + if (ci->HasFlag(CI_PEACE) && stricmp(requester->nick.c_str(), nick) && (get_access(u, ci) >= get_access(requester, ci))) return; if (ModeManager::FindChannelModeByName(CMODE_EXCEPT)) { if (is_excepted(ci, u) == 1) { - ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", - getstring(BOT_EXCEPT)); + ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", getstring(BOT_EXCEPT)); return; } } @@ -754,7 +752,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick, ci->c->SetMode(NULL, CMODE_BAN, mask); - kav[0] = ci->name; + kav[0] = ci->name.c_str(); kav[1] = nick; if (!reason) { @@ -767,7 +765,7 @@ void bot_raw_ban(User * requester, ChannelInfo * ci, char *nick, /* Check if we need to do a signkick or not -GD */ if ((ci->HasFlag(CI_SIGNKICK) || ci->HasFlag(CI_SIGNKICK_LEVEL)) && !check_access(requester, ci, CA_SIGNKICK)) - ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", kav[2], requester->nick); + ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", kav[2], requester->nick.c_str()); else ircdproto->SendKick(ci->bi, ci->c, u, "%s", kav[2]); @@ -791,16 +789,15 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick, if ((ModeManager::FindUserModeByName(UMODE_PROTECTED))) { if (is_protected(u) && (requester != u)) { - ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", - getstring(ACCESS_DENIED)); + ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", getstring(ACCESS_DENIED)); return; } } - if (ci->HasFlag(CI_PEACE) && stricmp(requester->nick, nick) && (get_access(u, ci) >= get_access(requester, ci))) + if (ci->HasFlag(CI_PEACE) && stricmp(requester->nick.c_str(), nick) && (get_access(u, ci) >= get_access(requester, ci))) return; - av[0] = ci->name; + av[0] = ci->name.c_str(); av[1] = nick; if (!reason) { @@ -812,7 +809,7 @@ void bot_raw_kick(User * requester, ChannelInfo * ci, char *nick, } if (ci->HasFlag(CI_SIGNKICK) || ((ci->HasFlag(CI_SIGNKICK_LEVEL)) && !check_access(requester, ci, CA_SIGNKICK))) - ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", av[2], requester->nick); + ircdproto->SendKick(ci->bi, ci->c, u, "%s (%s)", av[2], requester->nick.c_str()); else ircdproto->SendKick(ci->bi, ci->c, u, "%s", av[2]); do_kick(ci->bi->nick, 3, av); @@ -839,15 +836,13 @@ void bot_raw_mode(User * requester, ChannelInfo * ci, const char *mode, if ((ModeManager::FindUserModeByName(UMODE_PROTECTED))) { if (is_protected(u) && *mode == '-' && (requester != u)) { - ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", - getstring(ACCESS_DENIED)); + ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", getstring(ACCESS_DENIED)); return; } } if (*mode == '-' && ci->HasFlag(CI_PEACE) - && stricmp(requester->nick, nick) - && (get_access(u, ci) >= get_access(requester, ci))) + && stricmp(requester->nick.c_str(), nick) && (get_access(u, ci) >= get_access(requester, ci))) return; ci->c->SetModes(NULL, "%s %s", mode, nick); diff --git a/src/channels.c b/src/channels.c index 79f956581..5e9ca98de 100644 --- a/src/channels.c +++ b/src/channels.c @@ -33,7 +33,7 @@ Channel::Channel(const std::string &name, time_t ts) if (name.empty()) throw CoreException("A channel without a name ?"); - strscpy(this->name, name.c_str(), sizeof(this->name)); + this->name = name; list = &chanlist[HASH(this->name)]; this->prev = NULL; this->next = *list; @@ -43,7 +43,6 @@ Channel::Channel(const std::string &name, time_t ts) this->creation_time = ts; this->topic = NULL; - *this->topic_setter = 0; this->bans = this->excepts = this->invites = NULL; this->users = NULL; this->usercount = 0; @@ -51,7 +50,7 @@ Channel::Channel(const std::string &name, time_t ts) this->server_modetime = this->chanserv_modetime = 0; this->server_modecount = this->chanserv_modecount = this->bouncy_modes = this->topic_sync = 0; - this->ci = cs_findchan(this->name); + this->ci = cs_findchan(this->name.c_str()); if (this->ci) { this->ci->c = this; @@ -75,7 +74,7 @@ Channel::~Channel() FOREACH_MOD(I_OnChannelDelete, OnChannelDelete(this)); if (debug) - alog("debug: Deleting channel %s", this->name); + alog("debug: Deleting channel %s", this->name.c_str()); for (bd = this->bd; bd; bd = next) { @@ -148,7 +147,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En { if (param.empty()) { - alog("Channel::SetModeInternal() mode %c with no parameter for channel %s", cm->ModeChar, this->name); + alog("Channel::SetModeInternal() mode %c with no parameter for channel %s", cm->ModeChar, this->name.c_str()); return; } @@ -160,12 +159,12 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En if (!u) { if (debug) - alog("debug: MODE %s +%c for nonexistant user %s", this->name, cm->ModeChar, param.c_str()); + alog("debug: MODE %s +%c for nonexistant user %s", this->name.c_str(), cm->ModeChar, param.c_str()); return; } if (debug) - alog("debug: Setting +%c on %s for %s", cm->ModeChar, this->name, u->nick); + alog("debug: Setting +%c on %s for %s", cm->ModeChar, this->name.c_str(), u->nick.c_str()); ChannelModeStatus *cms = dynamic_cast(cm); /* Set the new status on the user */ @@ -179,7 +178,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En { if (param.empty()) { - alog("Channel::SetModeInternal() mode %c with no parameter for channel %s", cm->ModeChar, this->name); + alog("Channel::SetModeInternal() mode %c with no parameter for channel %s", cm->ModeChar, this->name.c_str()); return; } @@ -194,7 +193,7 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En { if (cm->Type != MODE_PARAM) { - alog("Channel::SetModeInternal() mode %c for %s with a paramater, but its not a param mode", cm->ModeChar, this->name); + alog("Channel::SetModeInternal() mode %c for %s with a paramater, but its not a param mode", cm->ModeChar, this->name.c_str()); return; } @@ -280,7 +279,7 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string ¶m, bool { if (param.empty()) { - alog("Channel::RemoveModeInternal() mode %c with no parameter for channel %s", cm->ModeChar, this->name); + alog("Channel::RemoveModeInternal() mode %c with no parameter for channel %s", cm->ModeChar, this->name.c_str()); return; } @@ -291,12 +290,12 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string ¶m, bool User *u = finduser(param); if (!u) { - alog("Channel::RemoveModeInternal() MODE %s +%c for nonexistant user %s", this->name, cm->ModeChar, param.c_str()); + alog("Channel::RemoveModeInternal() MODE %s +%c for nonexistant user %s", this->name.c_str(), cm->ModeChar, param.c_str()); return; } if (debug) - alog("debug: Setting +%c on %s for %s", cm->ModeChar, this->name, u->nick); + alog("debug: Setting +%c on %s for %s", cm->ModeChar, this->name.c_str(), u->nick.c_str()); ChannelModeStatus *cms = dynamic_cast(cm); chan_remove_user_status(this, u, cms->Status); @@ -307,7 +306,7 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string ¶m, bool { if (param.empty()) { - alog("Channel::RemoveModeInternal() mode %c with no parameter for channel %s", cm->ModeChar, this->name); + alog("Channel::RemoveModeInternal() mode %c with no parameter for channel %s", cm->ModeChar, this->name.c_str()); return; } @@ -859,7 +858,7 @@ void chan_remove_user_status(Channel * chan, User * user, int16 status) if (debug >= 2) alog("debug: removing user status (%d) from %s for %s", status, - user->nick, chan->name); + user->nick.c_str(), chan->name.c_str()); for (uc = user->chans; uc; uc = uc->next) { if (uc->chan == chan) { @@ -880,14 +879,14 @@ void chan_set_user_status(Channel * chan, User * user, int16 status) if (debug >= 2) alog("debug: setting user status (%d) on %s for %s", status, - user->nick, chan->name); + user->nick.c_str(), chan->name.c_str()); if (Config.HelpChannel && ((um = ModeManager::FindUserModeByName(UMODE_HELPOP))) && (status & CUS_OP) - && (stricmp(chan->name, Config.HelpChannel) == 0) + && (stricmp(chan->name.c_str(), Config.HelpChannel) == 0) && (!chan->ci || check_access(user, chan->ci, CA_AUTOOP))) { if (debug) { alog("debug: %s being given helpop for having %d status in %s", - user->nick, status, chan->name); + user->nick.c_str(), status, chan->name.c_str()); } user->SetMode(NULL, um); @@ -922,7 +921,7 @@ Channel *findchan(const char *chan) alog("debug: findchan(%p)", chan); c = chanlist[HASH(chan)]; while (c) { - if (stricmp(c->name, chan) == 0) { + if (stricmp(c->name.c_str(), chan) == 0) { if (debug >= 3) alog("debug: findchan(%s) -> %p", chan, static_cast(c)); return c; @@ -950,7 +949,7 @@ Channel *firstchan() current = chanlist[next_index++]; if (debug >= 3) alog("debug: firstchan() returning %s", - current ? current->name : "NULL (end of list)"); + current ? current->name.c_str() : "NULL (end of list)"); return current; } @@ -964,7 +963,7 @@ Channel *nextchan() } if (debug >= 3) alog("debug: nextchan() returning %s", - current ? current->name : "NULL (end of list)"); + current ? current->name.c_str() : "NULL (end of list)"); return current; } @@ -1093,7 +1092,7 @@ void do_join(const char *source, int ac, const char **av) c = user->chans; while (c) { nextc = c->next; - channame = sstrdup(c->chan->name); + channame = sstrdup(c->chan->name.c_str()); FOREACH_MOD(I_OnPrePartChannel, OnPrePartChannel(user, c->chan)); chan_deluser(user, c->chan); FOREACH_MOD(I_OnPartChannel, OnPartChannel(user, findchan(channame), channame, "")); @@ -1179,9 +1178,9 @@ void do_kick(const char *source, int ac, const char **av) continue; } if (debug) { - alog("debug: kicking %s from %s", user->nick, av[0]); + alog("debug: kicking %s from %s", user->nick.c_str(), av[0]); } - for (c = user->chans; c && stricmp(av[0], c->chan->name) != 0; + for (c = user->chans; c && stricmp(av[0], c->chan->name.c_str()) != 0; c = c->next); if (c) { @@ -1232,7 +1231,7 @@ void do_part(const char *source, int ac, const char **av) *t++ = 0; if (debug) alog("debug: %s leaves %s", source, s); - for (c = user->chans; c && stricmp(s, c->chan->name) != 0; + for (c = user->chans; c && stricmp(s, c->chan->name.c_str()) != 0; c = c->next); if (c) { if (!c->chan) { @@ -1457,14 +1456,14 @@ void do_sjoin(const char *source, int ac, const char **av) int i; for (i = 1; i < end2 - cubuf; i++) - modes[i] = user->nick; + modes[i] = user->nick.c_str(); ChanSetInternalModes(c, 1 + (end2 - cubuf - 1), modes); } if (c->ci && (!serv || is_sync(serv)) && !c->topic_sync) - restore_topic(c->name); + restore_topic(c->name.c_str()); chan_set_correct_modes(user, c, 1); FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(user, c)); @@ -1543,7 +1542,7 @@ void do_sjoin(const char *source, int ac, const char **av) int i; for (i = 1; i < end2 - cubuf; i++) - modes[i] = user->nick; + modes[i] = user->nick.c_str(); ChanSetInternalModes(c, 1 + (end2 - cubuf - 1), modes); } @@ -1618,7 +1617,7 @@ void do_sjoin(const char *source, int ac, const char **av) int i; for (i = 1; i < end2 - cubuf; i++) - modes[i] = user->nick; + modes[i] = user->nick.c_str(); ChanSetInternalModes(c, 1 + (end2 - cubuf - 1), modes); } @@ -1664,7 +1663,7 @@ void do_sjoin(const char *source, int ac, const char **av) c = join_user_update(user, c, av[1], ts); if (is_created && c->ci) - restore_topic(c->name); + restore_topic(c->name.c_str()); chan_set_correct_modes(user, c, 1); FOREACH_MOD(I_OnJoinChannel, OnJoinChannel(user, c)); @@ -1791,7 +1790,7 @@ void do_topic(const char *source, int ac, const char **av) */ if ((ac > 3) && *av[3] && ci && ci->last_topic && (strcmp(av[3], ci->last_topic) == 0) - && (strcmp(topicsetter, ci->last_topic_setter) == 0)) { + && (strcmp(topicsetter, ci->last_topic_setter.c_str()) == 0)) { delete [] topicsetter; return; } @@ -1809,7 +1808,7 @@ void do_topic(const char *source, int ac, const char **av) c->topic = sstrdup(av[3]); } - strscpy(c->topic_setter, topicsetter, sizeof(c->topic_setter)); + c->topic_setter = topicsetter; c->topic_time = topic_time; delete [] topicsetter; @@ -1848,20 +1847,20 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes) if (!c || !(ci = c->ci)) return; - if ((ci->HasFlag(CI_FORBIDDEN)) || (*(c->name) == '+')) + if ((ci->HasFlag(CI_FORBIDDEN)) || (*(c->name.c_str()) == '+')) return; status = chan_get_user_status(c, user); if (debug) - alog("debug: Setting correct user modes for %s on %s (current status: %d, %sgiving modes)", user->nick, c->name, status, (give_modes ? "" : "not ")); + alog("debug: Setting correct user modes for %s on %s (current status: %d, %sgiving modes)", user->nick.c_str(), c->name.c_str(), status, (give_modes ? "" : "not ")); /* Changed the second line of this if a bit, to make sure unregistered * users can always get modes (IE: they always have autoop enabled). Before * this change, you were required to have a registered nick to be able * to receive modes. I wonder who added that... *looks at Rob* ;) -GD */ - if (give_modes && (get_ignore(user->nick) == NULL) + if (give_modes && (get_ignore(user->nick.c_str()) == NULL) && (!user->nc || !user->nc->HasFlag(NI_AUTOOP))) { if (owner && check_access(user, ci, CA_AUTOOWNER)) add_modes |= CUS_OWNER; @@ -1986,21 +1985,21 @@ void chan_adduser2(User * user, Channel * c) u->ud = NULL; c->usercount++; - if (get_ignore(user->nick) == NULL) { + if (get_ignore(user->nick.c_str()) == NULL) { if (c->ci && (check_access(user, c->ci, CA_MEMO)) && (c->ci->memos.memos.size() > 0)) { if (c->ci->memos.memos.size() == 1) { notice_lang(Config.s_MemoServ, user, MEMO_X_ONE_NOTICE, - c->ci->memos.memos.size(), c->ci->name); + c->ci->memos.memos.size(), c->ci->name.c_str()); } else { notice_lang(Config.s_MemoServ, user, MEMO_X_MANY_NOTICE, - c->ci->memos.memos.size(), c->ci->name); + c->ci->memos.memos.size(), c->ci->name.c_str()); } } /* Added channelname to entrymsg - 30.03.2004, Certus */ /* Also, don't send the entrymsg when bursting -GD */ if (c->ci && c->ci->entry_message && is_sync(user->server)) - user->SendMessage(whosends(c->ci)->nick, "[%s] %s", c->name, c->ci->entry_message); + user->SendMessage(whosends(c->ci)->nick, "[%s] %s", c->name.c_str(), c->ci->entry_message); } /** @@ -2025,7 +2024,7 @@ void chan_adduser2(User * user, Channel * c) * recovers from a netsplit. -GD */ if (is_sync(user->server)) { - ircdproto->SendPrivmsg(c->ci->bi, c->name, "[%s] %s", + ircdproto->SendPrivmsg(c->ci->bi, c->name.c_str(), "[%s] %s", user->nc->display, user->nc->greet); c->ci->bi->lastmsg = time(NULL); } @@ -2075,7 +2074,7 @@ Channel *join_user_update(User * user, Channel * chan, const char *name, } if (debug) - alog("debug: %s joins %s", user->nick, chan->name); + alog("debug: %s joins %s", user->nick.c_str(), chan->name.c_str()); c = new u_chanlist; c->prev = NULL; @@ -2118,7 +2117,7 @@ void restore_unsynced_topics() for (c = firstchan(); c; c = nextchan()) { if (!(c->topic_sync)) - restore_topic(c->name); + restore_topic(c->name.c_str()); } } @@ -2479,11 +2478,11 @@ Entry *elist_match_user(EList * list, User * u) ip = str_is_ip(host); /* Match what we ve got against the lists.. */ - res = elist_match(list, u->nick, u->GetIdent().c_str(), u->host, ip); + res = elist_match(list, u->nick.c_str(), u->GetIdent().c_str(), u->host, ip); if (!res) - res = elist_match(list, u->nick, u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip); + res = elist_match(list, u->nick.c_str(), u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip); if (!res && !u->GetCloakedHost().empty() && u->GetCloakedHost() != u->GetDisplayedHost()) - res = elist_match(list, u->nick, u->GetIdent().c_str(), u->GetCloakedHost().c_str(), ip); + res = elist_match(list, u->nick.c_str(), u->GetIdent().c_str(), u->GetCloakedHost().c_str(), ip); if (host) delete [] host; diff --git a/src/chanserv.c b/src/chanserv.c index c0f8ac9bb..a9ab953fc 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -296,7 +296,7 @@ void chanserv(User * u, char *buf) if (!(s = strtok(NULL, ""))) { *s = 0; } - ircdproto->SendCTCP(findbot(Config.s_ChanServ), u->nick, "PING %s", s); + ircdproto->SendCTCP(findbot(Config.s_ChanServ), u->nick.c_str(), "PING %s", s); } else { mod_run_cmd(Config.s_ChanServ, u, CHANSERV, cmd); } @@ -330,8 +330,8 @@ void check_modes(Channel *c) /* Check for mode bouncing */ if (c->server_modecount >= 3 && c->chanserv_modecount >= 3) { - ircdproto->SendGlobops(NULL, "Warning: unable to set modes on channel %s. Are your servers' U:lines configured correctly?", c->name); - alog("%s: Bouncy modes on channel %s", Config.s_ChanServ, c->name); + ircdproto->SendGlobops(NULL, "Warning: unable to set modes on channel %s. Are your servers' U:lines configured correctly?", c->name.c_str()); + alog("%s: Bouncy modes on channel %s", Config.s_ChanServ, c->name.c_str()); c->bouncy_modes = 1; return; } @@ -669,7 +669,7 @@ int check_kick(User * user, const char *chan, time_t chants) && match_usermask(akick->mask.c_str(), user))) { if (debug >= 2) - alog("debug: %s matched akick %s", user->nick, akick->HasFlag(AK_ISNICK) ? akick->nc->display : akick->mask.c_str()); + alog("debug: %s matched akick %s", user->nick.c_str(), akick->HasFlag(AK_ISNICK) ? akick->nc->display : akick->mask.c_str()); if (akick->HasFlag(AK_ISNICK)) get_idealban(ci, user, mask, sizeof(mask)); else @@ -690,7 +690,7 @@ int check_kick(User * user, const char *chan, time_t chants) kick: if (debug) - alog("debug: channel: AutoKicking %s!%s@%s from %s", user->nick, + alog("debug: channel: AutoKicking %s!%s@%s from %s", user->nick.c_str(), user->GetIdent().c_str(), user->host, chan); /* Remember that the user has not been added to our channel user list @@ -750,7 +750,7 @@ void record_topic(const char *chan) else ci->last_topic = NULL; - strscpy(ci->last_topic_setter, c->topic_setter, NICKMAX); + ci->last_topic_setter = c->topic_setter; ci->last_topic_time = c->topic_time; } @@ -772,7 +772,7 @@ void restore_topic(const char *chan) * should be updated with a TOPIC from the IRCd soon. -GD */ ci->last_topic = NULL; - strscpy(ci->last_topic_setter, whosends(ci)->nick, NICKMAX); + ci->last_topic_setter = whosends(ci)->nick; ci->last_topic_time = time(NULL); return; } @@ -780,11 +780,11 @@ void restore_topic(const char *chan) delete [] c->topic; if (ci->last_topic) { c->topic = sstrdup(ci->last_topic); - strscpy(c->topic_setter, ci->last_topic_setter, NICKMAX); + c->topic_setter = ci->last_topic_setter; c->topic_time = ci->last_topic_time; } else { c->topic = NULL; - strscpy(c->topic_setter, whosends(ci)->nick, NICKMAX); + c->topic_setter = whosends(ci)->nick; } if (ircd->join2set) { if (whosends(ci) == findbot(Config.s_ChanServ)) { @@ -792,7 +792,7 @@ void restore_topic(const char *chan) c->SetMode(NULL, CMODE_OP, Config.s_ChanServ); } } - ircdproto->SendTopic(whosends(ci), c, c->topic_setter, c->topic ? c->topic : ""); + ircdproto->SendTopic(whosends(ci), c, c->topic_setter.c_str(), c->topic ? c->topic : ""); if (ircd->join2set) { if (whosends(ci) == findbot(Config.s_ChanServ)) { ircdproto->SendPart(findbot(Config.s_ChanServ), c, NULL); @@ -823,12 +823,12 @@ int check_topiclock(Channel * c, time_t topic_time) delete [] c->topic; if (ci->last_topic) { c->topic = sstrdup(ci->last_topic); - strscpy(c->topic_setter, ci->last_topic_setter, NICKMAX); + c->topic_setter = ci->last_topic_setter; } else { c->topic = NULL; /* Bot assigned & Symbiosis ON?, the bot will set the topic - doc */ /* Altough whosends() also checks for Config.BSMinUsers -GD */ - strscpy(c->topic_setter, whosends(ci)->nick, NICKMAX); + c->topic_setter = whosends(ci)->nick; } if (ircd->topictsforward) { @@ -849,12 +849,12 @@ int check_topiclock(Channel * c, time_t topic_time) if (ircd->join2set) { if (whosends(ci) == findbot(Config.s_ChanServ)) { - ircdproto->SendJoin(findbot(Config.s_ChanServ), c->name, c->creation_time); + ircdproto->SendJoin(findbot(Config.s_ChanServ), c->name.c_str(), c->creation_time); c->SetMode(NULL, CMODE_OP, Config.s_ChanServ); } } - ircdproto->SendTopic(whosends(ci), c, c->topic_setter, c->topic ? c->topic : ""); + ircdproto->SendTopic(whosends(ci), c, c->topic_setter.c_str(), c->topic ? c->topic : ""); if (ircd->join2set) { if (whosends(ci) == findbot(Config.s_ChanServ)) { @@ -887,8 +887,8 @@ void expire_chans() if (MOD_RESULT == EVENT_STOP) continue; - char *chname = sstrdup(ci->name); - alog("Expiring channel %s (founder: %s)", ci->name, + char *chname = sstrdup(ci->name.c_str()); + alog("Expiring channel %s (founder: %s)", ci->name.c_str(), (ci->founder ? ci->founder->display : "(none)")); delete ci; FOREACH_MOD(I_OnChanExpire, OnChanExpire(chname)); @@ -916,17 +916,17 @@ void cs_remove_nick(const NickCore * nc) if (ci->successor) { NickCore *nc2 = ci->successor; if (!nc2->IsServicesOper() && Config.CSMaxReg && nc2->channelcount >= Config.CSMaxReg) { - alog("%s: Successor (%s) of %s owns too many channels, " "deleting channel", Config.s_ChanServ, nc2->display, ci->name); + alog("%s: Successor (%s) of %s owns too many channels, " "deleting channel", Config.s_ChanServ, nc2->display, ci->name.c_str()); delete ci; continue; } else { - alog("%s: Transferring foundership of %s from deleted " "nick %s to successor %s", Config.s_ChanServ, ci->name, nc->display, nc2->display); + alog("%s: Transferring foundership of %s from deleted " "nick %s to successor %s", Config.s_ChanServ, ci->name.c_str(), nc->display, nc2->display); ci->founder = nc2; ci->successor = NULL; nc2->channelcount++; } } else { - alog("%s: Deleting channel %s owned by deleted nick %s", Config.s_ChanServ, ci->name, nc->display); + alog("%s: Deleting channel %s owned by deleted nick %s", Config.s_ChanServ, ci->name.c_str(), nc->display); if ((ModeManager::FindChannelModeByName(CMODE_REGISTERED))) { @@ -981,7 +981,7 @@ ChannelInfo *cs_findchan(const char *chan) for (ci = chanlists[static_cast(tolower(chan[1]))]; ci; ci = ci->next) { - if (stricmp(ci->name, chan) == 0) + if (stricmp(ci->name.c_str(), chan) == 0) return ci; } return NULL; @@ -1035,7 +1035,6 @@ int check_access(User * user, ChannelInfo * ci, int what) void alpha_insert_chan(ChannelInfo * ci) { ChannelInfo *ptr, *prev; - char *chan; if (!ci) { if (debug) { @@ -1044,10 +1043,10 @@ void alpha_insert_chan(ChannelInfo * ci) return; } - chan = ci->name; + const char *chan = ci->name.c_str(); for (prev = NULL, ptr = chanlists[static_cast(tolower(chan[1]))]; - ptr != NULL && stricmp(ptr->name, chan) < 0; + ptr != NULL && stricmp(ptr->name.c_str(), chan) < 0; prev = ptr, ptr = ptr->next); ci->prev = prev; ci->next = ptr; diff --git a/src/commands.c b/src/commands.c index 0bbf23ba6..553bc2442 100644 --- a/src/commands.c +++ b/src/commands.c @@ -71,7 +71,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char * if (!nick_identified(u)) { notice_lang(service, u, NICK_IDENTIFY_REQUIRED, Config.s_NickServ); - alog("Access denied for unregistered user %s with service %s and command %s", u->nick, service, cmd); + alog("Access denied for unregistered user %s with service %s and command %s", u->nick.c_str(), service, cmd); return; } } @@ -120,16 +120,16 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char * { if ((ci->HasFlag(CI_FORBIDDEN)) && (!c->HasFlag(CFLAG_ALLOW_FORBIDDEN))) { - notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name); + notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name.c_str()); alog("Access denied for user %s with service %s and command %s because of FORBIDDEN channel %s", - u->nick, service, cmd, ci->name); + u->nick.c_str(), service, cmd, ci->name.c_str()); return; } else if ((ci->HasFlag(CI_SUSPENDED)) && (!c->HasFlag(CFLAG_ALLOW_SUSPENDED))) { - notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name); + notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name.c_str()); alog("Access denied for user %s with service %s and command %s because of SUSPENDED channel %s", - u->nick, service, cmd, ci->name); + u->nick.c_str(), service, cmd, ci->name.c_str()); return; } } @@ -153,7 +153,7 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char * if (!u->nc->HasCommand(c->permission)) { notice_lang(service, u, ACCESS_DENIED); - alog("Access denied for user %s with service %s and command %s", u->nick, service, cmd); + alog("Access denied for user %s with service %s and command %s", u->nick.c_str(), service, cmd); return; } diff --git a/src/config.c b/src/config.c index 85eeed357..07001aea9 100644 --- a/src/config.c +++ b/src/config.c @@ -314,12 +314,12 @@ bool ValidateNickLen(ServerConfig *, const char *, const char *, ValueItem &data { alog("You have not defined the directive. It is strongly"); alog("adviced that you do configure this correctly in your services.conf"); - data.Set(NICKMAX - 1); + data.Set(31); } - else if (nicklen < 1 || nicklen >= NICKMAX) + else if (nicklen < 1) { - alog(" has an invalid value; setting to %d", NICKMAX - 1); - data.Set(NICKMAX - 1); + alog(" has an invalid value; setting to %d", 31); + data.Set(31); } return true; } diff --git a/src/core/bs_act.c b/src/core/bs_act.c index e321c37a9..a22748515 100644 --- a/src/core/bs_act.c +++ b/src/core/bs_act.c @@ -41,7 +41,7 @@ class CommandBSAct : public Command if (!ci->c || ci->c->usercount < Config.BSMinUsers) { - notice_lang(Config.s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name); + notice_lang(Config.s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name.c_str()); return MOD_CONT; } @@ -49,10 +49,10 @@ class CommandBSAct : public Command while ((i = message.find_first_of("\001"), i) && i != std::string::npos) message.erase(i, 1); - ircdproto->SendAction(ci->bi, ci->name, "%s", message.c_str()); + ircdproto->SendAction(ci->bi, ci->name.c_str(), "%s", message.c_str()); ci->bi->lastmsg = time(NULL); if (Config.LogBot && Config.LogChannel && LogChan && !debug && findchan(Config.LogChannel)) - ircdproto->SendPrivmsg(ci->bi, Config.LogChannel, "ACT %s %s %s", u->nick, ci->name, message.c_str()); + ircdproto->SendPrivmsg(ci->bi, Config.LogChannel, "ACT %s %s %s", u->nick.c_str(), ci->name.c_str(), message.c_str()); return MOD_CONT; } diff --git a/src/core/bs_assign.c b/src/core/bs_assign.c index 30b7ef647..56912559e 100644 --- a/src/core/bs_assign.c +++ b/src/core/bs_assign.c @@ -62,7 +62,7 @@ class CommandBSAssign : public Command } bi->Assign(u, ci); - notice_lang(Config.s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick, ci->name); + notice_lang(Config.s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick, ci->name.c_str()); return MOD_CONT; } diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c index 06f4eedd0..89de294b8 100644 --- a/src/core/bs_badwords.c +++ b/src/core/bs_badwords.c @@ -28,7 +28,7 @@ class CommandBSBadwords : public Command if (!ci->GetBadWordCount()) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_LIST_EMPTY, ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_LIST_EMPTY, ci->name.c_str()); return MOD_CONT; } if (!word.empty() && strspn(word.c_str(), "1234567890,-") == word.length()) @@ -48,7 +48,7 @@ class CommandBSBadwords : public Command } } if (!sent_header) - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); return MOD_CONT; } @@ -87,14 +87,14 @@ class CommandBSBadwords : public Command if (!bw->word.empty() && (Config.BSCaseSensitive && !stricmp(bw->word.c_str(), realword.c_str()) || (!Config.BSCaseSensitive && bw->word == realword.c_str()))) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_ALREADY_EXISTS, bw->word.c_str(), ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_ALREADY_EXISTS, bw->word.c_str(), ci->name.c_str()); return MOD_CONT; } } ci->AddBadWord(realword.c_str(), type); - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_ADDED, realword.c_str(), ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_ADDED, realword.c_str(), ci->name.c_str()); return MOD_CONT; } @@ -111,20 +111,20 @@ class CommandBSBadwords : public Command { if (count == 1) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_SUCH_ENTRY, last, ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_SUCH_ENTRY, last, ci->name.c_str()); } else { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); } } else if (deleted == 1) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED_ONE, ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED_ONE, ci->name.c_str()); } else { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED_SEVERAL, deleted, ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED_SEVERAL, deleted, ci->name.c_str()); } if (deleted) @@ -145,13 +145,13 @@ class CommandBSBadwords : public Command if (i == ci->GetBadWordCount()) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NOT_FOUND, word.c_str(), ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_NOT_FOUND, word.c_str(), ci->name.c_str()); return MOD_CONT; } ci->EraseBadWord(badword); - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED, badword->word.c_str(), ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_DELETED, badword->word.c_str(), ci->name.c_str()); } return MOD_CONT; @@ -261,7 +261,7 @@ int badwords_list(User * u, int index, ChannelInfo * ci, int *sent_header) if (!*sent_header) { - notice_lang(Config.s_BotServ, u, BOT_BADWORDS_LIST_HEADER, ci->name); + notice_lang(Config.s_BotServ, u, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); *sent_header = 1; } diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c index 2c0195ee4..0d057849e 100644 --- a/src/core/bs_bot.c +++ b/src/core/bs_bot.c @@ -58,7 +58,7 @@ class CommandBSBot : public Command return MOD_CONT; } - for (ch = nick; *ch && (ch - nick) < NICKMAX; ch++) + for (ch = nick; *ch && (ch - nick) < Config.NickLen; ch++) { if (!isvalidnick(*ch)) { @@ -190,7 +190,7 @@ class CommandBSBot : public Command return MOD_CONT; } - for (ch = nick; *ch && (ch - nick) < NICKMAX; ch++) + for (ch = nick; *ch && (ch - nick) < Config.NickLen; ch++) { if (!isvalidnick(*ch)) { @@ -322,7 +322,7 @@ class CommandBSBot : public Command FOREACH_MOD(I_OnBotDelete, OnBotDelete(bi)); - ircdproto->SendQuit(bi, "Quit: Help! I'm being deleted by %s!", u->nick); + ircdproto->SendQuit(bi, "Quit: Help! I'm being deleted by %s!", u->nick.c_str()); ircdproto->SendSQLineDel(bi->nick); delete bi; diff --git a/src/core/bs_info.c b/src/core/bs_info.c index 2f2afb2d8..5cb89c673 100644 --- a/src/core/bs_info.c +++ b/src/core/bs_info.c @@ -30,14 +30,14 @@ class CommandBSInfo : public Command for (i = 0; i < 256; i++) { for (ci = chanlists[i]; ci; ci = ci->next) { if (ci->bi == bi) { - if (strlen(buf) + strlen(ci->name) > 300) { + if (strlen(buf) + strlen(ci->name.c_str()) > 300) { u->SendMessage(Config.s_BotServ, "%s", buf); *buf = 0; end = buf; } end += snprintf(end, sizeof(buf) - (end - buf), " %s ", - ci->name); + ci->name.c_str()); } } } @@ -86,7 +86,7 @@ class CommandBSInfo : public Command return MOD_CONT; } - notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_HEADER, ci->name); + notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_HEADER, ci->name.c_str()); if (ci->bi) notice_lang(Config.s_BotServ, u, BOT_INFO_CHAN_BOT, ci->bi->nick); else diff --git a/src/core/bs_say.c b/src/core/bs_say.c index 7143da298..c1021c79d 100644 --- a/src/core/bs_say.c +++ b/src/core/bs_say.c @@ -45,7 +45,7 @@ class CommandBSSay : public Command if (!ci->c || ci->c->usercount < Config.BSMinUsers) { - notice_lang(Config.s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name); + notice_lang(Config.s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name.c_str()); return MOD_CONT; } @@ -55,10 +55,10 @@ class CommandBSSay : public Command return MOD_CONT; } - ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", text); + ircdproto->SendPrivmsg(ci->bi, ci->name.c_str(), "%s", text); ci->bi->lastmsg = time(NULL); if (Config.LogBot && Config.LogChannel && LogChan && !debug && findchan(Config.LogChannel)) - ircdproto->SendPrivmsg(ci->bi, Config.LogChannel, "SAY %s %s %s", u->nick, ci->name, text); + ircdproto->SendPrivmsg(ci->bi, Config.LogChannel, "SAY %s %s %s", u->nick.c_str(), ci->name.c_str(), text); return MOD_CONT; } diff --git a/src/core/bs_set.c b/src/core/bs_set.c index 91c69122b..deffc5833 100644 --- a/src/core/bs_set.c +++ b/src/core/bs_set.c @@ -70,11 +70,11 @@ class CommandBSSet : public Command if (value == "ON") { ci->botflags.SetFlag(BS_DONTKICKOPS); notice_lang(Config.s_BotServ, u, BOT_SET_DONTKICKOPS_ON, - ci->name); + ci->name.c_str()); } else if (value == "OFF") { ci->botflags.UnsetFlag(BS_DONTKICKOPS); notice_lang(Config.s_BotServ, u, BOT_SET_DONTKICKOPS_OFF, - ci->name); + ci->name.c_str()); } else { syntax_error(Config.s_BotServ, u, "SET DONTKICKOPS", BOT_SET_DONTKICKOPS_SYNTAX); @@ -83,11 +83,11 @@ class CommandBSSet : public Command if (value == "ON") { ci->botflags.SetFlag(BS_DONTKICKVOICES); notice_lang(Config.s_BotServ, u, BOT_SET_DONTKICKVOICES_ON, - ci->name); + ci->name.c_str()); } else if (value == "OFF") { ci->botflags.UnsetFlag(BS_DONTKICKVOICES); notice_lang(Config.s_BotServ, u, BOT_SET_DONTKICKVOICES_OFF, - ci->name); + ci->name.c_str()); } else { syntax_error(Config.s_BotServ, u, "SET DONTKICKVOICES", BOT_SET_DONTKICKVOICES_SYNTAX); @@ -95,10 +95,10 @@ class CommandBSSet : public Command } else if (option == "FANTASY") { if (value == "ON") { ci->botflags.SetFlag(BS_FANTASY); - notice_lang(Config.s_BotServ, u, BOT_SET_FANTASY_ON, ci->name); + notice_lang(Config.s_BotServ, u, BOT_SET_FANTASY_ON, ci->name.c_str()); } else if (value == "OFF") { ci->botflags.UnsetFlag(BS_FANTASY); - notice_lang(Config.s_BotServ, u, BOT_SET_FANTASY_OFF, ci->name); + notice_lang(Config.s_BotServ, u, BOT_SET_FANTASY_OFF, ci->name.c_str()); } else { syntax_error(Config.s_BotServ, u, "SET FANTASY", BOT_SET_FANTASY_SYNTAX); @@ -106,10 +106,10 @@ class CommandBSSet : public Command } else if (option == "GREET") { if (value == "ON") { ci->botflags.SetFlag(BS_GREET); - notice_lang(Config.s_BotServ, u, BOT_SET_GREET_ON, ci->name); + notice_lang(Config.s_BotServ, u, BOT_SET_GREET_ON, ci->name.c_str()); } else if (value == "OFF") { ci->botflags.UnsetFlag(BS_GREET); - notice_lang(Config.s_BotServ, u, BOT_SET_GREET_OFF, ci->name); + notice_lang(Config.s_BotServ, u, BOT_SET_GREET_OFF, ci->name.c_str()); } else { syntax_error(Config.s_BotServ, u, "SET GREET", BOT_SET_GREET_SYNTAX); @@ -119,10 +119,10 @@ class CommandBSSet : public Command ci->botflags.SetFlag(BS_NOBOT); if (ci->bi) ci->bi->UnAssign(u, ci); - notice_lang(Config.s_BotServ, u, BOT_SET_NOBOT_ON, ci->name); + notice_lang(Config.s_BotServ, u, BOT_SET_NOBOT_ON, ci->name.c_str()); } else if (value == "OFF") { ci->botflags.UnsetFlag(BS_NOBOT); - notice_lang(Config.s_BotServ, u, BOT_SET_NOBOT_OFF, ci->name); + notice_lang(Config.s_BotServ, u, BOT_SET_NOBOT_OFF, ci->name.c_str()); } else { syntax_error(Config.s_BotServ, u, "SET NOBOT", BOT_SET_NOBOT_SYNTAX); @@ -130,10 +130,10 @@ class CommandBSSet : public Command } else if (option == "SYMBIOSIS") { if (value == "ON") { ci->botflags.SetFlag(BS_SYMBIOSIS); - notice_lang(Config.s_BotServ, u, BOT_SET_SYMBIOSIS_ON, ci->name); + notice_lang(Config.s_BotServ, u, BOT_SET_SYMBIOSIS_ON, ci->name.c_str()); } else if (value == "OFF") { ci->botflags.UnsetFlag(BS_SYMBIOSIS); - notice_lang(Config.s_BotServ, u, BOT_SET_SYMBIOSIS_OFF, ci->name); + notice_lang(Config.s_BotServ, u, BOT_SET_SYMBIOSIS_OFF, ci->name.c_str()); } else { syntax_error(Config.s_BotServ, u, "SET SYMBIOSIS", BOT_SET_SYMBIOSIS_SYNTAX); diff --git a/src/core/bs_unassign.c b/src/core/bs_unassign.c index fcd2ee8f1..1d421fc5d 100644 --- a/src/core/bs_unassign.c +++ b/src/core/bs_unassign.c @@ -39,7 +39,7 @@ class CommandBSUnassign : public Command else { ci->bi->UnAssign(u, ci); - notice_lang(Config.s_BotServ, u, BOT_UNASSIGN_UNASSIGNED, ci->name); + notice_lang(Config.s_BotServ, u, BOT_UNASSIGN_UNASSIGNED, ci->name.c_str()); } return MOD_CONT; } diff --git a/src/core/cs_access.c b/src/core/cs_access.c index 5f875b1c9..1b9db83b9 100644 --- a/src/core/cs_access.c +++ b/src/core/cs_access.c @@ -57,7 +57,7 @@ static int access_list(User * u, int index, ChannelInfo * ci, int *sent_header) if (!*sent_header) { - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_HEADER, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_HEADER, ci->name.c_str()); *sent_header = 1; } @@ -92,7 +92,7 @@ static int access_view(User *u, int index, ChannelInfo *ci, int *sent_header) if (!*sent_header) { - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_HEADER, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_HEADER, ci->name.c_str()); *sent_header = 1; } @@ -227,7 +227,7 @@ class CommandCSAccess : public Command FOREACH_MOD(I_OnAccessChange, OnAccessChange(ci, u, na->nick, level)); - alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", Config.s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ulev, access->level, na->nick, nc->display, ci->name); + alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, ulev, access->level, na->nick, nc->display, ci->name.c_str()); notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LEVEL_CHANGED, nc->display, chan, level); return MOD_CONT; } @@ -243,8 +243,8 @@ class CommandCSAccess : public Command FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, u, na->nick, level)); - alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", Config.s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ulev, level, na->nick, nc->display, ci->name); - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_ADDED, nc->display, ci->name, level); + alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, ulev, level, na->nick, nc->display, ci->name.c_str()); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_ADDED, nc->display, ci->name.c_str(), level); } else if (cmd == "DEL") { @@ -273,18 +273,18 @@ class CommandCSAccess : public Command else if (count == 1) { last = atoi(nick); - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_NO_SUCH_ENTRY, last, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_NO_SUCH_ENTRY, last, ci->name.c_str()); } else - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_NO_MATCH, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_NO_MATCH, ci->name.c_str()); } else { - alog("%s: %s!%s@%s (level %d) deleted access of user%s %s on %s", Config.s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, get_access(u, ci), deleted == 1 ? "" : "s", nick, chan); + alog("%s: %s!%s@%s (level %d) deleted access of user%s %s on %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, get_access(u, ci), deleted == 1 ? "" : "s", nick, chan); if (deleted == 1) - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_DELETED_ONE, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_DELETED_ONE, ci->name.c_str()); else - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_DELETED_SEVERAL, deleted, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_DELETED_SEVERAL, deleted, ci->name.c_str()); } } else @@ -309,8 +309,8 @@ class CommandCSAccess : public Command } else { - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_DELETED, access->nc->display, ci->name); - alog("%s: %s!%s@%s (level %d) deleted access of %s (group %s) on %s", Config.s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, get_access(u, ci), na->nick, access->nc->display, chan); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_DELETED, access->nc->display, ci->name.c_str()); + alog("%s: %s!%s@%s (level %d) deleted access of %s (group %s) on %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, get_access(u, ci), na->nick, access->nc->display, chan); access->nc = NULL; access->in_use = 0; deleted = 1; @@ -356,7 +356,7 @@ class CommandCSAccess : public Command if (!sent_header) notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_NO_MATCH, chan); else - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_FOOTER, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_FOOTER, ci->name.c_str()); } else if (cmd == "VIEW") { @@ -382,7 +382,7 @@ class CommandCSAccess : public Command if (!sent_header) notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_NO_MATCH, chan); else - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_FOOTER, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LIST_FOOTER, ci->name.c_str()); } else if (cmd == "CLEAR") { @@ -402,9 +402,9 @@ class CommandCSAccess : public Command FOREACH_MOD(I_OnAccessClear, OnAccessClear(ci, u)); - notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_CLEAR, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_CLEAR, ci->name.c_str()); alog("%s: %s!%s@%s (level %d) cleared access list on %s", - Config.s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, + Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, get_access(u, ci), chan); } @@ -474,8 +474,8 @@ class CommandCSLevels : public Command ci->levels[levelinfo[i].what] = level; alog("%s: %s!%s@%s set level %s on channel %s to %d", - Config.s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, - levelinfo[i].name, ci->name, level); + Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, + levelinfo[i].name, ci->name.c_str(), level); notice_lang(Config.s_ChanServ, u, CHAN_LEVELS_CHANGED, levelinfo[i].name, chan, level); return MOD_CONT; @@ -490,8 +490,8 @@ class CommandCSLevels : public Command ci->levels[levelinfo[i].what] = ACCESS_INVALID; alog("%s: %s!%s@%s disabled level %s on channel %s", - Config.s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, - levelinfo[i].name, ci->name); + Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, + levelinfo[i].name, ci->name.c_str()); notice_lang(Config.s_ChanServ, u, CHAN_LEVELS_DISABLED, levelinfo[i].name, chan); return MOD_CONT; @@ -537,7 +537,7 @@ class CommandCSLevels : public Command reset_levels(ci); alog("%s: %s!%s@%s reset levels definitions on channel %s", - Config.s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ci->name); + Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, ci->name.c_str()); notice_lang(Config.s_ChanServ, u, CHAN_LEVELS_RESET, chan); } else { this->OnSyntaxError(u, ""); diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c index fcc335cb8..625e226c6 100644 --- a/src/core/cs_akick.c +++ b/src/core/cs_akick.c @@ -68,7 +68,7 @@ int akick_list(User * u, int index, ChannelInfo * ci, int *sent_header) if (!akick->InUse) return 0; if (!*sent_header) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_HEADER, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_HEADER, ci->name.c_str()); *sent_header = 1; } @@ -98,7 +98,7 @@ int akick_view(User * u, int index, ChannelInfo * ci, int *sent_header) if (!akick->InUse) return 0; if (!*sent_header) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_HEADER, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_HEADER, ci->name.c_str()); *sent_header = 1; } @@ -174,7 +174,7 @@ class CommandCSAKick : public Command { if (is_excepted_mask(ci, mask.c_str())) { - notice_lang(Config.s_ChanServ, u, CHAN_EXCEPTED, mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_EXCEPTED, mask.c_str(), ci->name.c_str()); return; } } @@ -239,7 +239,7 @@ class CommandCSAKick : public Command continue; if ((akick->HasFlag(AK_ISNICK)) ? akick->nc == nc : akick->mask == mask) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_ALREADY_EXISTS, (akick->HasFlag(AK_ISNICK)) ? akick->nc->display : akick->mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_ALREADY_EXISTS, (akick->HasFlag(AK_ISNICK)) ? akick->nc->display : akick->mask.c_str(), ci->name.c_str()); return; } } @@ -256,7 +256,7 @@ class CommandCSAKick : public Command else akick = ci->AddAkick(u->nick, mask.c_str(), !reason.empty() ? reason.c_str() : ""); - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_ADDED, mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_ADDED, mask.c_str(), ci->name.c_str()); this->DoEnforce(u, ci, params); } @@ -271,7 +271,7 @@ class CommandCSAKick : public Command if (!ci->GetAkickCount()) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name.c_str()); return; } @@ -290,12 +290,12 @@ class CommandCSAKick : public Command if (i == ci->GetAkickCount()) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name.c_str()); return; } akick->SetFlag(AK_STUCK); - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_STUCK, akick->mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_STUCK, akick->mask.c_str(), ci->name.c_str()); if (ci->c) stick_mask(ci, akick); @@ -311,7 +311,7 @@ class CommandCSAKick : public Command if (!ci->GetAkickCount()) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name.c_str()); return; } @@ -330,12 +330,12 @@ class CommandCSAKick : public Command if (i == ci->GetAkickCount()) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name.c_str()); return; } akick->UnsetFlag(AK_STUCK); - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_UNSTUCK, akick->mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_UNSTUCK, akick->mask.c_str(), ci->name.c_str()); } void DoDel(User *u, ChannelInfo *ci, const std::vector ¶ms) @@ -346,7 +346,7 @@ class CommandCSAKick : public Command if (!ci->GetAkickCount()) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name.c_str()); return; } @@ -360,14 +360,14 @@ class CommandCSAKick : public Command if (!deleted) { if (count == 1) - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NO_SUCH_ENTRY, last, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NO_SUCH_ENTRY, last, ci->name.c_str()); else - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NO_MATCH, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NO_MATCH, ci->name.c_str()); } else if (deleted == 1) - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_DELETED_ONE, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_DELETED_ONE, ci->name.c_str()); else - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_DELETED_SEVERAL, deleted, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_DELETED_SEVERAL, deleted, ci->name.c_str()); if (deleted) ci->CleanAkick(); } @@ -390,13 +390,13 @@ class CommandCSAKick : public Command if (i == ci->GetAkickCount()) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NOT_FOUND, mask.c_str(), ci->name.c_str()); return; } ci->EraseAkick(akick); - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_DELETED, mask.c_str(), ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_DELETED, mask.c_str(), ci->name.c_str()); } } @@ -409,7 +409,7 @@ class CommandCSAKick : public Command if (!ci->GetAkickCount()) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name.c_str()); return; } @@ -435,7 +435,7 @@ class CommandCSAKick : public Command } if (!sent_header) - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NO_MATCH, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NO_MATCH, ci->name.c_str()); } @@ -448,7 +448,7 @@ class CommandCSAKick : public Command if (!ci->GetAkickCount()) { - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_LIST_EMPTY, ci->name.c_str()); return; } @@ -473,7 +473,7 @@ class CommandCSAKick : public Command } } if (!sent_header) - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NO_MATCH, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_NO_MATCH, ci->name.c_str()); } @@ -486,7 +486,7 @@ class CommandCSAKick : public Command if (!c) { - notice_lang(Config.s_ChanServ, u, CHAN_X_NOT_IN_USE, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_X_NOT_IN_USE, ci->name.c_str()); return; } @@ -495,10 +495,10 @@ class CommandCSAKick : public Command while (cu) { unext = cu->next; - if (check_kick(cu->user, c->name, c->creation_time)) + if (check_kick(cu->user, c->name.c_str(), c->creation_time)) { - argv[0] = sstrdup(c->name); - argv[1] = sstrdup(cu->user->nick); + argv[0] = sstrdup(c->name.c_str()); + argv[1] = sstrdup(cu->user->nick.c_str()); argv[2] = sstrdup(Config.CSAutokickReason); do_kick(Config.s_ChanServ, 3, argv); @@ -511,13 +511,13 @@ class CommandCSAKick : public Command cu = unext; } - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_ENFORCE_DONE, ci->name, count); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_ENFORCE_DONE, ci->name.c_str(), count); } void DoClear(User *u, ChannelInfo *ci, const std::vector ¶ms) { ci->ClearAkick(); - notice_lang(Config.s_ChanServ, u, CHAN_AKICK_CLEAR, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_AKICK_CLEAR, ci->name.c_str()); } public: diff --git a/src/core/cs_ban.c b/src/core/cs_ban.c index 62d69724e..aaf36ac27 100644 --- a/src/core/cs_ban.c +++ b/src/core/cs_ban.c @@ -42,7 +42,7 @@ class CommandCSBan : public Command if (!reason) reason = "Requested"; - is_same = (stricmp(target, u->nick) == 0); + is_same = (stricmp(target, u->nick.c_str()) == 0); if (c) ci = c->ci; @@ -62,7 +62,7 @@ class CommandCSBan : public Command * to prevent services <-> server wars. */ } else if (ModeManager::FindChannelModeByName(CMODE_EXCEPT) && is_excepted(ci, u2)) { - notice_lang(Config.s_ChanServ, u, CHAN_EXCEPTED, u2->nick, ci->name); + notice_lang(Config.s_ChanServ, u, CHAN_EXCEPTED, u2->nick.c_str(), ci->name.c_str()); } else if (is_protected(u2)) { notice_lang(Config.s_ChanServ, u, ACCESS_DENIED); } else { @@ -78,12 +78,12 @@ class CommandCSBan : public Command if ((ci->HasFlag(CI_SIGNKICK)) || ((ci->HasFlag(CI_SIGNKICK_LEVEL)) && !check_access(u, ci, CA_SIGNKICK))) - ircdproto->SendKick(whosends(ci), ci->c, u2, "%s (%s)", reason, u->nick); + ircdproto->SendKick(whosends(ci), ci->c, u2, "%s (%s)", reason, u->nick.c_str()); else ircdproto->SendKick(whosends(ci), ci->c, u2, "%s", reason); const char *kav[4]; - kav[0] = ci->name; + kav[0] = ci->name.c_str(); kav[1] = target; kav[2] = reason; do_kick(Config.s_ChanServ, 3, kav); diff --git a/src/core/cs_clear.c b/src/core/cs_clear.c index cc8208829..1de6ca1ff 100644 --- a/src/core/cs_clear.c +++ b/src/core/cs_clear.c @@ -152,12 +152,12 @@ class CommandCSClear : public Command struct c_userlist *cu, *bnext; char buf[256]; - snprintf(buf, sizeof(buf), "CLEAR USERS command from %s", u->nick); + snprintf(buf, sizeof(buf), "CLEAR USERS command from %s", u->nick.c_str()); for (cu = c->users; cu; cu = bnext) { bnext = cu->next; av[0] = sstrdup(chan); - av[1] = sstrdup(cu->user->nick); + av[1] = sstrdup(cu->user->nick.c_str()); av[2] = sstrdup(buf); ircdproto->SendKick(whosends(ci), c, cu->user, av[2]); do_kick(Config.s_ChanServ, 3, av); diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c index 82ffc2a1f..1cc1949d5 100644 --- a/src/core/cs_drop.c +++ b/src/core/cs_drop.c @@ -67,11 +67,11 @@ class CommandCSDrop : public Command if (ircd->chansqline && (ci->HasFlag(CI_FORBIDDEN))) { - ircdproto->SendSQLineDel(ci->name); + ircdproto->SendSQLineDel(ci->name.c_str()); } alog("%s: Channel %s dropped by %s!%s@%s (founder: %s)", - Config.s_ChanServ, ci->name, u->nick, u->GetIdent().c_str(), + Config.s_ChanServ, ci->name.c_str(), u->nick.c_str(), u->GetIdent().c_str(), u->host, (ci->founder ? ci->founder->display : "(none)")); delete ci; @@ -81,7 +81,7 @@ class CommandCSDrop : public Command */