Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge commit 'refs/pull/188/head' of github.com:znc/znc

Conflicts:
	modules/watch.cpp
  • Loading branch information...
commit 89f586d17362cc7293d691b61ca52bc70543e59b 2 parents a212f08 + 84fae4c
@DarthGandalf DarthGandalf authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 modules/watch.cpp
View
8 modules/watch.cpp
@@ -10,9 +10,11 @@
#include <znc/User.h>
#include <znc/IRCNetwork.h>
#include <list>
+#include <set>
using std::list;
using std::vector;
+using std::set;
class CWatchSource {
public:
@@ -287,15 +289,19 @@ class CWatcherMod : public CModule {
private:
void Process(const CNick& Nick, const CString& sMessage, const CString& sSource) {
+ set<CString> sHandledTargets;
+
for (list<CWatchEntry>::iterator it = m_lsWatchers.begin(); it != m_lsWatchers.end(); ++it) {
CWatchEntry& WatchEntry = *it;
- if (WatchEntry.IsMatch(Nick, sMessage, sSource, m_pNetwork)) {
+ if (WatchEntry.IsMatch(Nick, sMessage, sSource, m_pNetwork) &&
+ sHandledTargets.count(WatchEntry.GetTarget()) < 1) {
if (m_pNetwork->IsUserAttached()) {
m_pNetwork->PutUser(":" + WatchEntry.GetTarget() + "!watch@znc.in PRIVMSG " + m_pNetwork->GetCurNick() + " :" + sMessage);
} else {
m_Buffer.AddLine(":" + _NAMEDFMT(WatchEntry.GetTarget()) + "!watch@znc.in PRIVMSG {target} :{text}", sMessage);
}
+ sHandledTargets.insert(WatchEntry.GetTarget());
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.