Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bouncedcc should use PutUser() and not m_pUser->PutUser()

  • Loading branch information...
commit 6ae491ca66e8f7d8c4fe3caca3adbe147c7e552c 1 parent eb1abb5
@kylef kylef authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 modules/bouncedcc.cpp
View
11 modules/bouncedcc.cpp
@@ -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");
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.