Fixed URL connect parameters

canary
WolverinDEV 2018-12-03 18:56:36 +01:00
parent ab43c97e1b
commit 63a5974390
6 changed files with 27 additions and 37 deletions

View File

@ -1,4 +1,7 @@
# Changelog:
* **3.12.18**
- Fixed url connect parameters
* **2.12.18**
- Fixed `[spacerX]` detection
- Added a hint if the channel encryption has been overridden by the server settings

View File

@ -1061,7 +1061,8 @@ class ConnectionCommandHandler {
json = json[0];
const self = this.connection._client.getClient();
if(json["clid"] == self.clientId())
if(json["clid"] == self.clientId()) {
sound.play(Sound.GROUP_CHANNEL_CHANGED_SELF);
}
}
}

View File

@ -115,22 +115,31 @@ function main() {
if(settings.static("default_connect_url")) {
switch (settings.static("default_connect_type")) {
case "teaforo":
if(forumIdentity.valid())
if(forumIdentity && forumIdentity.valid())
globalClient.startConnection(settings.static("default_connect_url"), forumIdentity);
else
Modals.spawnConnectModal(settings.static("default_connect_url"), IdentitifyType.TEAFORO);
Modals.spawnConnectModal({
url: settings.static<string>("default_connect_url"),
enforce: true
}, { identity: IdentitifyType.TEAFORO, enforce: true});
break;
case "teamspeak":
let connectIdentity = TSIdentityHelper.loadIdentity(settings.global("connect_identity_teamspeak_identity", ""));
if(!connectIdentity || !connectIdentity.valid())
Modals.spawnConnectModal(settings.static("default_connect_url"), IdentitifyType.TEAMSPEAK);
Modals.spawnConnectModal({
url: settings.static<string>("default_connect_url"),
enforce: true
}, { identity: IdentitifyType.TEAMSPEAK, enforce: true});
else
globalClient.startConnection(settings.static("default_connect_url"), connectIdentity);
break;
default:
Modals.spawnConnectModal(settings.static("default_connect_url"));
Modals.spawnConnectModal({
url: settings.static<string>("default_connect_url"),
enforce: true
});
}
}

View File

@ -212,7 +212,10 @@ class ControlBar {
}
private onConnect() {
Modals.spawnConnectModal(settings.static("connect_default_host", "ts.TeaSpeak.de"));
Modals.spawnConnectModal({
url: "ts.TeaSpeak.de",
enforce: false
});
}
update_connection_state() {

View File

@ -1,7 +1,7 @@
/// <reference path="../../utils/modal.ts" />
namespace Modals {
export function spawnConnectModal(defaultHost: string = "ts.TeaSpeak.de", def_connect_type?: IdentitifyType) {
export function spawnConnectModal(defaultHost: { url: string, enforce: boolean} = { url: "ts.TeaSpeak.de", enforce: false}, def_connect_type?: { identity: IdentitifyType, enforce: boolean}) {
let connectIdentity: Identity;
const connectModal = createModal({
header: function() {
@ -56,7 +56,7 @@ namespace Modals {
};
tag.find(".connect_nickname").val(settings.static_global("connect_name", undefined));
tag.find(".connect_address").val(settings.static_global("connect_address", defaultHost));
tag.find(".connect_address").val(defaultHost.enforce ? defaultHost.url : settings.static_global("connect_address", defaultHost.url));
tag.find(".connect_address")
.on("keyup", () => updateFields())
.on('keydown', event => {
@ -71,7 +71,7 @@ namespace Modals {
tag.find(".identity_config:not(" + ".identity_config_" + this.value + ")").hide();
tag.find(".identity_config_" + this.value).show().trigger('shown');
});
tag.find(".identity_select").val(IdentitifyType[def_connect_type ? def_connect_type : settings.global("connect_identity_type", IdentitifyType.TEAFORO)]);
tag.find(".identity_select").val(IdentitifyType[def_connect_type && def_connect_type.enforce ? def_connect_type.identity : settings.global("connect_identity_type", (def_connect_type || { identity: undefined }).identity || IdentitifyType.TEAFORO)]);
setTimeout(() => tag.find(".identity_select").trigger('change'), 0); //For some reason could not be run instantly
{
@ -210,29 +210,4 @@ namespace Modals {
IP_V6: /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,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[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,
};
}
/*
<div style="display: flex; justify-content: space-between;">
<div style="text-align: right;">Identity Settings</div>
<select class="identity_select">
<option name="identity_type" value="identity_type_forum">Forum Account</option>
<option name="identity_type" value="identity_type_teamspeak">TeamSpeak</option>
</select>
</div>
<hr>
<div class="identity_config_teamspeak">
Please enter your exported TS3 Identity string bellow or select your exported Identity<br>
<div style="width: 100%; display: flex; flex-direction: row">
<input placeholder="Identity string" style="width: 70%; margin: 5px;" class="identity_string">
<div style="width: 30%; margin: 5px"><input name="identity_file" type="file"></div>
</div>
</div>
<div class="identity_config_forum">
You're using your forum account as verification
</div>
<div style="background-color: red; border-radius: 1px; display: none" class="error_message">
Identity isnt valid!
</div>
*/
}

View File

@ -1,2 +1 @@
- channel encrypted within status bar (ref for override via server: encrypted: false (overridden by server: true))
- arrow channel select move
nan