Merged with master
This commit is contained in:
@@ -620,7 +620,12 @@ inline void send_channels(ConnectedClient* client, ChannelIT begin, const Channe
|
||||
if(++index > 6)
|
||||
break;
|
||||
}
|
||||
client->sendCommand(channellist);
|
||||
if(dynamic_cast<VoiceClient*>(client)) {
|
||||
auto vc = dynamic_cast<VoiceClient*>(client);
|
||||
vc->sendCommand0(channellist, false, true); /* we need to process this command directly so it will be processed before the channellistfinished stuff */
|
||||
} else {
|
||||
client->sendCommand(channellist);
|
||||
}
|
||||
if(begin != end)
|
||||
send_channels(client, begin, end, override_orderid);
|
||||
}
|
||||
@@ -761,7 +766,11 @@ void ConnectedClient::sendServerInit() {
|
||||
command["pv"] = 6; //Protocol version
|
||||
command["acn"] = this->getDisplayName();
|
||||
command["aclid"] = this->getClientId();
|
||||
this->sendCommand(command);
|
||||
if(dynamic_cast<VoiceClient*>(this)) {
|
||||
dynamic_cast<VoiceClient*>(this)->sendCommand0(command, false, true); /* process it directly so the order for the channellist entries is ensured. (First serverinit then everything else) */
|
||||
} else {
|
||||
this->sendCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
bool ConnectedClient::handleCommandFull(Command& cmd, bool disconnectOnFail) {
|
||||
@@ -948,6 +957,13 @@ permission::v2::PermissionFlaggedValue ConnectedClient::calculate_permission_val
|
||||
return {index->second, index->second != permNotGranted};
|
||||
}
|
||||
|
||||
auto ref_server = this->server;
|
||||
if(ref_server) {
|
||||
auto result = this->server->calculatePermissions2(this->getClientDatabaseId(), {permission}, this->getType(), channel_id, false);
|
||||
if(!result.empty()) /* it should never be empty! */
|
||||
return result.back().second;
|
||||
}
|
||||
|
||||
auto value = this->permissionValue(permission::PERMTEST_ORDERED, permission, nullptr);
|
||||
return {value, value != permNotGranted};
|
||||
}
|
||||
Reference in New Issue
Block a user