summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Eskola <fruitiex@gmail.com>2013-08-10 18:34:58 +0300
committerRasmus Eskola <fruitiex@gmail.com>2013-08-10 18:34:58 +0300
commitd6dc8d55c949c7b926d7f35ef68e82ced3dfd772 (patch)
treed2ca4c06be588cace9f2c4b698cce3390158500e
parent93052d022af8ddb189b56f24f2674905aa65a914 (diff)
parse nicknames from log file
-rw-r--r--backlog.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/backlog.cpp b/backlog.cpp
index 05bcb6f..0e6fecd 100644
--- a/backlog.cpp
+++ b/backlog.cpp
@@ -158,8 +158,12 @@ void CBacklogMod::OnModCommand(const CString& sCommand) {
// now actually print
for (std::vector<CString>::reverse_iterator it = LinesToPrint.rbegin(); it != LinesToPrint.rend(); ++it) {
if(isInChan) {
- CString Nick = "foo";
- m_pNetwork->PutUser(":" + Nick + "!znc@znc.in PRIVMSG " + Channel + " :" + *it, GetClient());
+ CString Line = *it;
+ size_t FirstSpace = Line.find_first_of(' ');
+ size_t Len = Line.find_first_of(' ', FirstSpace + 1) - FirstSpace;
+ CString Nick = Line.substr(FirstSpace + 2, Len - 3);
+
+ m_pNetwork->PutUser(":" + Nick + "!znc@znc.in PRIVMSG " + Channel + " :" + Line.substr(0, FirstSpace) + Line.substr(FirstSpace + Len, Line.npos), GetClient());
} else {
PutModule(*it);
}