diff --git a/meshchatx/src/frontend/components/App.vue b/meshchatx/src/frontend/components/App.vue index 0a3c37a..898ebfa 100644 --- a/meshchatx/src/frontend/components/App.vue +++ b/meshchatx/src/frontend/components/App.vue @@ -287,15 +287,21 @@ class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-800 dark:border-zinc-600 dark:text-zinc-200 dark:focus:ring-blue-400 dark:focus:border-blue-400" /> -
+
{{ $t("app.identity_hash") }}
-
+
{{ config.identity_hash }}
-
+
{{ $t("app.lxmf_address") }}
-
+
{{ config.lxmf_address_hash }}
@@ -365,7 +371,13 @@
- + @@ -429,7 +441,6 @@ export default { isShowingMyIdentitySection: true, isShowingAnnounceSection: true, - isShowingCallsSection: true, isSidebarOpen: false, @@ -439,10 +450,10 @@ export default { config: null, appInfo: null, - isTelephoneCallActive: false, activeCall: null, propagationNodeStatus: null, isCallEnded: false, + wasDeclined: false, lastCall: null, endedTimeout: null, ringtonePlayer: null, @@ -765,7 +776,6 @@ export default { // update ui this.activeCall = response.data.active_call; - this.isTelephoneCallActive = this.activeCall != null; // Stop ringtone if not ringing anymore if (this.activeCall?.status !== 4) { @@ -775,16 +785,23 @@ export default { // If call just ended, show ended state for a few seconds if (oldCall != null && this.activeCall == null) { this.lastCall = oldCall; - this.isCallEnded = true; + + if (this.wasDeclined) { + // Already set by hangupCall + } else { + this.isCallEnded = true; + } if (this.endedTimeout) clearTimeout(this.endedTimeout); this.endedTimeout = setTimeout(() => { this.isCallEnded = false; + this.wasDeclined = false; this.lastCall = null; }, 5000); } else if (this.activeCall != null) { // if a new call starts, clear ended state this.isCallEnded = false; + this.wasDeclined = false; this.lastCall = null; if (this.endedTimeout) clearTimeout(this.endedTimeout); } @@ -792,20 +809,9 @@ export default { // do nothing on error } }, - async hangupTelephoneCall() { - // confirm user wants to hang up call - if (!(await DialogUtils.confirm("Are you sure you want to hang up the current telephone call?"))) { - return; - } - - try { - // hangup call - await axios.get(`/api/v1/telephone/hangup`); - - // reload status - await this.updateTelephoneStatus(); - } catch { - // ignore error hanging up call + onOverlayHangup() { + if (this.activeCall && this.activeCall.is_incoming && this.activeCall.status === 4) { + this.wasDeclined = true; } }, onAppNameClick() { diff --git a/meshchatx/src/frontend/components/call/CallOverlay.vue b/meshchatx/src/frontend/components/call/CallOverlay.vue index 3f5107b..3bb3312 100644 --- a/meshchatx/src/frontend/components/call/CallOverlay.vue +++ b/meshchatx/src/frontend/components/call/CallOverlay.vue @@ -7,16 +7,21 @@
-
+
{{ - isEnded - ? "Call Ended" - : activeCall.is_voicemail - ? "Recording Voicemail" - : activeCall.status === 6 - ? "Active Call" - : "Call Status" + wasDeclined + ? $t("call.call_declined") + : isEnded + ? $t("call.call_ended") + : activeCall.is_voicemail + ? $t("call.recording_voicemail") + : activeCall.status === 6 + ? $t("call.active_call") + : $t("call.call_status") }}
@@ -38,19 +43,33 @@
+
-
+
- {{ activeCall.remote_identity_name || "Unknown" }} + {{ activeCall.remote_identity_name || $t("call.unknown") }}
-
+
{{ activeCall.remote_identity_hash ? formatDestinationHash(activeCall.remote_identity_hash) @@ -65,23 +84,26 @@
- Call Ended - Incoming Call... - Busy - Rejected - Calling... - Available - Ringing... - Connecting... - Connected - Status: {{ activeCall.status }} + {{ $t("call.call_declined") }} + {{ $t("call.call_ended") }} + {{ + $t("call.incoming_call") + }} + {{ $t("call.busy") }} + {{ $t("call.rejected") }} + {{ $t("call.calling") }} + {{ $t("call.available") }} + {{ $t("call.ringing") }} + {{ $t("call.connecting") }} + {{ $t("call.connected") }} + {{ $t("call.status") }}: {{ activeCall.status }}
@@ -135,18 +157,33 @@ + + +