summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-06 10:43:34 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-06 10:43:34 +0000
commit1d994c544474da53159257d9097997c0744a48a5 (patch)
tree1933ef85eb507645ed17f32ed5d69cd1fc2e3cb2 /include
parentd4bcf45eb3ef838d878971dbcd585510729fcff1 (diff)
Added support for SVS-style Server class methods for modules
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@400 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/inspircd.h4
-rw-r--r--include/modules.h35
2 files changed, 38 insertions, 1 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 3d1872d01..7d7971532 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -102,4 +102,8 @@ bool ModeDefined(char c, int i);
bool ModeDefinedOper(char c, int i);
int ModeDefinedOn(char c, int i);
int ModeDefinedOff(char c, int i);
+chanrec* add_channel(userrec *user, const char* cn, const char* key);
+chanrec* del_channel(userrec *user, const char* cname, const char* reason);
+void force_nickchange(userrec* user,const char* newnick);
+void kill_link(userrec *user,const char* r);
diff --git a/include/modules.h b/include/modules.h
index 089ef0afc..d2c578b04 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -184,7 +184,7 @@ class Module : public classbase
* processing on the actual channel record at this point, however the channel NAME will still be passed in
* char* cname, so that you could for example implement a channel blacklist or whitelist, etc.
*/
- virtual int OnUserPreJoin(userrec* user, chanrec* chan, char* cname);
+ virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname);
/** Called whenever a user opers locally.
@@ -384,6 +384,39 @@ class Server : public classbase
* user must have both modes set to receive the message.
*/
virtual void SendToModeMask(std::string modes, int flags, std::string text);
+
+ /** Forces a user to join a channel.
+ * This is similar to svsjoin and can be used to implement redirection, etc.
+ * On success, the return value is a valid pointer to a chanrec* of the channel the user was joined to.
+ * On failure, the result is NULL.
+ */
+ virtual chanrec* Server::JoinUserToChannel(userrec* user, std::string cname, std::string key);
+
+ /** Forces a user to part a channel.
+ * This is similar to svspart and can be used to implement redirection, etc.
+ * Although the return value of this function is a pointer to a channel record, the returned data is
+ * undefined and should not be read or written to. This behaviour may be changed in a future version.
+ */
+ virtual chanrec* Server::PartUserFromChannel(userrec* user, std::string cname, std::string reason);
+
+ /** Forces a user nickchange.
+ * This command works similarly to SVSNICK, and can be used to implement Q-lines etc.
+ * If you specify an invalid nickname, the nick change will be dropped and the target user will receive
+ * the error numeric for it.
+ */
+ virtual void ChangeUserNick(userrec* user, std::string nickname);
+
+ /** Forces a user to quit with the specified reason.
+ * To the user, it will appear as if they typed /QUIT themselves, except for the fact that this function
+ * may bypass the quit prefix specified in the config file.
+ *
+ * WARNING!
+ *
+ * Once you call this function, userrec* user will immediately become INVALID. You MUST NOT write to, or
+ * read from this pointer after calling the QuitUser method UNDER ANY CIRCUMSTANCES! The best course of
+ * action after calling this method is to immediately bail from your handler.
+ */
+ virtual void QuitUser(userrec* user, std::string reason);
};
/** Allows reading of values from configuration files