Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #71 from schoentoon/master

A few new nickserv commands, little annoyance fix and a new hook
  • Loading branch information...
commit 0acf0de2040994fd7d06feb271ba06eb2b83a129 2 parents 2dcb3ef + 23acbe4
Uli Schlachter psychon authored
2  IRCSock.cpp
View
@@ -711,6 +711,8 @@ void CIRCSock::ReadLine(const CString& sData) {
}
// Don't forward any CAP stuff to the client
return;
+ } else if (sCmd.Equals("INVITE")) {
+ NETWORKMODULECALL(OnInvite(sLine.Token(3).TrimPrefix_n(":")), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);
}
}
2  Modules.cpp
View
@@ -513,6 +513,7 @@ void CModule::OnNick(const CNick& Nick, const CString& sNewNick, const vector<CC
void CModule::OnKick(const CNick& Nick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) {}
void CModule::OnJoin(const CNick& Nick, CChan& Channel) {}
void CModule::OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage) {}
+void CModule::OnInvite(const CString& sChan) {}
CModule::EModRet CModule::OnChanBufferStarting(CChan& Chan, CClient& Client) { return CONTINUE; }
CModule::EModRet CModule::OnChanBufferEnding(CChan& Chan, CClient& Client) { return CONTINUE; }
@@ -685,6 +686,7 @@ bool CModules::OnNick(const CNick& Nick, const CString& sNewNick, const vector<C
bool CModules::OnKick(const CNick& Nick, const CString& sKickedNick, CChan& Channel, const CString& sMessage) { MODUNLOADCHK(OnKick(Nick, sKickedNick, Channel, sMessage)); return false; }
bool CModules::OnJoin(const CNick& Nick, CChan& Channel) { MODUNLOADCHK(OnJoin(Nick, Channel)); return false; }
bool CModules::OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage) { MODUNLOADCHK(OnPart(Nick, Channel, sMessage)); return false; }
+bool CModules::OnInvite(const CString& sChan) { MODUNLOADCHK(OnInvite(sChan)); return false; }
bool CModules::OnChanBufferStarting(CChan& Chan, CClient& Client) { MODHALTCHK(OnChanBufferStarting(Chan, Client)); }
bool CModules::OnChanBufferEnding(CChan& Chan, CClient& Client) { MODHALTCHK(OnChanBufferEnding(Chan, Client)); }
bool CModules::OnChanBufferPlayLine(CChan& Chan, CClient& Client, CString& sLine) { MODHALTCHK(OnChanBufferPlayLine(Chan, Client, sLine)); }
5 Modules.h
View
@@ -552,6 +552,10 @@ class CModule {
* @param sMessage The part message.
*/
virtual void OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage);
+ /** Called when user is invited into a channel
+ * @param sChan The channel the user got invited into
+ */
+ virtual void OnInvite(const CString& sChan);
/** Called before a channel buffer is played back to a client.
* @param Chan The channel which will be played back.
@@ -1046,6 +1050,7 @@ class CModules : public vector<CModule*> {
bool OnKick(const CNick& Nick, const CString& sOpNick, CChan& Channel, const CString& sMessage);
bool OnJoin(const CNick& Nick, CChan& Channel);
bool OnPart(const CNick& Nick, CChan& Channel, const CString& sMessage);
+ bool OnInvite(const CString& sChan);
bool OnChanBufferStarting(CChan& Chan, CClient& Client);
bool OnChanBufferEnding(CChan& Chan, CClient& Client);
9 modules/extra/antiidle.cpp
View
@@ -72,6 +72,15 @@ class CAntiIdle : public CModule
return CONTINUE;
}
+ virtual EModRet OnRaw(CString &sLine)
+ {
+ VCString splitted;
+ sLine.Split(" ",splitted);
+ if(splitted[1] == "301" && splitted[2].Equals(m_pNetwork->GetIRCNick().GetNick()))
+ return HALT;
+ return CONTINUE;
+ }
+
private:
void SetInterval(int i)
{
24 modules/nickserv.cpp
View
@@ -43,9 +43,27 @@ class CNickServ : public CModule
} else if (sCmdName == "clear") {
m_sPass = "";
DelNV("Password");
- } else {
- PutModule("Commands: set <password>, clear");
- }
+ } else if (sCmdName == "ghost") {
+ if(sCommand.Token(1).empty()) {
+ PutModule("Syntax: ghost <nickname>");
+ } else {
+ PutIRC("PRIVMSG NickServ :GHOST " + sCommand.Token(1) + " " + m_sPass);
+ }
+ } else if (sCmdName == "group") {
+ CString sConfNick = m_pUser->GetNick();
+ PutIRC("PRIVMSG NickServ :GROUP " + sConfNick + " " + m_sPass);
+ } else if (sCmdName == "recover") {
+ if(sCommand.Token(1).empty())
+ PutModule("Syntax: recover <nickname>");
+ else
+ PutIRC("PRIVMSG NickServ :RECOVER " + sCommand.Token(1) + " " + m_sPass);
+ } else if (sCmdName == "release") {
+ if(sCommand.Token(1).empty())
+ PutModule("Syntax: release <nickname>");
+ else
+ PutIRC("PRIVMSG NickServ :RELEASE " + sCommand.Token(1) + " " + m_sPass);
+ } else
+ PutModule("Commands: set <password>, clear, ghost <nickname>, group, release <nickname>, recover <nickname>");
}
void HandleMessage(CNick& Nick, const CString& sMessage)
Please sign in to comment.
Something went wrong with that request. Please try again.