summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-07 18:33:24 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-07 18:33:24 +0000
commit6cfad04b9c57fc78f04f9dbb1b983409ee051481 (patch)
tree8a59b7e2212c2d2dff679cab537d5b10daafa58e /src
parentf6f348468676e053037da8ebeebbef47351202b0 (diff)
Added ability for non-opers to see simplistic /modules output
Added module flags to /modules for opers git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1003 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/commands.cpp27
-rw-r--r--src/inspircd.cpp2
2 files changed, 24 insertions, 5 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 19dd9f200..235097bdd 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -1223,10 +1223,29 @@ void handle_modules(char **parameters, int pcnt, userrec *user)
{
for (int i = 0; i < module_names.size(); i++)
{
- Version V = modules[i]->GetVersion();
- char modulename[MAXBUF];
- strlcpy(modulename,module_names[i].c_str(),256);
- WriteServ(user->fd,"900 %s :0x%08lx %d.%d.%d.%d %s",user->nick,modules[i],V.Major,V.Minor,V.Revision,V.Build,CleanFilename(modulename));
+ Version V = modules[i]->GetVersion();
+ char modulename[MAXBUF];
+ char flagstate[MAXBUF];
+ strcpy(flagstate,"");
+ if (V.Flags & VF_STATIC)
+ strlcat(flagstate,", static",MAXBUF);
+ if (V.Flags & VF_VENDOR)
+ strlcat(flagstate,", vendor",MAXBUF);
+ if (V.Flags & VF_COMMON)
+ strlcat(flagstate,", common",MAXBUF);
+ if (V.Flags & VF_SERVICEPROVIDER)
+ strlcat(flagstate,", service provider",MAXBUF);
+ if (!strlen(flagstate))
+ strcpy(flagstate," <no flags>");
+ strlcpy(modulename,module_names[i].c_str(),256);
+ if (strchr(user->modes,'o'))
+ {
+ WriteServ(user->fd,"900 %s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,modules[i],V.Major,V.Minor,V.Revision,V.Build,CleanFilename(modulename),flagstate+2);
+ }
+ else
+ {
+ WriteServ(user->fd,"900 %s :%s",user->nick,CleanFilename(modulname));
+ }
}
}
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 44b84979c..ee0780ddf 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -2998,7 +2998,7 @@ void SetupCommandTable(void)
createcommand("WHOWAS",handle_whowas,0,1,"<core>");
createcommand("CONNECT",handle_connect,'o',1,"<core>");
createcommand("SQUIT",handle_squit,'o',0,"<core>");
- createcommand("MODULES",handle_modules,'o',0,"<core>");
+ createcommand("MODULES",handle_modules,0,0,"<core>");
createcommand("LINKS",handle_links,0,0,"<core>");
createcommand("MAP",handle_map,0,0,"<core>");
createcommand("KLINE",handle_kline,'o',1,"<core>");