/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2018-2020 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2018 Attila Molnar <attilamolnar@hush.com>
*
* 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
{
public:
BatchMessage(const IRCv3::Batch::Batch& batch, bool start)
- : ClientProtocol::Message("BATCH", ServerInstance->Config->ServerName)
+ : ClientProtocol::Message("BATCH", ServerInstance->Config->GetServerName())
{
char c = (start ? '+' : '-');
PushParam(std::string(1, c) + batch.GetRefTagStr());
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)
{
}
};
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);
}
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());
}
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Provides the batch IRCv3 extension", VF_VENDOR);
+ return Version("Provides the IRCv3 batch client capability.", VF_VENDOR);
}
};