mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 12:45:11 +08:00
Clean up asserted identity code (#7934)
* Clean up asserted identity code Add logging when we received asserted identity events but ignore them, and just disable the whole code path if it's not enabled in the config. * Actually, put the check back - better to check anyway * Update to ? syntax Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Put back lost return Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
e6ea58e84d
commit
2d58704d26
@ -152,9 +152,9 @@ export default class CallHandler extends EventEmitter {
|
||||
public roomIdForCall(call: MatrixCall): string {
|
||||
if (!call) return null;
|
||||
|
||||
const voipConfig = SdkConfig.get()['voip'];
|
||||
|
||||
if (voipConfig && voipConfig.obeyAssertedIdentity) {
|
||||
// check asserted identity: if we're not obeying asserted identity,
|
||||
// this map will never be populated, but we check anyway for sanity
|
||||
if (this.shouldObeyAssertedfIdentity()) {
|
||||
const nativeUser = this.assertedIdentityNativeUsers[call.callId];
|
||||
if (nativeUser) {
|
||||
const room = findDMForUser(MatrixClientPeg.get(), nativeUser);
|
||||
@ -262,6 +262,10 @@ export default class CallHandler extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
private shouldObeyAssertedfIdentity(): boolean {
|
||||
return SdkConfig.get()['voip']?.obeyAssertedIdentity;
|
||||
}
|
||||
|
||||
public getSupportsPstnProtocol(): boolean {
|
||||
return this.supportsPstnProtocol;
|
||||
}
|
||||
@ -489,6 +493,11 @@ export default class CallHandler extends EventEmitter {
|
||||
|
||||
logger.log(`Call ID ${call.callId} got new asserted identity:`, call.getRemoteAssertedIdentity());
|
||||
|
||||
if (!this.shouldObeyAssertedfIdentity()) {
|
||||
logger.log("asserted identity not enabled in config: ignoring");
|
||||
return;
|
||||
}
|
||||
|
||||
const newAssertedIdentity = call.getRemoteAssertedIdentity().id;
|
||||
let newNativeAssertedIdentity = newAssertedIdentity;
|
||||
if (newAssertedIdentity) {
|
||||
|
Loading…
Reference in New Issue
Block a user