Merge pull request #754 from jpnurmi/ready

Add CClient::IsPlaybackActive()
This commit is contained in:
Alexey Sokolov
2014-12-04 21:56:13 +00:00
4 changed files with 19 additions and 0 deletions
+5
View File
@@ -97,6 +97,7 @@ public:
m_bServerTime = false;
m_bBatch = false;
m_bSelfMessage = false;
m_bPlaybackActive = false;
EnableReadLine();
// RFC says a line can have 512 chars max, but we are
// a little more gentle ;)
@@ -129,6 +130,9 @@ public:
void BouncedOff();
bool IsAttached() const { return m_pUser != NULL; }
bool IsPlaybackActive() const { return m_bPlaybackActive; }
void SetPlaybackActive(bool bActive) { m_bPlaybackActive = bActive; }
void PutIRC(const CString& sLine);
void PutClient(const CString& sLine);
unsigned int PutStatus(const CTable& table);
@@ -176,6 +180,7 @@ protected:
bool m_bServerTime;
bool m_bBatch;
bool m_bSelfMessage;
bool m_bPlaybackActive;
CUser* m_pUser;
CIRCNetwork* m_pNetwork;
CString m_sNick;
+5
View File
@@ -578,6 +578,9 @@ void CChan::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
for (size_t uClient = 0; uClient < vClients.size(); ++uClient) {
CClient * pUseClient = (pClient ? pClient : vClients[uClient]);
bool bWasPlaybackActive = pUseClient->IsPlaybackActive();
pUseClient->SetPlaybackActive(true);
bool bSkipStatusMsg = pUseClient->HasServerTime();
NETWORKMODULECALL(OnChanBufferStarting(*this, *pUseClient), m_pNetwork->GetUser(), m_pNetwork, NULL, &bSkipStatusMsg);
@@ -617,6 +620,8 @@ void CChan::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
m_pNetwork->PutUser(":znc.in BATCH -" + sBatchName, pUseClient);
}
pUseClient->SetPlaybackActive(bWasPlaybackActive);
if (pClient)
break;
}
+4
View File
@@ -579,6 +579,8 @@ void CIRCNetwork::ClientConnected(CClient *pClient) {
size_t uIdx, uSize;
pClient->SetPlaybackActive(true);
if (m_RawBuffer.IsEmpty()) {
pClient->PutClient(":irc.znc.in 001 " + pClient->GetNick() + " :- Welcome to ZNC -");
} else {
@@ -657,6 +659,8 @@ void CIRCNetwork::ClientConnected(CClient *pClient) {
}
m_NoticeBuffer.Clear();
pClient->SetPlaybackActive(false);
// Tell them why they won't connect
if (!GetIRCConnectEnabled())
pClient->PutStatus("You are currently disconnected from IRC. "
+5
View File
@@ -44,6 +44,9 @@ void CQuery::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
for (size_t uClient = 0; uClient < vClients.size(); ++uClient) {
CClient * pUseClient = (pClient ? pClient : vClients[uClient]);
bool bWasPlaybackActive = pUseClient->IsPlaybackActive();
pUseClient->SetPlaybackActive(true);
bool bBatch = pUseClient->HasBatch();
CString sBatchName = m_sName.MD5();
@@ -78,6 +81,8 @@ void CQuery::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
m_pNetwork->PutUser(":znc.in BATCH -" + sBatchName, pUseClient);
}
pUseClient->SetPlaybackActive(bWasPlaybackActive);
if (pClient)
break;
}