mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Add OnUserQuit() for extending clearbufferonmsg
Add OnUserQuit() callback. On smartphone, user doesn't want to see same lines repeatedly. But, meanwhile, user doesn't want to miss lines when connection was lost. To do it, this uses OnUserQuit() callback. With this callback, clearbufferonmsg can clear buffer if user quited client explicitly. And when connection was lost, buffer is still not cleared.
This commit is contained in:
@@ -198,6 +198,8 @@ void CClient::ReadLine(const CString& sData) {
|
||||
// Block PONGs, we already responded to the pings
|
||||
return;
|
||||
} else if (sCommand.Equals("QUIT")) {
|
||||
CString sMsg = sLine.Token(1, true).TrimPrefix_n();
|
||||
NETWORKMODULECALL(OnUserQuit(sMsg), m_pUser, m_pNetwork, this, NOTHING);
|
||||
Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach
|
||||
return; // Don't forward this msg. We don't want the client getting us disconnected.
|
||||
} else if (sCommand.Equals("PROTOCTL")) {
|
||||
|
||||
Reference in New Issue
Block a user