Rewrite Buffer to store a format string.

Will use this to allow more parameters to be inserted at the time the
buffers are flushed to the client.
This commit is contained in:
Stéphan Kochen
2011-10-16 17:31:43 +02:00
parent 2fdf54d43d
commit 948ae2510c
8 changed files with 70 additions and 75 deletions
+6 -5
View File
@@ -167,8 +167,11 @@ public:
}
virtual void OnClientLogin() {
MCString msParams;
msParams["target"] = m_pNetwork->GetCurNick();
CString sBufLine;
while (m_Buffer.GetNextLine(m_pNetwork->GetCurNick(), sBufLine)) {
while (m_Buffer.GetNextLine(sBufLine, msParams)) {
PutUser(sBufLine);
}
@@ -289,11 +292,9 @@ private:
if (WatchEntry.IsMatch(Nick, sMessage, sSource, m_pNetwork)) {
if (m_pNetwork->IsUserAttached()) {
m_pNetwork->PutUser(":" + WatchEntry.GetTarget() + "!watch@znc.in PRIVMSG " +
m_pNetwork->GetCurNick() + " :" + sMessage);
m_pNetwork->PutUser(":" + WatchEntry.GetTarget() + "!watch@znc.in PRIVMSG " + m_pNetwork->GetCurNick() + " :" + sMessage);
} else {
m_Buffer.AddLine(":" + WatchEntry.GetTarget() + "!watch@znc.in PRIVMSG ",
" :" + m_pUser->AddTimestamp(sMessage));
m_Buffer.AddLine(":" + _NAMEDFMT(WatchEntry.GetTarget()) + "!watch@znc.in PRIVMSG {target} :" + _NAMEDFMT(m_pUser->AddTimestamp(sMessage)));
}
}
}