From 52489879079b9feff88d3464d97440d9dc9234e2 Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Sat, 24 Sep 2011 22:18:39 +0200 Subject: [PATCH 1/3] Added several new features to the nickserv module This includes a feature to ghost, which simply calls the ghost feature of the actual nickserv. Same goes for group, recover and release. These are called by simply doing /msg *nickserv ghost etc. The changes made actually explain themselves when doing something like /msg *nickserv help. This is really just so we can be lazy and execute nickserv commands that require a password without knowing the password ourselves. Signed-off-by: Toon Schoenmakers --- modules/nickserv.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/nickserv.cpp b/modules/nickserv.cpp index 186396e9..f2fc65bd 100644 --- a/modules/nickserv.cpp +++ b/modules/nickserv.cpp @@ -43,9 +43,27 @@ public: } else if (sCmdName == "clear") { m_sPass = ""; DelNV("Password"); - } else { - PutModule("Commands: set , clear"); - } + } else if (sCmdName == "ghost") { + if(sCommand.Token(1).empty()) { + PutModule("Syntax: ghost "); + } 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 "); + else + PutIRC("PRIVMSG NickServ :RECOVER " + sCommand.Token(1) + " " + m_sPass); + } else if (sCmdName == "release") { + if(sCommand.Token(1).empty()) + PutModule("Syntax: release "); + else + PutIRC("PRIVMSG NickServ :RELEASE " + sCommand.Token(1) + " " + m_sPass); + } else + PutModule("Commands: set , clear, ghost , group, release , recover "); } void HandleMessage(CNick& Nick, const CString& sMessage) From 232d2612fea1230681d9c55d74eaab09b273206f Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Sat, 24 Sep 2011 22:34:45 +0200 Subject: [PATCH 2/3] This avoids your irc windows being filled with away stuff Downside of antiidle is that because it messages yourself internally the irc server will send messages to you when you're marked as away. This can end up being really annoying, so those messages are blocked with these changes. Signed-off-by: Toon Schoenmakers --- modules/extra/antiidle.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/extra/antiidle.cpp b/modules/extra/antiidle.cpp index 3b515daf..d1b3ed8e 100644 --- a/modules/extra/antiidle.cpp +++ b/modules/extra/antiidle.cpp @@ -72,6 +72,15 @@ public: 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) { From 23acbe42a6c244c3ce132f55ae06d01a959ccc5b Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Sun, 25 Sep 2011 01:58:23 +0200 Subject: [PATCH 3/3] Implemented a OnInvite hook This hook will be called when the user get's invited into a channel because we don't have a CChan of this channel yet this won't be send through the hook. Instead a CString with the name of the channel is send. Signed-off-by: Toon Schoenmakers --- IRCSock.cpp | 2 ++ Modules.cpp | 2 ++ Modules.h | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/IRCSock.cpp b/IRCSock.cpp index ff40d730..7867f6d6 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -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); } } diff --git a/Modules.cpp b/Modules.cpp index 7d1a9fec..33600418 100644 --- a/Modules.cpp +++ b/Modules.cpp @@ -513,6 +513,7 @@ void CModule::OnNick(const CNick& Nick, const CString& sNewNick, const vector