diff options
-rw-r--r-- | include/anope.h | 2 | ||||
-rw-r--r-- | include/language.h | 20 | ||||
-rw-r--r-- | include/services.h | 5 | ||||
-rw-r--r-- | modules/core/bs_act.cpp | 2 | ||||
-rw-r--r-- | modules/core/bs_kick.cpp | 4 | ||||
-rw-r--r-- | modules/core/bs_say.cpp | 2 | ||||
-rw-r--r-- | modules/core/bs_set.cpp | 2 | ||||
-rw-r--r-- | modules/core/bs_unassign.cpp | 2 | ||||
-rw-r--r-- | modules/core/cs_saset.cpp | 2 | ||||
-rw-r--r-- | modules/core/cs_set.cpp | 4 | ||||
-rw-r--r-- | modules/core/ms_set.cpp | 4 | ||||
-rw-r--r-- | modules/core/ns_access.cpp | 2 | ||||
-rw-r--r-- | modules/core/ns_drop.cpp | 2 | ||||
-rw-r--r-- | modules/core/ns_group.cpp | 2 | ||||
-rw-r--r-- | modules/core/ns_recover.cpp | 4 | ||||
-rw-r--r-- | modules/core/ns_release.cpp | 2 | ||||
-rw-r--r-- | modules/core/ns_resetpass.cpp | 4 | ||||
-rw-r--r-- | modules/core/ns_set.cpp | 2 | ||||
-rw-r--r-- | src/commands.cpp | 2 | ||||
-rw-r--r-- | src/language.cpp | 2 | ||||
-rw-r--r-- | src/memoserv.cpp | 8 | ||||
-rw-r--r-- | src/misc.cpp | 4 | ||||
-rw-r--r-- | src/nickserv.cpp | 4 | ||||
-rw-r--r-- | src/sessions.cpp | 4 |
24 files changed, 44 insertions, 47 deletions
diff --git a/include/anope.h b/include/anope.h index 07cd97da5..4f116c37e 100644 --- a/include/anope.h +++ b/include/anope.h @@ -343,7 +343,7 @@ namespace Anope * @param ... any number of parameters * @return a Anope::string */ - extern CoreExport string printf(const Anope::string &fmt, ...); + extern CoreExport string printf(const char *fmt, ...); /** Return the last error, uses errno/GetLastError() to determin this * @return An error message diff --git a/include/language.h b/include/language.h index 2653fce4c..409ffc7d4 100644 --- a/include/language.h +++ b/include/language.h @@ -6,7 +6,7 @@ * Please read COPYING and README for further details. */ -#define MORE_INFO "\002%R%s HELP %s\002 for more information." +#define MORE_INFO "\002%s%s HELP %s\002 for more information." #define BAD_USERHOST_MASK "Mask must be in the form \037user\037@\037host\037." #define BAD_EXPIRY_TIME "Invalid expiry time." #define USERHOST_MASK_TOO_WIDE "%s coverage is too wide; Please use a more specific mask." @@ -29,7 +29,7 @@ #define CHAN_X_FORBIDDEN_OPER "Channel \002%s\002 has been forbidden by %s:\n" \ "%s" #define NICK_IDENTIFY_REQUIRED "Password authentication required for that command.\n" \ - "Retry after typing \002%R%s IDENTIFY \037password\037\002." + "Retry after typing \002%s%s IDENTIFY \037password\037\002." #define MAIL_X_INVALID "\002%s\002 is not a valid e-mail address." #define NO_REASON "No reason" #define UNKNOWN "<unknown>" @@ -37,11 +37,11 @@ #define END_OF_ANY_LIST "End of \002%s\002 list." #define LIST_INCORRECT_RANGE "Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002." #define UNKNOWN_OPTION "Unknown option \002%s\002.\n" \ - "Type %R%S HELP %s for more information." + "Type %s%s HELP %s for more information." #define NICK_IS_REGISTERED "This nick is owned by someone else. Please choose another.\n" \ - "(If this is your nick, type \002%R%s IDENTIFY \037password\037\002.)" + "(If this is your nick, type \002%s%s IDENTIFY \037password\037\002.)" #define NICK_IS_SECURE "This nickname is registered and protected. If it is your\n" \ - "nick, type \002%R%s IDENTIFY \037password\037\002. Otherwise,\n" \ + "nick, type \002%s%s IDENTIFY \037password\037\002. Otherwise,\n" \ "please choose a different nick." #define FORCENICKCHANGE_NOW "This nickname has been registered; you may not use it." #define NICK_CANNOT_BE_REGISTERED "Nickname \002%s\002 may not be registered." @@ -59,7 +59,7 @@ #define NICK_LIST_SYNTAX "LIST \037pattern\037" #define LIST_HEADER "List of entries matching \002%s\002:" #define NICK_RECOVERED "User claiming your nick has been killed.\n" \ - "\002%R%s RELEASE %s\002 to get it back before %s timeout." + "\002%s%s RELEASE %s\002 to get it back before %s timeout." #define NICK_REQUESTED "This nick has already been requested, please check your e-mail address for the pass code" #define NICK_CONFIRM_INVALID "Invalid passcode has been entered, please check the e-mail again, and retry" #define CHAN_NOT_ALLOWED_TO_JOIN "You are not permitted to be on this channel." @@ -72,7 +72,7 @@ #define CHAN_SET_DISABLED "Sorry, channel option setting is temporarily disabled." #define CHAN_SETTING_CHANGED "%s for %s set to %s." #define CHAN_SETTING_UNSET "%s for %s unset." -#define CHAN_SET_MLOCK_DEPRECATED "MLOCK is deprecated. Use \002%R%s HELP MODE\002 instead." +#define CHAN_SET_MLOCK_DEPRECATED "MLOCK is deprecated. Use \002%s%s HELP MODE\002 instead." #define CHAN_ACCESS_LEVEL_RANGE "Access level must be between %d and %d inclusive." #define CHAN_ACCESS_LIST_HEADER "Access list for %s:\n" \ " Num Lev Mask" @@ -87,9 +87,9 @@ #define CHAN_LIST_ENTRY "%3d %s\n" \ " Added by %s on %s" #define MEMO_NEW_X_MEMO_ARRIVED "There is a new memo on channel %s.\n" \ - "Type \002%R%s READ %s %d\002 to read it." + "Type \002%s%s READ %s %d\002 to read it." #define MEMO_NEW_MEMO_ARRIVED "You have a new memo from %s.\n" \ - "Type \002%R%s READ %d\002 to read it." + "Type \002%s%s READ %d\002 to read it." #define MEMO_HAVE_NO_MEMOS "You have no memos." #define MEMO_X_HAS_NO_MEMOS "%s has no memos." #define MEMO_SEND_SYNTAX "SEND {\037nick\037 | \037channel\037} \037memo-text\037" @@ -98,7 +98,7 @@ #define MEMO_X_HAS_NO_NEW_MEMOS "%s has no new memos." #define BOT_DOES_NOT_EXIST "Bot \002%s\002 does not exist." #define BOT_NOT_ASSIGNED "You must assign a bot to the channel before using this command.\n" \ - "Type %R%S HELP ASSIGN for more information." + "Type %s%s HELP ASSIGN for more information." #define BOT_NOT_ON_CHANNEL "Bot is not on channel \002%s\002." #define BOT_ASSIGN_READONLY "Sorry, bot assignment is temporarily disabled." #define ENABLED "Enabled" diff --git a/include/services.h b/include/services.h index 1285b188e..b83790355 100644 --- a/include/services.h +++ b/include/services.h @@ -57,6 +57,7 @@ # include <netinet/in.h> # include <arpa/inet.h> # include <sys/socket.h> +# include <sys/time.h> # include <dirent.h> # ifdef HAVE_BACKTRACE # include <execinfo.h> @@ -76,10 +77,6 @@ # define FORMAT(type, fmt, start) #endif -#ifdef HAVE_GETTIMEOFDAY -# include <sys/time.h> -#endif - #if HAVE_STRINGS_H # include <strings.h> #endif diff --git a/modules/core/bs_act.cpp b/modules/core/bs_act.cpp index b5de45cb7..3e868c25a 100644 --- a/modules/core/bs_act.cpp +++ b/modules/core/bs_act.cpp @@ -35,7 +35,7 @@ class CommandBSAct : public Command if (!ci->bi) { - source.Reply(_(BOT_NOT_ASSIGNED)); + source.Reply(_(BOT_NOT_ASSIGNED), Config->UseStrictPrivMsgString.c_str(), BotServ->nick.c_str()); return MOD_CONT; } diff --git a/modules/core/bs_kick.cpp b/modules/core/bs_kick.cpp index 82882b480..ef78511a7 100644 --- a/modules/core/bs_kick.cpp +++ b/modules/core/bs_kick.cpp @@ -41,7 +41,7 @@ class CommandBSKick : public Command else if (!check_access(u, ci, CA_SET) && !u->HasPriv("botserv/administration")) source.Reply(_(ACCESS_DENIED)); else if (!ci->bi) - source.Reply(_(BOT_NOT_ASSIGNED)); + source.Reply(_(BOT_NOT_ASSIGNED), Config->UseStrictPrivMsgString.c_str(), BotServ->nick.c_str()); else { bool override = !check_access(u, ci, CA_SET); @@ -451,7 +451,7 @@ class CommandBSKick : public Command } } else - source.Reply(_(UNKNOWN_OPTION), option.c_str(), this->name.c_str()); + source.Reply(_(UNKNOWN_OPTION), Config->UseStrictPrivMsgString.c_str(), option.c_str(), this->name.c_str()); } return MOD_CONT; } diff --git a/modules/core/bs_say.cpp b/modules/core/bs_say.cpp index 2f6c3b4ed..d64880964 100644 --- a/modules/core/bs_say.cpp +++ b/modules/core/bs_say.cpp @@ -36,7 +36,7 @@ class CommandBSSay : public Command if (!ci->bi) { - source.Reply(_(BOT_NOT_ASSIGNED)); + source.Reply(_(BOT_NOT_ASSIGNED), Config->UseStrictPrivMsgString.c_str(), BotServ->nick.c_str()); return MOD_CONT; } diff --git a/modules/core/bs_set.cpp b/modules/core/bs_set.cpp index 496190f75..3b635131a 100644 --- a/modules/core/bs_set.cpp +++ b/modules/core/bs_set.cpp @@ -192,7 +192,7 @@ class CommandBSSet : public Command SyntaxError(source, "SET MSG", _("SET \037channel\037 MSG {\037OFF|PRIVMSG|NOTICE|\037}")); } else - source.Reply(_(UNKNOWN_OPTION), option.c_str(), this->name.c_str()); + source.Reply(_(UNKNOWN_OPTION), Config->UseStrictPrivMsgString.c_str(), option.c_str(), this->name.c_str()); } return MOD_CONT; diff --git a/modules/core/bs_unassign.cpp b/modules/core/bs_unassign.cpp index f64cb526d..8e28508ab 100644 --- a/modules/core/bs_unassign.cpp +++ b/modules/core/bs_unassign.cpp @@ -33,7 +33,7 @@ class CommandBSUnassign : public Command else if (!u->HasPriv("botserv/administration") && !check_access(u, ci, CA_ASSIGN)) source.Reply(_(ACCESS_DENIED)); else if (!ci->bi) - source.Reply(_(BOT_NOT_ASSIGNED)); + source.Reply(_(BOT_NOT_ASSIGNED), Config->UseStrictPrivMsgString.c_str(), BotServ->nick.c_str()); else if (ci->HasFlag(CI_PERSIST) && !cm) source.Reply(_("You can not unassign bots while persist is set on the channel.")); else diff --git a/modules/core/cs_saset.cpp b/modules/core/cs_saset.cpp index 77adbe815..ca156242b 100644 --- a/modules/core/cs_saset.cpp +++ b/modules/core/cs_saset.cpp @@ -60,7 +60,7 @@ class CommandCSSASet : public Command else { source.Reply(_("Unknown SASET option \002%s\002."), params[1].c_str()); - source.Reply(_(MORE_INFO), Config->s_ChanServ.c_str(), "SET"); + source.Reply(_(MORE_INFO), Config->UseStrictPrivMsgString.c_str(), Config->s_ChanServ.c_str(), "SET"); } return MOD_CONT; diff --git a/modules/core/cs_set.cpp b/modules/core/cs_set.cpp index be6147b58..7923070db 100644 --- a/modules/core/cs_set.cpp +++ b/modules/core/cs_set.cpp @@ -63,8 +63,8 @@ class CommandCSSet : public Command } else { - source.Reply(_(NICK_SET_UNKNOWN_OPTION), params[1].c_str()); - source.Reply(_(MORE_INFO), Config->s_ChanServ.c_str(), "SET"); + source.Reply(_(NICK_SET_UNKNOWN_OPTION), Config->UseStrictPrivMsgString.c_str(), params[1].c_str()); + source.Reply(_(MORE_INFO), Config->UseStrictPrivMsgString.c_str(), Config->s_ChanServ.c_str(), "SET"); } return MOD_CONT; diff --git a/modules/core/ms_set.cpp b/modules/core/ms_set.cpp index a03d6ee03..35e5c6db5 100644 --- a/modules/core/ms_set.cpp +++ b/modules/core/ms_set.cpp @@ -218,8 +218,8 @@ class CommandMSSet : public Command return this->DoLimit(source, params, mi); else { - source.Reply(_(NICK_SET_UNKNOWN_OPTION), cmd.c_str()); - source.Reply(_(MORE_INFO), Config->s_MemoServ.c_str(), "SET"); + source.Reply(_(NICK_SET_UNKNOWN_OPTION), Config->UseStrictPrivMsgString.c_str(), cmd.c_str()); + source.Reply(_(MORE_INFO), Config->UseStrictPrivMsgString.c_str(), Config->s_MemoServ.c_str(), "SET"); } return MOD_CONT; diff --git a/modules/core/ns_access.cpp b/modules/core/ns_access.cpp index c3c46297c..45265a6fd 100644 --- a/modules/core/ns_access.cpp +++ b/modules/core/ns_access.cpp @@ -133,7 +133,7 @@ class CommandNSAccess : public Command if (!mask.empty() && mask.find('@') == Anope::string::npos) { source.Reply(_(BAD_USERHOST_MASK)); - source.Reply(_(MORE_INFO), Config->s_NickServ.c_str(), "ACCESS"); + source.Reply(_(MORE_INFO), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str(), "ACCESS"); } else if (u->Account()->HasFlag(NI_SUSPENDED)) source.Reply(_(NICK_X_SUSPENDED), u->Account()->display.c_str()); diff --git a/modules/core/ns_drop.cpp b/modules/core/ns_drop.cpp index 7127f018d..75a0b7899 100644 --- a/modules/core/ns_drop.cpp +++ b/modules/core/ns_drop.cpp @@ -42,7 +42,7 @@ class CommandNSDrop : public Command if (!u->Account()) { - source.Reply(_(NICK_IDENTIFY_REQUIRED), Config->s_NickServ.c_str()); + source.Reply(_(NICK_IDENTIFY_REQUIRED), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str()); return MOD_CONT; } diff --git a/modules/core/ns_group.cpp b/modules/core/ns_group.cpp index e4e5fae88..4b0fda4c4 100644 --- a/modules/core/ns_group.cpp +++ b/modules/core/ns_group.cpp @@ -73,7 +73,7 @@ class CommandNSGroup : public Command else if (na && target->nc == na->nc) source.Reply(_("You are already a member of the group of \002%s\002."), target->nick.c_str()); else if (na && na->nc != u->Account()) - source.Reply(_(NICK_IDENTIFY_REQUIRED), Config->s_NickServ.c_str()); + source.Reply(_(NICK_IDENTIFY_REQUIRED), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str()); else if (na && Config->NSNoGroupChange) source.Reply(_("Your nick is already registered; type \002%s%s DROP\002 first."), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str()); else if (Config->NSMaxAliases && (target->nc->aliases.size() >= Config->NSMaxAliases) && !target->nc->IsServicesOper()) diff --git a/modules/core/ns_recover.cpp b/modules/core/ns_recover.cpp index 936e2b51a..416b0e184 100644 --- a/modules/core/ns_recover.cpp +++ b/modules/core/ns_recover.cpp @@ -53,7 +53,7 @@ class CommandNSRecover : public Command /* Convert Config->NSReleaseTimeout seconds to string format */ Anope::string relstr = duration(Config->NSReleaseTimeout); - source.Reply(_(NICK_RECOVERED), Config->s_NickServ.c_str(), nick.c_str(), relstr.c_str()); + source.Reply(_(NICK_RECOVERED), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str(), nick.c_str(), relstr.c_str()); } else { @@ -77,7 +77,7 @@ class CommandNSRecover : public Command /* Convert Config->NSReleaseTimeout seconds to string format */ Anope::string relstr = duration(Config->NSReleaseTimeout); - source.Reply(_(NICK_RECOVERED), Config->s_NickServ.c_str(), nick.c_str(), relstr.c_str()); + source.Reply(_(NICK_RECOVERED), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str(), nick.c_str(), relstr.c_str()); } else source.Reply(_(ACCESS_DENIED)); diff --git a/modules/core/ns_release.cpp b/modules/core/ns_release.cpp index ff0424577..94a778218 100644 --- a/modules/core/ns_release.cpp +++ b/modules/core/ns_release.cpp @@ -87,7 +87,7 @@ class CommandNSRelease : public Command "current address as shown in /WHOIS must be on that nick's\n" "access list, you must be identified and in the group of\n" "that nick, or you must supply the correct password for\n" - "the nickname."), NickServ->nick.c_str()); + "the nickname."), NickServ->nick.c_str(), relstr.c_str()); return true; diff --git a/modules/core/ns_resetpass.cpp b/modules/core/ns_resetpass.cpp index 8dc750f8b..626af80c8 100644 --- a/modules/core/ns_resetpass.cpp +++ b/modules/core/ns_resetpass.cpp @@ -137,7 +137,7 @@ static bool SendResetEmail(User *u, NickAlias *na) for (idx = 0; idx < 20; ++idx) passcode += chars[1 + static_cast<int>((static_cast<float>(max - min)) * getrandom16() / 65536.0) + min]; - Anope::string subject = Anope::printf(GetString(na->nc, "Reset password request for %s"), na->nick.c_str()); + Anope::string subject = Anope::printf(GetString(na->nc, "Reset password request for %s").c_str(), na->nick.c_str()); Anope::string message = Anope::printf(GetString(na->nc, "Hi,\n" " \n" @@ -146,7 +146,7 @@ static bool SendResetEmail(User *u, NickAlias *na) " \n" "If you don't know why this mail was sent to you, please ignore it silently.\n" " \n" - "%s administrators."), na->nick.c_str(), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str(), na->nick.c_str(), passcode.c_str(), Config->NetworkName.c_str()); + "%s administrators.").c_str(), na->nick.c_str(), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str(), na->nick.c_str(), passcode.c_str(), Config->NetworkName.c_str()); na->nc->Extend("ns_resetpass_code", new ExtensibleItemRegular<Anope::string>(passcode)); na->nc->Extend("ns_resetpass_time", new ExtensibleItemRegular<time_t>(Anope::CurTime)); diff --git a/modules/core/ns_set.cpp b/modules/core/ns_set.cpp index 103cff38c..bfae7f508 100644 --- a/modules/core/ns_set.cpp +++ b/modules/core/ns_set.cpp @@ -60,7 +60,7 @@ class CommandNSSet : public Command mod_run_cmd(NickServ, u, NULL, c, params[0], cmdparams); } else - source.Reply(_(NICK_SET_UNKNOWN_OPTION), params[0].c_str()); + source.Reply(_(NICK_SET_UNKNOWN_OPTION), Config->UseStrictPrivMsgString.c_str(), params[0].c_str()); return MOD_CONT; } diff --git a/src/commands.cpp b/src/commands.cpp index 01f8eb45b..233253319 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -65,7 +65,7 @@ void mod_run_cmd(BotInfo *bi, User *u, ChannelInfo *ci, Command *c, const Anope: // Command requires registered users only if (!c->HasFlag(CFLAG_ALLOW_UNREGISTERED) && !u->IsIdentified()) { - u->SendMessage(bi, _(NICK_IDENTIFY_REQUIRED), Config->s_NickServ.c_str()); + u->SendMessage(bi, _(NICK_IDENTIFY_REQUIRED), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str()); Log(LOG_COMMAND, "denied", bi) << "Access denied for unregistered user " << u->GetMask() << " with command " << command; PopLanguage(); return; diff --git a/src/language.cpp b/src/language.cpp index 8a08ebdcc..250415e9f 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -117,6 +117,6 @@ const char *anope_gettext(const char *string) void SyntaxError(CommandSource &source, const Anope::string &command, const Anope::string &message) { source.Reply(_("Syntax: \002%s\002"), message.c_str()); - source.Reply(_(_(MORE_INFO)), source.owner->nick.c_str(), command.c_str()); + source.Reply(_(_(MORE_INFO)), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str(), command.c_str()); } diff --git a/src/memoserv.cpp b/src/memoserv.cpp index a92742864..f10a11d5f 100644 --- a/src/memoserv.cpp +++ b/src/memoserv.cpp @@ -182,7 +182,7 @@ void memo_send(CommandSource &source, const Anope::string &name, const Anope::st else if (!u->IsIdentified() && !u->IsRecognized()) { if (!z || z == 3) - source.Reply(_(NICK_IDENTIFY_REQUIRED), Config->s_NickServ.c_str()); + source.Reply(_(NICK_IDENTIFY_REQUIRED), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str()); } else if (!(mi = getmemoinfo(name, ischan, isforbid))) { @@ -248,13 +248,13 @@ void memo_send(CommandSource &source, const Anope::string &name, const Anope::st NickAlias *na = *it; User *user = finduser(na->nick); if (user && user->IsIdentified()) - user->SendMessage(MemoServ, _(MEMO_NEW_MEMO_ARRIVED), sender.c_str(), Config->s_MemoServ.c_str(), mi->memos.size()); + user->SendMessage(MemoServ, _(MEMO_NEW_MEMO_ARRIVED), sender.c_str(), Config->UseStrictPrivMsgString.c_str(), Config->s_MemoServ.c_str(), mi->memos.size()); } } else { if ((u = finduser(name)) && u->IsIdentified() && nc->HasFlag(NI_MEMO_RECEIVE)) - u->SendMessage(MemoServ, _(MEMO_NEW_MEMO_ARRIVED), sender.c_str(), Config->s_MemoServ.c_str(), mi->memos.size()); + u->SendMessage(MemoServ, _(MEMO_NEW_MEMO_ARRIVED), sender.c_str(), Config->UseStrictPrivMsgString.c_str(), Config->s_MemoServ.c_str(), mi->memos.size()); } /* if (flags & MEMO_RECEIVE) */ } /* if (MSNotifyAll) */ @@ -277,7 +277,7 @@ void memo_send(CommandSource &source, const Anope::string &name, const Anope::st if (check_access(cu->user, c->ci, CA_MEMO)) { if (cu->user->Account() && cu->user->Account()->HasFlag(NI_MEMO_RECEIVE)) - cu->user->SendMessage(MemoServ, _(MEMO_NEW_X_MEMO_ARRIVED), c->ci->name.c_str(), Config->s_MemoServ.c_str(), c->ci->name.c_str(), mi->memos.size()); + cu->user->SendMessage(MemoServ, _(MEMO_NEW_X_MEMO_ARRIVED), c->ci->name.c_str(), Config->UseStrictPrivMsgString.c_str(), Config->s_MemoServ.c_str(), c->ci->name.c_str(), mi->memos.size()); } } } /* MSNotifyAll */ diff --git a/src/misc.cpp b/src/misc.cpp index edabe8f56..113dc059c 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -789,12 +789,12 @@ bool Anope::Match(const Anope::string &str, const Anope::string &mask, bool case * @param ... any number of parameters * @return a Anope::string */ -Anope::string Anope::printf(const Anope::string &fmt, ...) +Anope::string Anope::printf(const char *fmt, ...) { va_list args; char buf[1024]; va_start(args, fmt); - vsnprintf(buf, sizeof(buf), fmt.c_str(), args); + vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); return buf; } diff --git a/src/nickserv.cpp b/src/nickserv.cpp index 0c036f564..870ea6d2c 100644 --- a/src/nickserv.cpp +++ b/src/nickserv.cpp @@ -208,9 +208,9 @@ int validate_user(User *u) if (u->IsRecognized() || !na->nc->HasFlag(NI_KILL_IMMED)) { if (na->nc->HasFlag(NI_SECURE)) - u->SendMessage(NickServ, _(NICK_IS_SECURE), Config->s_NickServ.c_str()); + u->SendMessage(NickServ, _(NICK_IS_SECURE), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str()); else - u->SendMessage(NickServ, _(NICK_IS_REGISTERED), Config->s_NickServ.c_str()); + u->SendMessage(NickServ, _(NICK_IS_REGISTERED), Config->UseStrictPrivMsgString.c_str(), Config->s_NickServ.c_str()); } if (na->nc->HasFlag(NI_KILLPROTECT) && !u->IsRecognized()) diff --git a/src/sessions.cpp b/src/sessions.cpp index 2be83410c..358527ea0 100644 --- a/src/sessions.cpp +++ b/src/sessions.cpp @@ -134,8 +134,8 @@ void add_session(User *u) if (Config->MaxSessionKill && session->hits >= Config->MaxSessionKill && SGLine) { const Anope::string &akillmask = "*@" + u->host; - XLine *x = new XLine(akillmask, Config->s_OperServ, Anope::CurTime + Config->SessionAutoKillExpiry, "Session limit exceeded"); - SGLine->AddXLine(x); + const Anope::string &akillreason = "Session limit exceeded for " + u->host; + SGLine->Add(NULL, NULL, akillmask, Anope::CurTime + Config->SessionAutoKillExpiry, akillreason); ircdproto->SendGlobops(OperServ, "Added a temporary AKILL for \2%s\2 due to excessive connections", akillmask.c_str()); } } |