X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ircv3_batch.cpp;h=bbb78557dfdc1c90104e352b67526c93bead12e1;hb=3151d60c1ecc9462e4c335282ee6c31672f45111;hp=df2b00f49fc0c0a16b8ba48141a3cdc56616dfa7;hpb=77730fd5f09f8fc193205654c8bba84d34365670;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ircv3_batch.cpp b/src/modules/m_ircv3_batch.cpp index df2b00f49..bbb78557d 100644 --- a/src/modules/m_ircv3_batch.cpp +++ b/src/modules/m_ircv3_batch.cpp @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2016 Attila Molnar + * Copyright (C) 2018-2019 Sadie Powell + * Copyright (C) 2018 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -44,10 +45,14 @@ struct IRCv3::Batch::BatchInfo std::vector 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 +156,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 +170,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::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()); } @@ -209,7 +213,7 @@ class ModuleIRCv3Batch : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides the batch IRCv3 extension", VF_VENDOR); + return Version("Provides the IRCv3 batch client capability.", VF_VENDOR); } };