Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: znc/znc
base: 2dcb3ef
...
head fork: znc/znc
compare: 0acf0de
  • 4 commits
  • 5 files changed
  • 0 commit comments
  • 2 contributors
Commits on Sep 24, 2011
@schoentoon schoentoon 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 <nickname> 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 <nighteyes1993@gmail.com>
5248987
@schoentoon schoentoon 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 <nighteyes1993@gmail.com>
232d261
@schoentoon schoentoon 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 <nighteyes1993@gmail.com>
23acbe4
Commits on Sep 25, 2011
@psychon psychon Merge pull request #71 from schoentoon/master
A few new nickserv commands, little annoyance fix and a new hook
0acf0de
View
2  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);
}
}
View
2  Modules.cpp
@@ -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)); }
View
5 Modules.h
@@ -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);
View
9 modules/extra/antiidle.cpp
@@ -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)
{
View
24 modules/nickserv.cpp
@@ -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)

No commit comments for this range

Something went wrong with that request. Please try again.