Fixedi nvalid channel order

This commit is contained in:
WolverinDEV
2020-01-28 21:01:02 +01:00
parent 431e2c28f2
commit 619e560152
4 changed files with 10 additions and 6 deletions
+7 -3
View File
@@ -620,7 +620,10 @@ inline void send_channels(ConnectedClient* client, ChannelIT begin, const Channe
while(begin != end) {
auto channel = (*begin)->channel();
if(!channel) continue;
if(!channel) {
begin++;
continue;
}
for (const auto &elm : channel->properties().list_properties(property::FLAG_CHANNEL_VIEW, client->getType() == CLIENT_TEAMSPEAK ? property::FLAG_NEW : (uint16_t) 0)) {
if(elm.type() == property::CHANNEL_ORDER)
@@ -630,9 +633,10 @@ inline void send_channels(ConnectedClient* client, ChannelIT begin, const Channe
}
begin++;
if(++index > 6)
if(++index > 3)
break;
}
if(dynamic_cast<VoiceClient*>(client)) {
auto vc = dynamic_cast<VoiceClient*>(client);
vc->sendCommand0(builder.build(), false, true); /* we need to process this command directly so it will be processed before the channellistfinished stuff */
@@ -691,7 +695,7 @@ void ConnectedClient::sendChannelList(bool lock_channel_tree) {
if(entry_channels.empty())
logCritical(this->getServerId(), "ConnectedClient::sendChannelList => invalid (empty) own channel path!");
send_channels(this, entry_channels.begin(), entry_channels.end(), true);
send_channels(this, entry_channels.begin(), entry_channels.end(), false);
this->notifyClientEnterView(_this.lock(), nullptr, "", this->currentChannel, ViewReasonId::VREASON_SYSTEM, nullptr, false); //Notify self after path is send
send_channels(this, channels.begin(), channels.end(), false);
//this->notifyClientEnterView(_this.lock(), nullptr, "", this->currentChannel, ViewReasonId::VREASON_SYSTEM, nullptr, false); //Notify self after path is send