Calling support
This commit is contained in:
parent
83574eb067
commit
d3a27a6442
72 changed files with 3864 additions and 191 deletions
|
@ -395,6 +395,22 @@
|
|||
|
||||
// These are view only and don't update the Conversation model, so they
|
||||
// need a manual update call.
|
||||
onOutgoingAudioCallInConversation: async () => {
|
||||
const conversation = this.model;
|
||||
const isVideoCall = false;
|
||||
await window.Signal.Services.calling.startOutgoingCall(
|
||||
conversation,
|
||||
isVideoCall
|
||||
);
|
||||
},
|
||||
onOutgoingVideoCallInConversation: async () => {
|
||||
const conversation = this.model;
|
||||
const isVideoCall = true;
|
||||
await window.Signal.Services.calling.startOutgoingCall(
|
||||
conversation,
|
||||
isVideoCall
|
||||
);
|
||||
},
|
||||
onShowSafetyNumber: () => {
|
||||
this.showSafetyNumber();
|
||||
},
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
this.startConnectionListener();
|
||||
} else {
|
||||
this.setupLeftPane();
|
||||
this.setupCallManagerUI();
|
||||
}
|
||||
|
||||
Whisper.events.on('pack-install-failed', () => {
|
||||
|
@ -106,6 +107,19 @@
|
|||
events: {
|
||||
click: 'onClick',
|
||||
},
|
||||
setupCallManagerUI() {
|
||||
if (!window.CALLING) {
|
||||
return;
|
||||
}
|
||||
if (this.callManagerView) {
|
||||
return;
|
||||
}
|
||||
this.callManagerView = new Whisper.ReactWrapperView({
|
||||
className: 'call-manager-wrapper',
|
||||
JSX: Signal.State.Roots.createCallManager(window.reduxStore),
|
||||
});
|
||||
this.$('.call-manager-placeholder').append(this.callManagerView.el);
|
||||
},
|
||||
setupLeftPane() {
|
||||
if (this.leftPaneView) {
|
||||
return;
|
||||
|
@ -144,6 +158,7 @@
|
|||
},
|
||||
onEmpty() {
|
||||
this.setupLeftPane();
|
||||
this.setupCallManagerUI();
|
||||
|
||||
const view = this.appLoadingScreen;
|
||||
if (view) {
|
||||
|
|
|
@ -50,6 +50,25 @@
|
|||
},
|
||||
});
|
||||
|
||||
const MediaCameraPermissionsSettingView = Whisper.View.extend({
|
||||
initialize(options) {
|
||||
this.value = options.value;
|
||||
this.setFn = options.setFn;
|
||||
this.populate();
|
||||
},
|
||||
events: {
|
||||
change: 'change',
|
||||
},
|
||||
change(e) {
|
||||
this.value = e.target.checked;
|
||||
this.setFn(this.value);
|
||||
window.log.info('media-camera-permissions changed to', this.value);
|
||||
},
|
||||
populate() {
|
||||
this.$('input').prop('checked', Boolean(this.value));
|
||||
},
|
||||
});
|
||||
|
||||
const RadioButtonGroupView = Whisper.View.extend({
|
||||
initialize(options) {
|
||||
this.name = options.name;
|
||||
|
@ -126,11 +145,40 @@
|
|||
setFn: window.setHideMenuBar,
|
||||
});
|
||||
}
|
||||
new CheckboxView({
|
||||
el: this.$('.always-relay-calls-setting'),
|
||||
name: 'always-relay-calls-setting',
|
||||
value: window.initialData.alwaysRelayCalls,
|
||||
setFn: window.setAlwaysRelayCalls,
|
||||
});
|
||||
new CheckboxView({
|
||||
el: this.$('.call-ringtone-notification-setting'),
|
||||
name: 'call-ringtone-notification-setting',
|
||||
value: window.initialData.callRingtoneNotification,
|
||||
setFn: window.setCallRingtoneNotification,
|
||||
});
|
||||
new CheckboxView({
|
||||
el: this.$('.call-system-notification-setting'),
|
||||
name: 'call-system-notification-setting',
|
||||
value: window.initialData.callSystemNotification,
|
||||
setFn: window.setCallSystemNotification,
|
||||
});
|
||||
new CheckboxView({
|
||||
el: this.$('.incoming-call-notification-setting'),
|
||||
name: 'incoming-call-notification-setting',
|
||||
value: window.initialData.incomingCallNotification,
|
||||
setFn: window.setIncomingCallNotification,
|
||||
});
|
||||
new MediaPermissionsSettingView({
|
||||
el: this.$('.media-permissions'),
|
||||
value: window.initialData.mediaPermissions,
|
||||
setFn: window.setMediaPermissions,
|
||||
});
|
||||
new MediaCameraPermissionsSettingView({
|
||||
el: this.$('.media-camera-permissions'),
|
||||
value: window.initialData.mediaCameraPermissions,
|
||||
setFn: window.setMediaCameraPermissions,
|
||||
});
|
||||
if (!window.initialData.isPrimary) {
|
||||
const syncView = new SyncView().render();
|
||||
this.$('.sync-setting').append(syncView.el);
|
||||
|
@ -167,8 +215,23 @@
|
|||
clearDataHeader: i18n('clearDataHeader'),
|
||||
clearDataButton: i18n('clearDataButton'),
|
||||
clearDataExplanation: i18n('clearDataExplanation'),
|
||||
calling: i18n('calling'),
|
||||
alwaysRelayCallsDescription: i18n('alwaysRelayCallsDescription'),
|
||||
alwaysRelayCallsDetail: i18n('alwaysRelayCallsDetail'),
|
||||
callRingtoneNotificationDescription: i18n(
|
||||
'callRingtoneNotificationDescription'
|
||||
),
|
||||
callSystemNotificationDescription: i18n(
|
||||
'callSystemNotificationDescription'
|
||||
),
|
||||
incomingCallNotificationDescription: i18n(
|
||||
'incomingCallNotificationDescription'
|
||||
),
|
||||
permissions: i18n('permissions'),
|
||||
mediaPermissionsDescription: i18n('mediaPermissionsDescription'),
|
||||
mediaCameraPermissionsDescription: i18n(
|
||||
'mediaCameraPermissionsDescription'
|
||||
),
|
||||
generalHeader: i18n('general'),
|
||||
spellCheckDescription: i18n('spellCheckDescription'),
|
||||
spellCheckHidden: spellCheckDirty ? 'false' : 'true',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue