diff options
author | Walliski <walliski@gmail.com> | 2015-10-20 19:34:55 +0300 |
---|---|---|
committer | Walliski <walliski@gmail.com> | 2015-10-20 19:34:55 +0300 |
commit | 3040f6d514ae98b13e52250dae9ed86f27fc816d (patch) | |
tree | 184fe7a964e20ed0b9e11f3c549171a5992d7f68 | |
parent | b8d3588412a591230d1de5e81d77cbc62f98f528 (diff) |
Print messages to query window instead of different one
-rw-r--r-- | backlog.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/backlog.cpp b/backlog.cpp index 900cd6b..2c6426f 100644 --- a/backlog.cpp +++ b/backlog.cpp @@ -183,7 +183,13 @@ void CBacklogMod::OnModCommand(const CString& sCommand) { m_pNetwork->PutUser(":***!znc@znc.in PRIVMSG " + Channel + " :No log files found for window " + Channel + " in " + DirPath + "/", GetClient()); return; } else { - m_pNetwork->PutUser(":***!znc@znc.in PRIVMSG " + Channel + " :Backlog playback...", GetClient()); + //RFC prefixes: # ! & + + if (Channel.StartsWith("#") || Channel.StartsWith("&") || + Channel.StartsWith("!") || Channel.StartsWith("+")) { //Normal channel + m_pNetwork->PutUser(":***!znc@znc.in PRIVMSG " + Channel + " :Backlog playback...", GetClient()); + } else { + m_pNetwork->PutUser(":" + Channel + "!znc@znc.in PRIVMSG " + Channel + " :<***> Backlog playback...", GetClient()); + } } // now actually print @@ -212,13 +218,26 @@ void CBacklogMod::OnModCommand(const CString& sCommand) { MessageType = "NOTICE "; } - m_pNetwork->PutUser(":" + Nick + "!znc@znc.in " + MessageType + Channel + " :" + Line.substr(0, FirstWS) + Line.substr(FirstWS + NickLen + 1, Line.npos), GetClient()); + //RFC prefixes: # ! & + + if (Channel.StartsWith("#") || Channel.StartsWith("&") || + Channel.StartsWith("!") || Channel.StartsWith("+")) { //Normal channel + m_pNetwork->PutUser(":" + Nick + "!znc@znc.in " + MessageType + Channel + " :" + Line.substr(0, FirstWS) + Line.substr(FirstWS + NickLen + 1, Line.npos), GetClient()); + } else { //Privmsg + m_pNetwork->PutUser(":" + Channel + "!znc@znc.in " + MessageType + Channel + " :" + Line.substr(0, FirstWS) + " <" + Nick + ">" + Line.substr(FirstWS + NickLen + 1, Line.npos), GetClient()); + } + + } catch (int e) { PutModule("Malformed log line! " + Line); } } - m_pNetwork->PutUser(":***!znc@znc.in PRIVMSG " + Channel + " :" + "Playback Complete.", GetClient()); + if (Channel.StartsWith("#") || Channel.StartsWith("&") || + Channel.StartsWith("!") || Channel.StartsWith("+")) { //Normal channel + m_pNetwork->PutUser(":***!znc@znc.in PRIVMSG " + Channel + " :" + "Playback Complete.", GetClient()); + } else { + m_pNetwork->PutUser(":" + Channel + "!znc@znc.in PRIVMSG " + Channel + " :<***> " + "Playback Complete.", GetClient()); + } } template<> void TModInfo<CBacklogMod>(CModInfo& Info) { |