mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Added QuitMsg config option
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@166 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -37,7 +37,7 @@ CIRCSock::~CIRCSock() {
|
||||
m_pZNC->ReleaseISpoof();
|
||||
}
|
||||
|
||||
PutServ("QUIT :");
|
||||
PutServ("QUIT :" + m_pUser->GetQuitMsg());
|
||||
m_msChans.clear();
|
||||
}
|
||||
|
||||
|
||||
2
User.cpp
2
User.cpp
@@ -377,6 +377,7 @@ void CUser::SetDenyLoadMod(bool b) { m_bDenyLoadMod = b; }
|
||||
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; }
|
||||
|
||||
bool CUser::SetStatusPrefix(const string& s) {
|
||||
if ((!s.empty()) && (s.length() < 6) && (s.find(' ') == string::npos)) {
|
||||
@@ -412,4 +413,5 @@ const string& CUser::GetDefaultChanModes() const { return m_sDefaultChanModes; }
|
||||
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; }
|
||||
// !Getters
|
||||
|
||||
3
User.h
3
User.h
@@ -69,6 +69,7 @@ public:
|
||||
void SetDefaultChanModes(const string& s);
|
||||
void SetIRCNick(const CNick& n);
|
||||
void SetIRCServer(const string& s);
|
||||
void SetQuitMsg(const string& s);
|
||||
// !Setters
|
||||
|
||||
// Getters
|
||||
@@ -99,6 +100,7 @@ public:
|
||||
const vector<CChan*>& GetChans() const;
|
||||
const CNick& GetIRCNick() const;
|
||||
const string& GetIRCServer() const;
|
||||
const string& GetQuitMsg() const;
|
||||
// !Getters
|
||||
private:
|
||||
protected:
|
||||
@@ -115,6 +117,7 @@ protected:
|
||||
string m_sDefaultChanModes;
|
||||
CNick m_IRCNick;
|
||||
string m_sIRCServer;
|
||||
string m_sQuitMsg;
|
||||
|
||||
bool m_bPassHashed;
|
||||
bool m_bUseClientIP;
|
||||
|
||||
@@ -454,6 +454,12 @@ void CUserSock::UserCommand(const string& sLine) {
|
||||
pChan->DetachUser();
|
||||
}
|
||||
} else if (strcasecmp(sCommand.c_str(), "SHUTDOWN") == 0) {
|
||||
string sQuitMsg = CUtils::Token(sLine, 1, true);
|
||||
|
||||
if (!sQuitMsg.empty()) {
|
||||
m_pUser->SetQuitMsg(sQuitMsg);
|
||||
}
|
||||
|
||||
throw CException(CException::EX_Shutdown);
|
||||
} else if (strcasecmp(sCommand.c_str(), "JUMP") == 0) {
|
||||
if (m_pUser) {
|
||||
@@ -790,7 +796,7 @@ void CUserSock::HelpUser() {
|
||||
Table.AddRow(); Table.SetCell("Command", "ListNicks"); Table.SetCell("Arguments", "<#chan>"); Table.SetCell("Description", "List all nicks on a channel");
|
||||
Table.AddRow(); Table.SetCell("Command", "Topics"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "Show topics in all channels");
|
||||
Table.AddRow(); Table.SetCell("Command", "SetBuffer"); Table.SetCell("Arguments", "<#chan> [linecount]"); Table.SetCell("Description", "Set the buffer count for a channel");
|
||||
Table.AddRow(); Table.SetCell("Command", "Shutdown"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "Shutdown znc completely");
|
||||
Table.AddRow(); Table.SetCell("Command", "Shutdown"); Table.SetCell("Arguments", "[message]"); Table.SetCell("Description", "Shutdown znc completely");
|
||||
Table.AddRow(); Table.SetCell("Command", "Jump"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "Jump to the next server in the list");
|
||||
Table.AddRow(); Table.SetCell("Command", "Send"); Table.SetCell("Arguments", "<nick> <file>"); Table.SetCell("Description", "Send a shell file to a nick on IRC");
|
||||
Table.AddRow(); Table.SetCell("Command", "Get"); Table.SetCell("Arguments", "<file>"); Table.SetCell("Description", "Send a shell file to yourself");
|
||||
|
||||
1
znc.conf
1
znc.conf
@@ -36,6 +36,7 @@ StatusPrefix = *
|
||||
Ident = znc
|
||||
RealName = Got ZNC?
|
||||
#VHost = uncomment.and.put.your.vhost.here.com
|
||||
QuitMsg = 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(), "QuitMsg") == 0) {
|
||||
pUser->SetQuitMsg(sValue);
|
||||
continue;
|
||||
} else if (strcasecmp(sName.c_str(), "AltNick") == 0) {
|
||||
pUser->SetAltNick(sValue);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user