diff options
-rw-r--r-- | lang/cat.l | 4 | ||||
-rw-r--r-- | lang/de.l | 4 | ||||
-rw-r--r-- | lang/en_us.l | 4 | ||||
-rw-r--r-- | lang/es.l | 4 | ||||
-rw-r--r-- | lang/fr.l | 4 | ||||
-rw-r--r-- | lang/gr.l | 4 | ||||
-rw-r--r-- | lang/hun.l | 4 | ||||
-rw-r--r-- | lang/it.l | 4 | ||||
-rw-r--r-- | lang/nl.l | 4 | ||||
-rw-r--r-- | lang/pl.l | 4 | ||||
-rw-r--r-- | lang/pt.l | 4 | ||||
-rw-r--r-- | lang/ru.l | 4 | ||||
-rw-r--r-- | lang/tr.l | 4 | ||||
-rw-r--r-- | src/core/os_help.c | 14 | ||||
-rw-r--r-- | src/core/os_logonnews.c | 39 | ||||
-rw-r--r-- | src/core/os_opernews.c | 40 | ||||
-rw-r--r-- | version.log | 11 |
17 files changed, 106 insertions, 50 deletions
diff --git a/lang/cat.l b/lang/cat.l index 7c623e06a..83c4ea618 100644 --- a/lang/cat.l +++ b/lang/cat.l @@ -3413,7 +3413,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3429,7 +3429,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3365,7 +3365,7 @@ NEWS_HELP_LOGON Zeigt oder bearbeitet die Liste der LogonNews. Nach der Verbindung des Users werden diese Nachrichten - angezeigt. (Es werden jedoch nur max. %d angezeigt, um ein + angezeigt. (Es werden jedoch nur max. %s angezeigt, um ein Flooding des Users zu verhindern. Wenn mehr News existieren, werden nur die neuesten angezeigt.) NewsCount can be configured in services.conf. @@ -3383,7 +3383,7 @@ NEWS_HELP_OPER Zeigt oder bearbeitet die Liste der Oper-News.Nachdem sich ein User die Oper-Flags gesetzt hat (mit dem /OPER Befehl) werden ihm diese Nachrichten angezeigt. - (Es werden jedoch nur max. %d Nachrichten angezeigt, um ein + (Es werden jedoch nur max. %s Nachrichten angezeigt, um ein Flooding des Users zu verhindern. Wenn mehr News existieren, werden nur die neüsten angezeigt.) NewsCount can be configured in services.conf. diff --git a/lang/en_us.l b/lang/en_us.l index da6303fea..403824a6b 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -3273,7 +3273,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3289,7 +3289,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3387,7 +3387,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3403,7 +3403,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3441,7 +3441,7 @@ NEWS_HELP_LOGON Edite ou affiche la liste de messages logon news. Lorsqu'un utilisateur se connecte au réseau, ces messages leur seront - envoyés. (Cependant, pas plus de %d messages ne seront + envoyés. (Cependant, pas plus de %s messages ne seront envoyés pour éviter le flood des utilisateurs. Si il y a plus messages de news, seuls les plus récents seront envoyés.) NewsCount peut être configuré en services.conf. @@ -3457,7 +3457,7 @@ NEWS_HELP_OPER Edite ou affiche la liste des messages oper news. Quand un utilisateur utilise la commande /OPER, ces messages lui seront - envoyés. (Cependant, pas plus de %d messages ne seront + envoyés. (Cependant, pas plus de %s messages ne seront envoyés afin de ne pas flooder l'utilisateur. Si il y a plus messages news, seuls les plus récents seront envoyés.) NewsCount peut être configuré en services.conf. @@ -3405,7 +3405,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3421,7 +3421,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. diff --git a/lang/hun.l b/lang/hun.l index a7517cfb2..11dee5351 100644 --- a/lang/hun.l +++ b/lang/hun.l @@ -3339,7 +3339,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3355,7 +3355,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3298,7 +3298,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3314,7 +3314,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3368,7 +3368,7 @@ NEWS_HELP_LOGON Wijzigt de lijst met login nieuwsberichten of geeft deze weer. Wanneer een gebruiker met het netwerk verbindt, worden deze berichten naar hem/haar verzonden. (Echter, er zullen nooit - meer dan %d berichten worden verstuurd om het flooden van de + meer dan %s berichten worden verstuurd om het flooden van de gebruiker te voorkomen. Als er meer nieuwsberichten zijn worden alleen de meest recente vestuurd.) NewsCount kan geconfigureerd worden in services.conf. @@ -3386,7 +3386,7 @@ NEWS_HELP_OPER Wijzigt de lijst met oper nieuwsberichten of geeft deze weer. Wanneer een gebruiker opert (dmv het /OPER commando), worden deze berichtennaar hem/haar verzonden. (Echter, er zullen - nooit meer dan %d berichten worden verstuurd om het flooden + nooit meer dan %s berichten worden verstuurd om het flooden van de gebruiker te voorkomen. Als er meer nieuwsberichten zijn worden alleen de meest recente vestuurd.) NewsCount kan geconfigureerd worden in services.conf. @@ -3555,7 +3555,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3571,7 +3571,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3315,7 +3315,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3331,7 +3331,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3273,7 +3273,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3289,7 +3289,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3408,7 +3408,7 @@ NEWS_HELP_LOGON Edits or displays the list of logon news messages. When a user connects to the network, these messages will be sent - to them. (However, no more than %d messages will be + to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. @@ -3424,7 +3424,7 @@ NEWS_HELP_OPER Edits or displays the list of oper news messages. When a user opers up (with the /OPER command), these messages will - be sent to them. (However, no more than %d messages will + be sent to them. (However, no more than %s messages will be sent in order to avoid flooding the user. If there are more news messages, only the most recent will be sent.) NewsCount can be configured in services.conf. diff --git a/src/core/os_help.c b/src/core/os_help.c index 5d837e6f3..822d1dcd0 100644 --- a/src/core/os_help.c +++ b/src/core/os_help.c @@ -59,20 +59,6 @@ int do_help(User * u) notice_help(s_OperServ, u, OPER_HELP); moduleDisplayHelp(5, u); notice_help(s_OperServ, u, OPER_HELP_LOGGED); - } else if ((stricmp(cmd, "LOGONNEWS") == 0) && - findModule("os_logonnews")) { - Command *c = findCommand(OPERSERV, cmd); - - notice_help(s_OperServ, u, NEWS_HELP_LOGON, NewsCount); - do_help_limited(s_OperServ, u, c); - - } else if ((stricmp(cmd, "OPERNEWS") == 0) && - findModule("os_opernews")) { - Command *c = findCommand(OPERSERV, cmd); - - notice_help(s_OperServ, u, NEWS_HELP_OPER, NewsCount); - do_help_limited(s_OperServ, u, c); - } else { mod_help_cmd(s_OperServ, u, OPERSERV, cmd); } diff --git a/src/core/os_logonnews.c b/src/core/os_logonnews.c index 91cf86ba6..20516c473 100644 --- a/src/core/os_logonnews.c +++ b/src/core/os_logonnews.c @@ -15,7 +15,11 @@ #include "module.h" +Command *c; + void myOperServHelp(User * u); +int load_config(void); +int reload_config(int argc, char **argv); /** * Create the command, and tell anope about it. @@ -25,7 +29,8 @@ void myOperServHelp(User * u); **/ int AnopeInit(int argc, char **argv) { - Command *c; + EvtHook *hook; + char buf[BUFSIZE]; moduleAddAuthor("Anope"); moduleAddVersion("$Id$"); @@ -36,11 +41,19 @@ int AnopeInit(int argc, char **argv) * we can look at moving it here later **/ c = createCommand("LOGONNEWS", do_logonnews, is_services_admin, - -1, -1, -1, -1, -1); + NEWS_HELP_LOGON, -1, -1, -1, -1); + snprintf(buf, BUFSIZE, "%d", NewsCount), + c->help_param1 = sstrdup(buf); moduleAddCommand(OPERSERV, c, MOD_UNIQUE); moduleSetOperHelp(myOperServHelp); + hook = createEventHook(EVENT_RELOAD, reload_config); + if (moduleAddEventHook(hook) != MOD_ERR_OK) { + alog("[\002os_logonnews\002] Can't hook to EVENT_RELOAD event"); + return MOD_STOP; + } + return MOD_CONT; } @@ -49,7 +62,7 @@ int AnopeInit(int argc, char **argv) **/ void AnopeFini(void) { - + free(c->help_param1); } @@ -63,3 +76,23 @@ void myOperServHelp(User * u) notice_lang(s_OperServ, u, OPER_HELP_CMD_LOGONNEWS); } } + + +/** + * Upon /os reload refresh the count + **/ +int reload_config(int argc, char **argv) { + char buf[BUFSIZE]; + + if (argc >= 1) { + if (!stricmp(argv[0], EVENT_START)) { + free(c->help_param1); + snprintf(buf, BUFSIZE, "%d", NewsCount), + c->help_param1 = sstrdup(buf); + } + } + + return MOD_CONT; +} + +/* EOF */ diff --git a/src/core/os_opernews.c b/src/core/os_opernews.c index 59dc8b82b..dc9b3006a 100644 --- a/src/core/os_opernews.c +++ b/src/core/os_opernews.c @@ -15,7 +15,11 @@ #include "module.h" +Command *c; + void myOperServHelp(User * u); +int load_config(void); +int reload_config(int argc, char **argv); /** * Create the command, and tell anope about it. @@ -25,7 +29,8 @@ void myOperServHelp(User * u); **/ int AnopeInit(int argc, char **argv) { - Command *c; + EvtHook *hook; + char buf[BUFSIZE]; moduleAddAuthor("Anope"); moduleAddVersion("$Id$"); @@ -35,12 +40,20 @@ int AnopeInit(int argc, char **argv) * For some unknown reason, do_opernews is actaully defined in news.c * we can look at moving it here later **/ - c = createCommand("OPERNEWS", do_opernews, is_services_admin, - -1, -1, -1, -1, -1); + c = createCommand("OPERNEWS", do_opernews, is_services_admin, + NEWS_HELP_OPER, -1, -1, -1, -1); + snprintf(buf, BUFSIZE, "%d", NewsCount), + c->help_param1 = sstrdup(buf); moduleAddCommand(OPERSERV, c, MOD_UNIQUE); moduleSetOperHelp(myOperServHelp); + hook = createEventHook(EVENT_RELOAD, reload_config); + if (moduleAddEventHook(hook) != MOD_ERR_OK) { + alog("[\002os_opernews\002] Can't hook to EVENT_RELOAD event"); + return MOD_STOP; + } + return MOD_CONT; } @@ -49,7 +62,7 @@ int AnopeInit(int argc, char **argv) **/ void AnopeFini(void) { - + free(c->help_param1); } @@ -63,3 +76,22 @@ void myOperServHelp(User * u) notice_lang(s_OperServ, u, OPER_HELP_CMD_OPERNEWS); } } + +/** + * Upon /os reload refresh the count + **/ +int reload_config(int argc, char **argv) { + char buf[BUFSIZE]; + + if (argc >= 1) { + if (!stricmp(argv[0], EVENT_START)) { + free(c->help_param1); + snprintf(buf, BUFSIZE, "%d", NewsCount), + c->help_param1 = sstrdup(buf); + } + } + + return MOD_CONT; +} + +/* EOF */ diff --git a/version.log b/version.log index 3722f74a6..d853b284c 100644 --- a/version.log +++ b/version.log @@ -9,14 +9,19 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="21" VERSION_EXTRA="-svn" -VERSION_BUILD="1431" +VERSION_BUILD="1432" # $Log$ # +# BUILD : 1.7.21 (1432) +# BUGS : +# NOTES : The newscount in help is now handled by modules instead of +# os_help. +# +# # BUILD : 1.7.21 (1431) # BUGS : -# NOTES : Fixes possible mismatches in entry_match() introduced in -# previous commit. +# NOTES : Fixes possible mismatches in entry_match() introduced in previous commit. # # BUILD : 1.7.21 (1430) # BUGS : |