summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:49:24 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:49:24 +0000
commit3d8ec5dbd9cfde34fcbc63ad7b9b1369866f0a33 (patch)
treea27087e7a9bfab5c9ed54a0bb5b8260b6bed0868 /include
parent347dcb9ef44e19e2e2613ee7e8c7d5fbb0aca4ca (diff)
Remove "servermode" parameter, replace with IS_FAKE() which is more reliable
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11633 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/mode.h15
-rw-r--r--include/modes/cmode_b.h4
-rw-r--r--include/modes/cmode_h.h2
-rw-r--r--include/modes/cmode_k.h2
-rw-r--r--include/modes/cmode_l.h2
-rw-r--r--include/modes/cmode_o.h2
-rw-r--r--include/modes/cmode_t.h2
-rw-r--r--include/modes/cmode_v.h2
-rw-r--r--include/modes/umode_o.h2
-rw-r--r--include/modes/umode_s.h2
-rw-r--r--include/modules.h2
-rw-r--r--include/u_listmode.h4
12 files changed, 20 insertions, 21 deletions
diff --git a/include/mode.h b/include/mode.h
index 0f43d6db4..a6b10475d 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -243,7 +243,7 @@ class CoreExport ModeHandler : public classbase
* @param adding This value is true when the mode is being set, or false when it is being unset.
* @return MODEACTION_ALLOW to allow the mode, or MODEACTION_DENY to prevent the mode, also see the description of 'parameter'.
*/
- virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false); /* Can change the mode parameter as its a ref */
+ virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding); /* Can change the mode parameter as its a ref */
/**
* If your mode is a listmode, then this method will be called for displaying an item list, e.g. on MODE #channel +modechar
* without any parameter or other modes in the command.
@@ -330,7 +330,7 @@ class CoreExport SimpleUserModeHandler : public ModeHandler
SimpleUserModeHandler(InspIRCd* Instance, Module* Creator, char modeletter)
: ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_USER, false) {}
virtual ~SimpleUserModeHandler() {}
- virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false);
+ virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
};
/** A prebuilt mode handler which handles a simple channel mode, e.g. no parameters, usable by any user, with no extra
@@ -344,7 +344,7 @@ class CoreExport SimpleChannelModeHandler : public ModeHandler
SimpleChannelModeHandler(InspIRCd* Instance, Module* Creator, char modeletter)
: ModeHandler(Instance, Creator, modeletter, 0, 0, false, MODETYPE_CHANNEL, false) {}
virtual ~SimpleChannelModeHandler() {}
- virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode = false);
+ virtual ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
};
/**
@@ -403,7 +403,7 @@ class CoreExport ModeWatcher : public classbase
* @return True to allow the mode change to go ahead, false to abort it. If you abort the
* change, the mode handler (and ModeWatcher::AfterMode()) will never see the mode change.
*/
- virtual bool BeforeMode(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, ModeType type, bool servermode = false);
+ virtual bool BeforeMode(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, ModeType type);
/**
* After the mode character has been processed by the ModeHandler, this method will be called.
* @param source The sender of the mode
@@ -414,7 +414,7 @@ class CoreExport ModeWatcher : public classbase
* @param adding True if the mode is being added and false if it is being removed
* @type The mode type, either MODETYPE_USER or MODETYPE_CHANNEL
*/
- virtual void AfterMode(User* source, User* dest, Channel* channel, const std::string &parameter, bool adding, ModeType type, bool servermode = false);
+ virtual void AfterMode(User* source, User* dest, Channel* channel, const std::string &parameter, bool adding, ModeType type);
};
typedef std::vector<ModeWatcher*>::iterator ModeWatchIter;
@@ -454,7 +454,7 @@ class CoreExport ModeParser : public classbase
/**
* Attempts to apply a mode change to a user or channel
*/
- ModeAction TryMode(User* user, User* targu, Channel* targc, bool adding, unsigned char mode, std::string &param, bool servermode, bool SkipACL);
+ ModeAction TryMode(User* user, User* targu, Channel* targc, bool adding, unsigned char mode, std::string &param, bool SkipACL);
/** The string representing the last set of modes to be parsed.
* Use GetLastParse() to get this value, to be used for display purposes.
@@ -541,9 +541,8 @@ class CoreExport ModeParser : public classbase
* @param user The user setting or removing the modes. When the modes are set
* by a server, an 'uninitialized' User is used, where *user::nick == NULL
* and *user->server == NULL.
- * @param servermode True if a server is setting the mode.
*/
- void Process(const std::vector<std::string>& parameters, User *user, bool servermode, bool merge = false);
+ void Process(const std::vector<std::string>& parameters, User *user, bool merge = false);
/** Find the mode handler for a given mode and type.
* @param modeletter mode letter to search for
diff --git a/include/modes/cmode_b.h b/include/modes/cmode_b.h
index db4a13508..3e4683840 100644
--- a/include/modes/cmode_b.h
+++ b/include/modes/cmode_b.h
@@ -24,8 +24,8 @@ class ModeChannelBan : public ModeHandler
BanItem b;
public:
ModeChannelBan(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
- std::string& AddBan(User *user,std::string& dest,Channel *chan,int status, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
+ std::string& AddBan(User *user,std::string& dest,Channel *chan,int status);
std::string& DelBan(User *user,std::string& dest,Channel *chan,int status);
void DisplayList(User* user, Channel* channel);
void DisplayEmptyList(User* user, Channel* channel);
diff --git a/include/modes/cmode_h.h b/include/modes/cmode_h.h
index 0873c20e6..cd6d260f4 100644
--- a/include/modes/cmode_h.h
+++ b/include/modes/cmode_h.h
@@ -23,7 +23,7 @@ class ModeChannelHalfOp : public ModeHandler
private:
public:
ModeChannelHalfOp(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
std::string AddHalfOp(User *user,const char *dest,Channel *chan,int status);
std::string DelHalfOp(User *user,const char *dest,Channel *chan,int status);
ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
diff --git a/include/modes/cmode_k.h b/include/modes/cmode_k.h
index 671143be6..a84adff5f 100644
--- a/include/modes/cmode_k.h
+++ b/include/modes/cmode_k.h
@@ -21,7 +21,7 @@ class ModeChannelKey : public ModeHandler
{
public:
ModeChannelKey(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
void RemoveMode(Channel* channel, irc::modestacker* stack = NULL);
void RemoveMode(User* user, irc::modestacker* stack = NULL);
diff --git a/include/modes/cmode_l.h b/include/modes/cmode_l.h
index eba711095..a2f1030a2 100644
--- a/include/modes/cmode_l.h
+++ b/include/modes/cmode_l.h
@@ -21,7 +21,7 @@ class ModeChannelLimit : public ModeHandler
{
public:
ModeChannelLimit(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
bool CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel* channel);
};
diff --git a/include/modes/cmode_o.h b/include/modes/cmode_o.h
index 9063d2e3c..f0b3154e2 100644
--- a/include/modes/cmode_o.h
+++ b/include/modes/cmode_o.h
@@ -23,7 +23,7 @@ class ModeChannelOp : public ModeHandler
private:
public:
ModeChannelOp(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
std::string AddOp(User *user,const char *dest,Channel *chan,int status);
std::string DelOp(User *user,const char *dest,Channel *chan,int status);
ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
diff --git a/include/modes/cmode_t.h b/include/modes/cmode_t.h
index 55226b6da..b7f87e614 100644
--- a/include/modes/cmode_t.h
+++ b/include/modes/cmode_t.h
@@ -21,5 +21,5 @@ class ModeChannelTopicOps : public ModeHandler
{
public:
ModeChannelTopicOps(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
};
diff --git a/include/modes/cmode_v.h b/include/modes/cmode_v.h
index 61fc55823..06a6ce5a5 100644
--- a/include/modes/cmode_v.h
+++ b/include/modes/cmode_v.h
@@ -23,7 +23,7 @@ class ModeChannelVoice : public ModeHandler
private:
public:
ModeChannelVoice(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
std::string AddVoice(User *user,const char *dest,Channel *chan,int status);
std::string DelVoice(User *user,const char *dest,Channel *chan,int status);
ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter);
diff --git a/include/modes/umode_o.h b/include/modes/umode_o.h
index c297bc035..9a3439ba7 100644
--- a/include/modes/umode_o.h
+++ b/include/modes/umode_o.h
@@ -21,6 +21,6 @@ class ModeUserOperator : public ModeHandler
{
public:
ModeUserOperator(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
unsigned int GetCount();
};
diff --git a/include/modes/umode_s.h b/include/modes/umode_s.h
index 39e74489e..ac85050f8 100644
--- a/include/modes/umode_s.h
+++ b/include/modes/umode_s.h
@@ -21,7 +21,7 @@ class ModeUserServerNoticeMask : public ModeHandler
{
public:
ModeUserServerNoticeMask(InspIRCd* Instance);
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode);
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding);
void OnParameterMissing(User* user, User* dest, Channel* channel);
std::string GetUserParameter(User* user);
};
diff --git a/include/modules.h b/include/modules.h
index f220e1692..c4a2e80c8 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -1160,7 +1160,7 @@ class CoreExport Module : public Extensible
* to skip all permission checking. Please note that for remote mode changes, your return value
* will be ignored!
*/
- virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt, bool servermode = true);
+ virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt);
/** Called whenever a user joins a channel, to determine if key checks should go ahead or not.
* This method will always be called for each join, wether or not the channel is actually +k, and
diff --git a/include/u_listmode.h b/include/u_listmode.h
index d6e534e07..773ca421f 100644
--- a/include/u_listmode.h
+++ b/include/u_listmode.h
@@ -268,7 +268,7 @@ class ListModeBase : public ModeHandler
/** Handle the list mode.
* See mode.h
*/
- virtual ModeAction OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
+ virtual ModeAction OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)
{
// Try and grab the list
modelist* el;
@@ -326,7 +326,7 @@ class ListModeBase : public ModeHandler
// And now add the mask onto the list...
ListItem e;
e.mask = parameter;
- e.nick = servermode ? ServerInstance->Config->ServerName : source->nick;
+ e.nick = source->nick;
e.time = stringtime(ServerInstance);
el->push_back(e);