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:
Stéphan Kochen
2011-10-16 23:05:42 +02:00
parent c3d677a4d8
commit c36480c8a1
14 changed files with 89 additions and 52 deletions

View File

@@ -353,7 +353,7 @@ void CIRCNetwork::ClientConnected(CClient *pClient) {
} else {
uSize = m_RawBuffer.Size();
for (uIdx = 0; uIdx < uSize; uIdx++) {
pClient->PutClient(m_RawBuffer.GetLine(uIdx, msParams));
pClient->PutClient(m_RawBuffer.GetLine(uIdx, *pClient, msParams));
}
// The assumption is that the client got this nick from the 001 reply
@@ -363,7 +363,7 @@ void CIRCNetwork::ClientConnected(CClient *pClient) {
// Send the cached MOTD
uSize = m_MotdBuffer.Size();
for (uIdx = 0; uIdx < uSize; uIdx++) {
pClient->PutClient(m_MotdBuffer.GetLine(uIdx, msParams));
pClient->PutClient(m_MotdBuffer.GetLine(uIdx, *pClient, msParams));
}
if (GetIRCSock() != NULL) {
@@ -393,7 +393,7 @@ void CIRCNetwork::ClientConnected(CClient *pClient) {
uSize = m_QueryBuffer.Size();
for (uIdx = 0; uIdx < uSize; uIdx++) {
CString sLine = m_QueryBuffer.GetLine(uIdx, msParams);
CString sLine = m_QueryBuffer.GetLine(uIdx, *pClient, msParams);
NETWORKMODULECALL(OnPrivBufferPlayLine(*pClient, sLine), m_pUser, this, NULL, continue);
pClient->PutClient(sLine);
}