From 863f7fdb6da2833fc4841d564fad1189b050f463 Mon Sep 17 00:00:00 2001 From: "rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Sat, 5 Aug 2006 20:01:44 +0000 Subject: [PATCH] BUILD : 1.7.14 (1112) BUGS : 565 NOTES : %M will now be replaced by either /msg or / depending on UseStrictPrivMsg - we still need to update the .l files for all langauges tho. git-svn-id: svn://svn.anope.org/anope/trunk@1112 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@836 5417fbe8-f217-4b02-8779-1006273d7864 --- Changes | 2 +- lang/en_us.l | 2 +- src/language.c | 25 +++++++++++++++++++++++++ version.log | 7 ++++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index a9dec8ed7..c2a44aed3 100644 --- a/Changes +++ b/Changes @@ -56,7 +56,7 @@ Provided by Anope Dev. - 2006 08/05 F Support for SVSJOIN/SVSPART/SWHOIS in protocol modules. [#566] 08/05 F os_info save on unload. [#523] 08/05 F Externed doValidHost call for modules to use. [#570] - +08/05 F Lang files now support %M for use with StrictPrivMsg. [#565] Provided by ThaPrince - 2006 05/19 A Plexus 3 support. [ #00] diff --git a/lang/en_us.l b/lang/en_us.l index 341c7a162..595afdabd 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -141,7 +141,7 @@ USER_RECORD_NOT_FOUND UNKNOWN_COMMAND Unknown command %s. UNKNOWN_COMMAND_HELP - Unknown command %s. "/msg %s HELP" for help. + Unknown command %s. "%M%s HELP" for help. SYNTAX_ERROR Syntax: %s MORE_INFO diff --git a/src/language.c b/src/language.c index 849d7a4a6..9acfd79b6 100644 --- a/src/language.c +++ b/src/language.c @@ -149,6 +149,30 @@ static void load_lang(int index, const char *filename) /*************************************************************************/ +/* Replace all %M's with "/msg " or "/" */ +void lang_sanitize() +{ + int i = 0, j = 0; + int len = 0; + char buf[256]; + for (i = 0; i < NUM_LANGS; i++) { + for (j = 0; j < NUM_STRINGS; j++) { + if (strstr(langtexts[i][j], "%M")) { + len = strlen(langtexts[i][j]); + if (UseStrictPrivMsg) { + langtexts[i][j] = + strnrepl(langtexts[i][j], len, "%M", "/"); + } else { + langtexts[i][j] = realloc(langtexts[i][j], len + 5); + langtexts[i][j] = + strnrepl(langtexts[i][j], len + 5, "%M", "/msg "); + } + } + } + } +} + + /* Initialize list of lists. */ void lang_init() @@ -198,6 +222,7 @@ void lang_init() if (!langtexts[i]) langtexts[i] = langtexts[DEF_LANGUAGE]; } + lang_sanitize(); } /*************************************************************************/ diff --git a/version.log b/version.log index 0b68125f7..0ba72b644 100644 --- a/version.log +++ b/version.log @@ -9,10 +9,15 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="14" VERSION_EXTRA="" -VERSION_BUILD="1111" +VERSION_BUILD="1112" # $Log$ # +# BUILD : 1.7.14 (1112) +# BUGS : 565 +# NOTES : %M will now be replaced by either /msg or / depending on UseStrictPrivMsg - we still need to update the .l files for all langauges tho. +# +# # BUILD : 1.7.14 (1111) # BUGS : 570 # NOTES : Allow doValidHost to be called from modules.