Fixed the audio mute states

canary
WolverinDEV 2020-09-16 20:37:39 +02:00
parent 6f56150e0b
commit 8e5966c04c
2 changed files with 16 additions and 7 deletions

View File

@ -715,7 +715,9 @@ export class ConnectionHandler {
if(this.serverConnection.connected()) {
let localClientUpdates: {
client_output_hardware?: boolean,
client_input_hardware?: boolean
client_input_hardware?: boolean,
client_input_muted?: boolean,
client_output_muted?: boolean
} = {};
const currentChannel = this.getClient().currentChannel();
@ -751,6 +753,12 @@ export class ConnectionHandler {
shouldRecord = codecSupportEncode && !!voiceConnection.voiceRecorder()?.input;
}
localClientUpdates.client_output_muted = this.client_status.output_muted;
localClientUpdates.client_input_muted = this.client_status.input_muted;
if(localClientUpdates.client_input_muted || localClientUpdates.client_output_muted) {
shouldRecord = false;
}
/* update our owns client properties */
{
const currentClientProperties = this.getClient().properties;

View File

@ -47,6 +47,7 @@ import "./update/UpdaterWeb";
import ContextMenuEvent = JQuery.ContextMenuEvent;
import {defaultConnectProfile, findConnectProfile} from "tc-shared/profiles/ConnectionProfile";
let preventWelcomeUI = false;
async function initialize() {
try {
await i18n.initialize();
@ -126,8 +127,8 @@ export function handle_connect_request(properties: ConnectRequestData, connectio
const password = properties.password ? properties.password.value : "";
const password_hashed = properties.password ? properties.password.hashed : false;
debugger;
if(profile && profile.valid()) {
settings.changeGlobal(Settings.KEY_USER_IS_NEW, false);
connection.startConnection(properties.address, profile, true, {
nickname: username,
password: password.length > 0 ? {
@ -302,11 +303,9 @@ function main() {
//setTimeout(() => spawnPermissionEditorModal(server_connections.active_connection()), 3000);
//setTimeout(() => spawnGroupCreate(server_connections.active_connection(), "server"), 3000);
if(server_connections.active_connection().getServerConnection().getConnectionState() === ConnectionState.UNCONNECTED) {
if(settings.static_global(Settings.KEY_USER_IS_NEW)) {
const modal = openModalNewcomer();
modal.close_listener.push(() => settings.changeGlobal(Settings.KEY_USER_IS_NEW, false));
}
if(settings.static_global(Settings.KEY_USER_IS_NEW) && !preventWelcomeUI) {
const modal = openModalNewcomer();
modal.close_listener.push(() => settings.changeGlobal(Settings.KEY_USER_IS_NEW, false));
}
//spawnVideoPopout(server_connections.active_connection(), "https://www.youtube.com/watch?v=9683D18fyvs");
@ -381,6 +380,7 @@ const task_connect_handler: loader.Task = {
}
}
preventWelcomeUI = true;
loader.register_task(loader.Stage.LOADED, {
priority: 0,
function: async () => handle_connect_request(connect_data, server_connections.active_connection() || server_connections.spawn_server_connection()),
@ -394,6 +394,7 @@ const task_connect_handler: loader.Task = {
};
chandler.callback_execute = data => {
preventWelcomeUI = true;
handle_connect_request(data, server_connections.spawn_server_connection());
return true;
}