Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: znc/znc
base: af24f7b
...
head fork: znc/znc
compare: 6ae491c
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Oct 16, 2011
Kyle Fuller kylef Fix the OnUserCTCP() module hook
This was broken when CClient was made network aware with ef2b2cf
eb1abb5
Kyle Fuller kylef bouncedcc should use PutUser() and not m_pUser->PutUser() 6ae491c
Showing with 8 additions and 9 deletions.
  1. +6 −5 modules/bouncedcc.cpp
  2. +2 −4 src/Client.cpp
11 modules/bouncedcc.cpp
View
@@ -9,6 +9,7 @@
#include <znc/zncconfig.h>
#include <znc/znc.h>
#include <znc/User.h>
+#include <znc/IRCNetwork.h>
#include <znc/Modules.h>
#include <znc/Socket.h>
#include <znc/FileUtils.h>
@@ -207,7 +208,7 @@ class CBounceDCCMod : public CModule {
}
virtual EModRet OnPrivCTCP(CNick& Nick, CString& sMessage) {
- if (sMessage.Equals("DCC ", false, 4) && m_pUser->IsUserAttached()) {
+ if (sMessage.Equals("DCC ", false, 4) && m_pNetwork->IsUserAttached()) {
// DCC CHAT chat 2453612361 44592
CString sType = sMessage.Token(1);
CString sFile = sMessage.Token(2);
@@ -220,14 +221,14 @@ class CBounceDCCMod : public CModule {
unsigned short uBNCPort = CDCCBounce::DCCRequest(FromNick.GetNick(), uLongIP, uPort, "", true, this, CUtils::GetIP(uLongIP));
if (uBNCPort) {
CString sIP = GetLocalDCCIP();
- m_pUser->PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pUser->GetNick() + " :\001DCC CHAT chat " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + "\001");
+ PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pNetwork->GetCurNick() + " :\001DCC CHAT chat " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + "\001");
}
} else if (sType.Equals("SEND")) {
// DCC SEND readme.txt 403120438 5550 1104
unsigned short uBNCPort = CDCCBounce::DCCRequest(Nick.GetNick(), uLongIP, uPort, sFile, false, this, CUtils::GetIP(uLongIP));
if (uBNCPort) {
CString sIP = GetLocalDCCIP();
- m_pUser->PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pUser->GetNick() + " :\001DCC SEND " + sFile + " " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + " " + CString(uFileSize) + "\001");
+ PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pNetwork->GetCurNick() + " :\001DCC SEND " + sFile + " " + CString(CUtils::GetLongIP(sIP)) + " " + CString(uBNCPort) + " " + CString(uFileSize) + "\001");
}
} else if (sType.Equals("RESUME")) {
// Need to lookup the connection by port, filter the port, and forward to the user
@@ -238,7 +239,7 @@ class CBounceDCCMod : public CModule {
CDCCBounce* pSock = (CDCCBounce*) *it;
if (pSock->GetLocalPort() == uResumePort) {
- m_pUser->PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pClient->GetNick() + " :\001DCC " + sType + " " + sFile + " " + CString(pSock->GetUserPort()) + " " + sMessage.Token(4) + "\001");
+ PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pNetwork->GetCurNick() + " :\001DCC " + sType + " " + sFile + " " + CString(pSock->GetUserPort()) + " " + sMessage.Token(4) + "\001");
}
}
} else if (sType.Equals("ACCEPT")) {
@@ -248,7 +249,7 @@ class CBounceDCCMod : public CModule {
CDCCBounce* pSock = (CDCCBounce*) *it;
if (pSock->GetUserPort() == sMessage.Token(3).ToUShort()) {
- m_pUser->PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pClient->GetNick() + " :\001DCC " + sType + " " + sFile + " " + CString(pSock->GetLocalPort()) + " " + sMessage.Token(4) + "\001");
+ PutUser(":" + Nick.GetNickMask() + " PRIVMSG " + m_pNetwork->GetCurNick() + " :\001DCC " + sType + " " + sFile + " " + CString(pSock->GetLocalPort()) + " " + sMessage.Token(4) + "\001");
}
}
}
6 src/Client.cpp
View
@@ -300,12 +300,10 @@ void CClient::ReadLine(const CString& sData) {
}
}
}
+ } else {
+ NETWORKMODULECALL(OnUserCTCP(sTarget, sCTCP), m_pUser, m_pNetwork, this, return);
}
- } else {
- NETWORKMODULECALL(OnUserCTCP(sTarget, sCTCP), m_pUser, m_pNetwork, this, return);
- }
- if (m_pNetwork) {
PutIRC("PRIVMSG " + sTarget + " :\001" + sCTCP + "\001");
}

No commit comments for this range

Something went wrong with that request. Please try again.