mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Added VersionReply config option
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@167 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
14
IRCSock.cpp
14
IRCSock.cpp
@@ -613,8 +613,18 @@ bool CIRCSock::OnPrivCTCP(const string& sNickMask, string& sMessage) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// DCC CHAT chat 2453612361 44592
|
||||
if (strncasecmp(sMessage.c_str(), "DCC ", 4) == 0) {
|
||||
if (strcasecmp(sMessage.c_str(), "VERSION") == 0) {
|
||||
if (!IsUserAttached()) {
|
||||
string sVersionReply = m_pUser->GetVersionReply();
|
||||
|
||||
if (sVersionReply.empty()) {
|
||||
sVersionReply = "ZNC by prozac - http://znc.sourceforge.net";
|
||||
}
|
||||
|
||||
PutServ("NOTICE " + CNick(sNickMask).GetNick() + " :\001VERSION " + sVersionReply + "\001");
|
||||
}
|
||||
} else if (strncasecmp(sMessage.c_str(), "DCC ", 4) == 0) {
|
||||
// DCC CHAT chat 2453612361 44592
|
||||
string sType = CUtils::Token(sMessage, 1);
|
||||
string sFile = CUtils::Token(sMessage, 2);
|
||||
unsigned long uLongIP = strtoul(CUtils::Token(sMessage, 3).c_str(), NULL, 10);
|
||||
|
||||
2
User.cpp
2
User.cpp
@@ -378,6 +378,7 @@ void CUser::SetDefaultChanModes(const string& s) { m_sDefaultChanModes = s; }
|
||||
void CUser::SetIRCNick(const CNick& n) { m_IRCNick = n; }
|
||||
void CUser::SetIRCServer(const string& s) { m_sIRCServer = s; }
|
||||
void CUser::SetQuitMsg(const string& s) { m_sQuitMsg = s; }
|
||||
void CUser::SetVersionReply(const string& s) { m_sVersionReply = s; }
|
||||
|
||||
bool CUser::SetStatusPrefix(const string& s) {
|
||||
if ((!s.empty()) && (s.length() < 6) && (s.find(' ') == string::npos)) {
|
||||
@@ -414,4 +415,5 @@ const vector<CChan*>& CUser::GetChans() const { return m_vChans; }
|
||||
const CNick& CUser::GetIRCNick() const { return m_IRCNick; }
|
||||
const string& CUser::GetIRCServer() const { return m_sIRCServer; }
|
||||
const string& CUser::GetQuitMsg() const { return m_sQuitMsg; }
|
||||
const string& CUser::GetVersionReply() const { return m_sVersionReply; }
|
||||
// !Getters
|
||||
|
||||
3
User.h
3
User.h
@@ -70,6 +70,7 @@ public:
|
||||
void SetIRCNick(const CNick& n);
|
||||
void SetIRCServer(const string& s);
|
||||
void SetQuitMsg(const string& s);
|
||||
void SetVersionReply(const string& s);
|
||||
// !Setters
|
||||
|
||||
// Getters
|
||||
@@ -101,6 +102,7 @@ public:
|
||||
const CNick& GetIRCNick() const;
|
||||
const string& GetIRCServer() const;
|
||||
const string& GetQuitMsg() const;
|
||||
const string& GetVersionReply() const;
|
||||
// !Getters
|
||||
private:
|
||||
protected:
|
||||
@@ -118,6 +120,7 @@ protected:
|
||||
CNick m_IRCNick;
|
||||
string m_sIRCServer;
|
||||
string m_sQuitMsg;
|
||||
string m_sVersionReply;
|
||||
|
||||
bool m_bPassHashed;
|
||||
bool m_bUseClientIP;
|
||||
|
||||
1
znc.conf
1
znc.conf
@@ -37,6 +37,7 @@ StatusPrefix = *
|
||||
RealName = Got ZNC?
|
||||
#VHost = uncomment.and.put.your.vhost.here.com
|
||||
QuitMsg = ZNC by prozac - http://znc.sourceforge.net
|
||||
VersionReply = ZNC by prozac - http://znc.sourceforge.net
|
||||
ChanModes = +stn
|
||||
KeepNick = true
|
||||
|
||||
|
||||
3
znc.cpp
3
znc.cpp
@@ -370,6 +370,9 @@ bool CZNC::ParseConfig(const string& sConfigFile) {
|
||||
if (strcasecmp(sName.c_str(), "Nick") == 0) {
|
||||
pUser->SetNick(sValue);
|
||||
continue;
|
||||
} else if (strcasecmp(sName.c_str(), "VersionReply") == 0) {
|
||||
pUser->SetVersionReply(sValue);
|
||||
continue;
|
||||
} else if (strcasecmp(sName.c_str(), "QuitMsg") == 0) {
|
||||
pUser->SetQuitMsg(sValue);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user