diff options
author | rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-08-05 20:01:44 +0000 |
---|---|---|
committer | rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-08-05 20:01:44 +0000 |
commit | 863f7fdb6da2833fc4841d564fad1189b050f463 (patch) | |
tree | 0657afc8603651ea02a17dbb759903cd62453821 | |
parent | d61eebd738d2ea3c739018e986a6d16207e7b5e9 (diff) |
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
-rw-r--r-- | Changes | 2 | ||||
-rw-r--r-- | lang/en_us.l | 2 | ||||
-rw-r--r-- | src/language.c | 25 | ||||
-rw-r--r-- | version.log | 7 |
4 files changed, 33 insertions, 3 deletions
@@ -56,7 +56,7 @@ Provided by Anope Dev. <dev@anope.org> - 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 <jon@vile.com> - 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. |