mirror of
https://github.com/znc/znc.git
synced 2026-07-21 09:03:32 +02:00
Slight refactor of CBuffer & CBufLine.
This is in preparation of adding more attributes to a CBufLine. Going forward, at least savebuf will need access to all of these to properly serialize buffers. Basically, instead of relying on `GetLine()` to return `false`, the caller is now expected to check bounds himself using `Size()`.
This commit is contained in:
@@ -148,9 +148,10 @@ public:
|
||||
|
||||
CString sFile = CRYPT_VERIFICATION_TOKEN;
|
||||
|
||||
unsigned int uIdx = 0;
|
||||
while (Buffer.GetLineFormat(uIdx++, sLine)) {
|
||||
sFile += sLine + "\n";
|
||||
unsigned int uSize = Buffer.Size();
|
||||
for (unsigned int uIdx = 0; uIdx < uSize; uIdx++) {
|
||||
const CBufLine& Line = Buffer.GetBufLine(uIdx);
|
||||
sFile += Line.GetFormat() + "\n";
|
||||
}
|
||||
|
||||
CBlowfish c(m_sPassword, BF_ENCRYPT);
|
||||
|
||||
+3
-4
@@ -170,11 +170,10 @@ public:
|
||||
MCString msParams;
|
||||
msParams["target"] = m_pNetwork->GetCurNick();
|
||||
|
||||
CString sBufLine;
|
||||
while (m_Buffer.GetNextLine(sBufLine, msParams)) {
|
||||
PutUser(sBufLine);
|
||||
unsigned int uSize = m_Buffer.Size();
|
||||
for (unsigned int uIdx = 0; uIdx < uSize; uIdx++) {
|
||||
PutUser(m_Buffer.GetLine(uIdx, msParams));
|
||||
}
|
||||
|
||||
m_Buffer.Clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user