From 0a65619efb4e174dd976054a7ebed8ec3da64202 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Sun, 4 Jan 2026 17:20:41 -0600 Subject: [PATCH] feat(call): update telephony handling by adding remote telephony hash retrieval and updating frontend components to utilize new data --- meshchatx/meshchat.py | 35 +++++++++++++++++++ .../src/frontend/components/call/CallPage.vue | 15 ++++---- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/meshchatx/meshchat.py b/meshchatx/meshchat.py index ca347eb..aea0c07 100644 --- a/meshchatx/meshchat.py +++ b/meshchatx/meshchat.py @@ -3882,6 +3882,9 @@ class ReticulumMeshChat: remote_destination_hash = RNS.Destination.hash( remote_identity, "lxmf", "delivery" ).hex() + remote_telephony_hash = ( + self.get_lxst_telephony_hash_for_identity_hash(remote_hash) + ) remote_name = None if self.telephone_manager.get_name_for_identity_hash: remote_name = self.telephone_manager.get_name_for_identity_hash( @@ -3912,6 +3915,8 @@ class ReticulumMeshChat: "custom_image": custom_image, "is_incoming": telephone_active_call.is_incoming, "status": self.telephone_manager.telephone.call_status, + "remote_destination_hash": remote_destination_hash, + "remote_telephony_hash": remote_telephony_hash, "audio_profile_id": self.telephone_manager.telephone.transmit_codec.profile if hasattr( self.telephone_manager.telephone.transmit_codec, "profile" @@ -4078,11 +4083,16 @@ class ReticulumMeshChat: lxmf_hash = self.get_lxmf_destination_hash_for_identity_hash( remote_identity_hash, ) + tele_hash = self.get_lxst_telephony_hash_for_identity_hash( + remote_identity_hash + ) if lxmf_hash: d["remote_destination_hash"] = lxmf_hash icon = self.database.misc.get_user_icon(lxmf_hash) if icon: d["remote_icon"] = dict(icon) + if tele_hash: + d["remote_telephony_hash"] = tele_hash d["is_contact"] = bool( self.database.contacts.get_contact_by_identity_hash( remote_identity_hash, @@ -4249,11 +4259,16 @@ class ReticulumMeshChat: lxmf_hash = self.get_lxmf_destination_hash_for_identity_hash( remote_identity_hash, ) + tele_hash = self.get_lxst_telephony_hash_for_identity_hash( + remote_identity_hash + ) if lxmf_hash: d["remote_destination_hash"] = lxmf_hash icon = self.database.misc.get_user_icon(lxmf_hash) if icon: d["remote_icon"] = dict(icon) + if tele_hash: + d["remote_telephony_hash"] = tele_hash voicemails.append(d) return web.json_response( @@ -8672,6 +8687,26 @@ class ReticulumMeshChat: return announce["destination_hash"] return None + def get_lxst_telephony_hash_for_identity_hash(self, identity_hash: str): + # Primary: use announces table for lxst.telephony aspect + announces = self.database.announces.get_filtered_announces( + aspect="lxst.telephony", + search_term=identity_hash, + ) + if announces: + for announce in announces: + if announce["identity_hash"] == identity_hash: + return announce.get("destination_hash") + + # Fallback: derive from identity if available (same identity, different aspect) + identity = self.recall_identity(identity_hash) + if identity is not None: + try: + return RNS.Destination.hash(identity, "lxst", "telephony").hex() + except Exception: # noqa: S110 + return None + return None + def recall_identity(self, hash_hex: str) -> RNS.Identity | None: try: # 1. try reticulum recall (works for both identity and destination hashes) diff --git a/meshchatx/src/frontend/components/call/CallPage.vue b/meshchatx/src/frontend/components/call/CallPage.vue index 88cc70e..69c201e 100644 --- a/meshchatx/src/frontend/components/call/CallPage.vue +++ b/meshchatx/src/frontend/components/call/CallPage.vue @@ -661,10 +661,10 @@
- {{ formatDestinationHash(entry.remote_destination_hash || entry.remote_identity_hash) }} + {{ formatDestinationHash(entry.remote_telephony_hash || entry.remote_destination_hash || entry.remote_identity_hash) }}
@@ -1249,7 +1249,7 @@ type="button" class="text-[10px] flex items-center gap-1 text-gray-500 hover:text-blue-500 font-bold uppercase tracking-wider transition-colors" @click=" - destinationHash = voicemail.remote_destination_hash || voicemail.remote_identity_hash; + destinationHash = voicemail.remote_telephony_hash || voicemail.remote_destination_hash || voicemail.remote_identity_hash; activeTab = 'phone'; call(destinationHash); " @@ -2060,7 +2060,7 @@ export default { ) { suggestions.push({ name: c.name, - hash: c.remote_destination_hash || c.remote_identity_hash, + hash: c.remote_telephony_hash || c.remote_destination_hash || c.remote_identity_hash, type: "contact", icon: "account", }); @@ -2079,7 +2079,7 @@ export default { ) { suggestions.push({ name: h.remote_identity_name || h.remote_identity_hash.substring(0, 8), - hash: h.remote_destination_hash || h.remote_identity_hash, + hash: h.remote_telephony_hash || h.remote_destination_hash || h.remote_identity_hash, type: "history", icon: "history", }); @@ -2279,7 +2279,8 @@ export default { this.editingContact = null; this.contactForm = { name: entry.remote_identity_name || "", - remote_identity_hash: entry.remote_destination_hash || entry.remote_identity_hash, + remote_identity_hash: + entry.remote_telephony_hash || entry.remote_destination_hash || entry.remote_identity_hash, preferred_ringtone_id: null, }; this.isContactModalOpen = true;