summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-04 19:45:21 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-04 19:45:21 +0000
commit76f4bff71519fb2f2d73f346da74c7f8b90a99b4 (patch)
treef4dda9b3f6400cd22b399eb4d3e267acc4722e64 /src
parentf8ca9e22cc2c82d800c13e9a856bee01d777b9bb (diff)
Allow non-ops to view listmode lists
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4716 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 807675e02..31b90ed37 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -277,6 +277,23 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
log(DEBUG,"ModeParser::Process start");
+ /* Special case for displaying the list for listmodes,
+ * e.g. MODE #chan b, or MODE #chan +b without a parameter
+ */
+ if ((targetchannel) && (pcnt == 2))
+ {
+ const char* mode = parameters[1];
+ if (*mode == '+')
+ mode++;
+ unsigned char handler_id = ((*mode) - 65) | MASK_CHANNEL;
+ ModeHandler* mh = modehandlers[handler_id];
+ if ((mh) && (mh->IsListMode()))
+ {
+ mh->DisplayList(user, targetchannel);
+ }
+ return;
+ }
+
if (pcnt == 1)
{
this->DisplayCurrentModes(user, targetuser, targetchannel, parameters[0]);
@@ -321,24 +338,6 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
return;
}
- /* Special case for displaying the list for listmodes,
- * e.g. MODE #chan b, or MODE #chan +b without a parameter
- */
- if ((type== MODETYPE_CHANNEL) && (pcnt == 2))
- {
- const char* mode = parameters[1];
- if (*mode == '+')
- mode++;
-
- unsigned char handler_id = ((*mode) - 65) | mask;
- ModeHandler* mh = modehandlers[handler_id];
-
- if ((mh) && (mh->IsListMode()))
- {
- mh->DisplayList(user, targetchannel);
- }
- }
-
std::string mode_sequence = parameters[1];
std::string parameter = "";
std::ostringstream parameter_list;