savebuff: save & load query buffers - fixes #802

The old internal storage format was:

    ::__:SAVEBUFF:__::<buffer lines>

The new storage format for channels:

    ::__:CHANBUFF:__::<buffer name>
    <buffer lines>

The new storage format for queries:

    ::__:QUERYBUFF:__::<buffer name>
    <buffer lines>

See #802 for details why the storage format had to be changed. Reading
the old storage format is still supported so old saved buffers load as
appropriate.
This commit is contained in:
J-P Nurmi
2015-01-04 14:37:18 +01:00
parent 230a39f079
commit 045f7752cb
2 changed files with 159 additions and 110 deletions

View File

@@ -38,12 +38,13 @@ void CQuery::SendBuffer(CClient* pClient, const CBuffer& Buffer) {
if (m_pNetwork && m_pNetwork->IsUserAttached()) {
// Based on CChan::SendBuffer()
if (!Buffer.IsEmpty()) {
MCString msParams;
msParams["target"] = m_pNetwork->GetIRCNick().GetNick();
const vector<CClient*> & vClients = m_pNetwork->GetClients();
for (size_t uClient = 0; uClient < vClients.size(); ++uClient) {
CClient * pUseClient = (pClient ? pClient : vClients[uClient]);
MCString msParams;
msParams["target"] = pUseClient->GetNick();
bool bWasPlaybackActive = pUseClient->IsPlaybackActive();
pUseClient->SetPlaybackActive(true);