summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2007-08-28 14:20:44 +0000
committergeniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2007-08-28 14:20:44 +0000
commitd5594b84ee2b6ef9370bdee6b727ed82f0370d30 (patch)
treeafcb3db2fe36fc67b3abcc772bfde38843f755dc /src
parentdbcca23f378ea8e19fbffd8b2b8c39a8c678961d (diff)
BUILD : 1.7.19 (1282) BUGS : 729 NOTES : Changed the "Limited to ..." lines in help replies to automatically appended lines
git-svn-id: svn://svn.anope.org/anope/trunk@1282 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1000 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/commands.c27
-rw-r--r--src/core/os_akill.c1
-rw-r--r--src/core/os_modload.c1
-rw-r--r--src/send.c2
4 files changed, 31 insertions, 0 deletions
diff --git a/src/commands.c b/src/commands.c
index 4deecb0c1..4460678db 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -127,6 +127,31 @@ void do_run_cmd(char *service, User * u, Command * c, const char *cmd)
/*************************************************************************/
/**
+ * Output the 'Limited to' line for the given command
+ * @param service Services Client
+ * @param u User Struct
+ * @param c Command Struct
+ * @return void
+ */
+void do_help_limited(char *service, User * u, Command * c)
+{
+ if (c->has_priv == is_services_oper)
+ notice_lang(service, u, HELP_LIMIT_SERV_OPER);
+ else if (c->has_priv == is_services_admin)
+ notice_lang(service, u, HELP_LIMIT_SERV_ADMIN);
+ else if (c->has_priv == is_services_root)
+ notice_lang(service, u, HELP_LIMIT_SERV_ROOT);
+ else if (c->has_priv == is_oper)
+ notice_lang(service, u, HELP_LIMIT_IRC_OPER);
+ else if (c->has_priv == is_host_setter)
+ notice_lang(service, u, HELP_LIMIT_HOST_SETTER);
+ else if (c->has_priv == is_host_remover)
+ notice_lang(service, u, HELP_LIMIT_HOST_REMOVER);
+}
+
+/*************************************************************************/
+
+/**
* Print a help message for the given command.
* @param services Services Client
* @param u User Struct
@@ -202,6 +227,8 @@ void do_help_cmd(char *service, User * u, Command * c, const char *cmd)
}
if (has_had_help == 0) {
notice_lang(service, u, NO_HELP_AVAILABLE, cmd);
+ } else {
+ do_help_limited(service, u, c);
}
mod_current_module = calling_module;
diff --git a/src/core/os_akill.c b/src/core/os_akill.c
index 7b1a5f616..a37b58821 100644
--- a/src/core/os_akill.c
+++ b/src/core/os_akill.c
@@ -65,6 +65,7 @@ void myOperServHelp(User * u)
{
if (is_services_oper(u)) {
notice_lang(s_OperServ, u, OPER_HELP_CMD_AKILL);
+ notice_lang(s_OperServ, u, HELP_LIMIT_SERV_OPER);
}
}
diff --git a/src/core/os_modload.c b/src/core/os_modload.c
index 10b72703a..ca782ce0b 100644
--- a/src/core/os_modload.c
+++ b/src/core/os_modload.c
@@ -59,6 +59,7 @@ void myOperServHelp(User * u)
{
if (is_services_root(u)) {
notice_lang(s_OperServ, u, OPER_HELP_CMD_MODLOAD);
+ notice_lang(s_OperServ, u, HELP_LIMIT_SERV_ROOT);
}
}
diff --git a/src/send.c b/src/send.c
index 7ef63222f..beb19d077 100644
--- a/src/send.c
+++ b/src/send.c
@@ -187,11 +187,13 @@ void notice_lang(char *source, User * dest, int message, ...)
char buf[4096]; /* because messages can be really big */
char *s, *t;
const char *fmt;
+
if (!dest || !message) {
return;
}
va_start(args, message);
fmt = getstring(dest->na, message);
+
if (!fmt)
return;
memset(buf, 0, 4096);