diff options
| author | 2019-07-16 15:11:21 +0100 | |
|---|---|---|
| committer | 2019-07-16 16:48:18 +0100 | |
| commit | cd8b456f979733525941284639d8bf899173b429 (patch) | |
| tree | f1d26962e61c74c5acb076662a909beafbe8e5fd /src/modules/m_ircv3_batch.cpp | |
| parent | Replace socketengine_{pthread,win32} with C++11 threads. (diff) | |
| parent | ssl_gnutls: remove PackageInfo directives for EOL Debian versions. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_ircv3_batch.cpp')
| -rw-r--r-- | src/modules/m_ircv3_batch.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/m_ircv3_batch.cpp b/src/modules/m_ircv3_batch.cpp index 02b8aea85..081cabaeb 100644 --- a/src/modules/m_ircv3_batch.cpp +++ b/src/modules/m_ircv3_batch.cpp @@ -44,10 +44,14 @@ struct IRCv3::Batch::BatchInfo std::vector<LocalUser*> users; BatchMessage startmsg; ClientProtocol::Event startevent; + BatchMessage endmsg; + ClientProtocol::Event endevent; BatchInfo(ClientProtocol::EventProvider& protoevprov, IRCv3::Batch::Batch& b) : startmsg(b, true) , startevent(protoevprov, startmsg) + , endmsg(b, false) + , endevent(protoevprov, endmsg) { } }; @@ -151,6 +155,7 @@ class IRCv3::Batch::ManagerImpl : public Manager batch.manager = this; batch.batchinfo = new IRCv3::Batch::BatchInfo(protoevprov, batch); batch.batchstartmsg = &batch.batchinfo->startmsg; + batch.batchendmsg = &batch.batchinfo->endmsg; active_batches.push_back(&batch); } @@ -164,12 +169,10 @@ class IRCv3::Batch::ManagerImpl : public Manager BatchInfo& batchinfo = *batch.batchinfo; // Send end batch message to all users who got the batch start message and unset bit so it can be reused - BatchMessage endbatchmsg(batch, false); - ClientProtocol::Event endbatchevent(protoevprov, endbatchmsg); for (std::vector<LocalUser*>::const_iterator i = batchinfo.users.begin(); i != batchinfo.users.end(); ++i) { LocalUser* const user = *i; - user->Send(endbatchevent); + user->Send(batchinfo.endevent); batchbits.set(user, batchbits.get(user) & ~batch.GetBit()); } |
