Make all the modules support networks

This commit is contained in:
Kyle Fuller
2011-08-24 14:01:34 +01:00
parent ee7a2083c8
commit 0b1627c529
33 changed files with 199 additions and 183 deletions

View File

@@ -8,6 +8,7 @@
#include "Chan.h"
#include "User.h"
#include "IRCNetwork.h"
#include <list>
using std::list;
@@ -167,7 +168,7 @@ public:
virtual void OnClientLogin() {
CString sBufLine;
while (m_Buffer.GetNextLine(m_pUser->GetCurNick(), sBufLine)) {
while (m_Buffer.GetNextLine(m_pNetwork->GetCurNick(), sBufLine)) {
PutUser(sBufLine);
}
@@ -287,9 +288,9 @@ private:
CWatchEntry& WatchEntry = *it;
if (WatchEntry.IsMatch(Nick, sMessage, sSource, m_pUser)) {
if (m_pUser->IsUserAttached()) {
m_pUser->PutUser(":" + WatchEntry.GetTarget() + "!watch@znc.in PRIVMSG " +
m_pUser->GetCurNick() + " :" + sMessage);
if (m_pNetwork->IsUserAttached()) {
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));
@@ -554,4 +555,4 @@ template<> void TModInfo<CWatcherMod>(CModInfo& Info) {
Info.SetWikiPage("watch");
}
MODULEDEFS(CWatcherMod, "Copy activity from a specific user into a separate window")
NETWORKMODULEDEFS(CWatcherMod, "Copy activity from a specific user into a separate window")