diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-06 10:43:34 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-06 10:43:34 +0000 |
commit | 1d994c544474da53159257d9097997c0744a48a5 (patch) | |
tree | 1933ef85eb507645ed17f32ed5d69cd1fc2e3cb2 /src/modules.cpp | |
parent | d4bcf45eb3ef838d878971dbcd585510729fcff1 (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 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 5bea5133f..caacd9afc 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -114,7 +114,7 @@ void Module::OnPacketTransmit(char *p) { } void Module::OnPacketReceive(char *p) { } void Module::OnRehash() { } void Module::OnServerRaw(std::string &raw, bool inbound) { } -int Module::OnUserPreJoin(userrec* user, chanrec* chan, char* cname) { return 0; } +int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { return 0; } bool Module::OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms) { } Version Module::GetVersion() { return Version(1,0,0,0); } void Module::OnOper(userrec* user) { }; @@ -143,6 +143,27 @@ void Server::SendToModeMask(std::string modes, int flags, std::string text) WriteMode(modes.c_str(),flags,"%s",text.c_str()); } +chanrec* Server::JoinUserToChannel(userrec* user, std::string cname, std::string key) +{ + return add_channel(user,cname.c_str(),key.c_str()); +} + +chanrec* Server::PartUserFromChannel(userrec* user, std::string cname, std::string reason) +{ + return del_channel(user,cname.c_str(),reason.c_str()); +} + +void Server::ChangeUserNick(userrec* user, std::string nickname) +{ + force_nickchange(user,nickname.c_str()); +} + +void Server::QuitUser(userrec* user, std::string reason) +{ + kill_link(user,reason.c_str()); +} + + void Server::Log(int level, std::string s) { log(level,"%s",s.c_str()); |