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 /src | |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/language.c | 25 |
1 files changed, 25 insertions, 0 deletions
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(); } /*************************************************************************/ |