mirror of
https://github.com/znc/znc.git
synced 2026-08-04 16:03:25 +02:00
Store and format time in CBufLine.
Buflines need to know which part of text to wrap with the timestamp. The second parameter to `AddLine` (and shorthands) is that text, which after wrapping is added as the `text` parameter to `NamedFormat`. Timestamps are formatted at the moment buffers are flushed to the client. The client parameter to `GetLine` provides access to the User and the new server-time capability.
This commit is contained in:
+2
-2
@@ -172,7 +172,7 @@ public:
|
||||
|
||||
unsigned int uSize = m_Buffer.Size();
|
||||
for (unsigned int uIdx = 0; uIdx < uSize; uIdx++) {
|
||||
PutUser(m_Buffer.GetLine(uIdx, msParams));
|
||||
PutUser(m_Buffer.GetLine(uIdx, *GetClient(), msParams));
|
||||
}
|
||||
m_Buffer.Clear();
|
||||
}
|
||||
@@ -293,7 +293,7 @@ private:
|
||||
if (m_pNetwork->IsUserAttached()) {
|
||||
m_pNetwork->PutUser(":" + WatchEntry.GetTarget() + "!watch@znc.in PRIVMSG " + m_pNetwork->GetCurNick() + " :" + sMessage);
|
||||
} else {
|
||||
m_Buffer.AddLine(":" + _NAMEDFMT(WatchEntry.GetTarget()) + "!watch@znc.in PRIVMSG {target} :" + _NAMEDFMT(m_pUser->AddTimestamp(sMessage)));
|
||||
m_Buffer.AddLine(":" + _NAMEDFMT(WatchEntry.GetTarget()) + "!watch@znc.in PRIVMSG {target} :{text}", sMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user