diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 22:29:18 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 22:29:18 +0000 |
commit | d1611b640bcd27e1a91a99ef32127bc722e50a36 (patch) | |
tree | b18c77b07b74b70f5613b106aa2a81baa6227f35 /src/language.c | |
parent | 0e5b71923b25d908167e7ef9d07c6c217827e901 (diff) |
Remove User::na, use User::nc everywhere. Will probably break everything, but opens the door to decoupling NC from NA, and means commands can now be run without bothering about changinc nick :)
More tweaking for na/nc usage.
It compiles, but it's still a work in progress.
Again, this compiles, but I *bet* there's no chance in hell it'll work. :)
Slightly better.
Set User::nc correctly.
Fix crash with unregistered nicks in core and ns_access.
Fix glist to work when you're not on that particular nick.
Fix ns_set to not crash and burn horribly.
Fix ns_set and ns_logout to not do bad things.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2076 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/language.c')
-rw-r--r-- | src/language.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/language.c b/src/language.c index c9783f963..13df53807 100644 --- a/src/language.c +++ b/src/language.c @@ -240,7 +240,7 @@ void lang_init() int strftime_lang(char *buf, int size, User * u, int format, struct tm *tm) { - int language = u && u->na ? u->na->nc->language : NSDefLanguage; + int language = u && u->nc ? u->nc->language : NSDefLanguage; char tmpbuf[BUFSIZE], buf2[BUFSIZE]; char *s; int i, ret; @@ -301,7 +301,7 @@ void syntax_error(char *service, User * u, const char *command, int msgnum) return; } - str = getstring(u->na, msgnum); + str = getstring(u, msgnum); notice_lang(service, u, SYNTAX_ERROR, str); notice_lang(service, u, MORE_INFO, service, command); } @@ -318,7 +318,7 @@ const char *getstring(NickAlias *na, int index) return langtexts[langidx][index]; } -const char *getstring2(NickCore *nc, int index) +const char *getstring(NickCore *nc, int index) { // Default to config int langidx = NSDefLanguage; @@ -331,4 +331,17 @@ const char *getstring2(NickCore *nc, int index) return langtexts[langidx][index]; } +const char *getstring(User *u, int index) +{ + return getstring(u->nc, index); +} + +const char *getstring(int index) +{ + // Default to config + int langidx = NSDefLanguage; + + return langtexts[langidx][index]; +} + /*************************************************************************/ |