feat(call): update telephony handling by adding remote telephony hash retrieval and updating frontend components to utilize new data
Some checks failed
CI / test-backend (push) Successful in 3s
CI / build-frontend (push) Successful in 2m12s
CI / test-lang (push) Successful in 2m13s
CI / test-backend (pull_request) Successful in 33s
Build and Publish Docker Image / build (pull_request) Has been skipped
CI / test-lang (pull_request) Successful in 1m3s
OSV-Scanner PR Scan / scan-pr (pull_request) Successful in 25s
CI / lint (push) Failing after 5m5s
CI / lint (pull_request) Failing after 5m4s
CI / build-frontend (pull_request) Successful in 9m43s
Build Test / Build and Test (pull_request) Successful in 13m39s
Benchmarks / benchmark (push) Successful in 15m19s
Benchmarks / benchmark (pull_request) Successful in 15m21s
Build and Publish Docker Image / build-dev (pull_request) Successful in 14m0s
Tests / test (push) Failing after 23m27s
Tests / test (pull_request) Failing after 20m38s
Build Test / Build and Test (push) Successful in 43m20s
Some checks failed
CI / test-backend (push) Successful in 3s
CI / build-frontend (push) Successful in 2m12s
CI / test-lang (push) Successful in 2m13s
CI / test-backend (pull_request) Successful in 33s
Build and Publish Docker Image / build (pull_request) Has been skipped
CI / test-lang (pull_request) Successful in 1m3s
OSV-Scanner PR Scan / scan-pr (pull_request) Successful in 25s
CI / lint (push) Failing after 5m5s
CI / lint (pull_request) Failing after 5m4s
CI / build-frontend (pull_request) Successful in 9m43s
Build Test / Build and Test (pull_request) Successful in 13m39s
Benchmarks / benchmark (push) Successful in 15m19s
Benchmarks / benchmark (pull_request) Successful in 15m21s
Build and Publish Docker Image / build-dev (pull_request) Successful in 14m0s
Tests / test (push) Failing after 23m27s
Tests / test (pull_request) Failing after 20m38s
Build Test / Build and Test (push) Successful in 43m20s
This commit is contained in:
@@ -3882,6 +3882,9 @@ class ReticulumMeshChat:
|
|||||||
remote_destination_hash = RNS.Destination.hash(
|
remote_destination_hash = RNS.Destination.hash(
|
||||||
remote_identity, "lxmf", "delivery"
|
remote_identity, "lxmf", "delivery"
|
||||||
).hex()
|
).hex()
|
||||||
|
remote_telephony_hash = (
|
||||||
|
self.get_lxst_telephony_hash_for_identity_hash(remote_hash)
|
||||||
|
)
|
||||||
remote_name = None
|
remote_name = None
|
||||||
if self.telephone_manager.get_name_for_identity_hash:
|
if self.telephone_manager.get_name_for_identity_hash:
|
||||||
remote_name = 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,
|
"custom_image": custom_image,
|
||||||
"is_incoming": telephone_active_call.is_incoming,
|
"is_incoming": telephone_active_call.is_incoming,
|
||||||
"status": self.telephone_manager.telephone.call_status,
|
"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
|
"audio_profile_id": self.telephone_manager.telephone.transmit_codec.profile
|
||||||
if hasattr(
|
if hasattr(
|
||||||
self.telephone_manager.telephone.transmit_codec, "profile"
|
self.telephone_manager.telephone.transmit_codec, "profile"
|
||||||
@@ -4078,11 +4083,16 @@ class ReticulumMeshChat:
|
|||||||
lxmf_hash = self.get_lxmf_destination_hash_for_identity_hash(
|
lxmf_hash = self.get_lxmf_destination_hash_for_identity_hash(
|
||||||
remote_identity_hash,
|
remote_identity_hash,
|
||||||
)
|
)
|
||||||
|
tele_hash = self.get_lxst_telephony_hash_for_identity_hash(
|
||||||
|
remote_identity_hash
|
||||||
|
)
|
||||||
if lxmf_hash:
|
if lxmf_hash:
|
||||||
d["remote_destination_hash"] = lxmf_hash
|
d["remote_destination_hash"] = lxmf_hash
|
||||||
icon = self.database.misc.get_user_icon(lxmf_hash)
|
icon = self.database.misc.get_user_icon(lxmf_hash)
|
||||||
if icon:
|
if icon:
|
||||||
d["remote_icon"] = dict(icon)
|
d["remote_icon"] = dict(icon)
|
||||||
|
if tele_hash:
|
||||||
|
d["remote_telephony_hash"] = tele_hash
|
||||||
d["is_contact"] = bool(
|
d["is_contact"] = bool(
|
||||||
self.database.contacts.get_contact_by_identity_hash(
|
self.database.contacts.get_contact_by_identity_hash(
|
||||||
remote_identity_hash,
|
remote_identity_hash,
|
||||||
@@ -4249,11 +4259,16 @@ class ReticulumMeshChat:
|
|||||||
lxmf_hash = self.get_lxmf_destination_hash_for_identity_hash(
|
lxmf_hash = self.get_lxmf_destination_hash_for_identity_hash(
|
||||||
remote_identity_hash,
|
remote_identity_hash,
|
||||||
)
|
)
|
||||||
|
tele_hash = self.get_lxst_telephony_hash_for_identity_hash(
|
||||||
|
remote_identity_hash
|
||||||
|
)
|
||||||
if lxmf_hash:
|
if lxmf_hash:
|
||||||
d["remote_destination_hash"] = lxmf_hash
|
d["remote_destination_hash"] = lxmf_hash
|
||||||
icon = self.database.misc.get_user_icon(lxmf_hash)
|
icon = self.database.misc.get_user_icon(lxmf_hash)
|
||||||
if icon:
|
if icon:
|
||||||
d["remote_icon"] = dict(icon)
|
d["remote_icon"] = dict(icon)
|
||||||
|
if tele_hash:
|
||||||
|
d["remote_telephony_hash"] = tele_hash
|
||||||
voicemails.append(d)
|
voicemails.append(d)
|
||||||
|
|
||||||
return web.json_response(
|
return web.json_response(
|
||||||
@@ -8672,6 +8687,26 @@ class ReticulumMeshChat:
|
|||||||
return announce["destination_hash"]
|
return announce["destination_hash"]
|
||||||
return None
|
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:
|
def recall_identity(self, hash_hex: str) -> RNS.Identity | None:
|
||||||
try:
|
try:
|
||||||
# 1. try reticulum recall (works for both identity and destination hashes)
|
# 1. try reticulum recall (works for both identity and destination hashes)
|
||||||
|
|||||||
@@ -661,10 +661,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="text-[10px] font-mono text-gray-400 dark:text-zinc-600 truncate mt-0.5 cursor-pointer hover:text-blue-500 transition-colors"
|
class="text-[10px] font-mono text-gray-400 dark:text-zinc-600 truncate mt-0.5 cursor-pointer hover:text-blue-500 transition-colors"
|
||||||
:title="entry.remote_destination_hash || entry.remote_identity_hash"
|
:title="entry.remote_telephony_hash || entry.remote_destination_hash || entry.remote_identity_hash"
|
||||||
@click.stop="copyHash(entry.remote_destination_hash || entry.remote_identity_hash)"
|
@click.stop="copyHash(entry.remote_telephony_hash || entry.remote_destination_hash || entry.remote_identity_hash)"
|
||||||
>
|
>
|
||||||
{{ formatDestinationHash(entry.remote_destination_hash || entry.remote_identity_hash) }}
|
{{ formatDestinationHash(entry.remote_telephony_hash || entry.remote_destination_hash || entry.remote_identity_hash) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1249,7 +1249,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
class="text-[10px] flex items-center gap-1 text-gray-500 hover:text-blue-500 font-bold uppercase tracking-wider transition-colors"
|
class="text-[10px] flex items-center gap-1 text-gray-500 hover:text-blue-500 font-bold uppercase tracking-wider transition-colors"
|
||||||
@click="
|
@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';
|
activeTab = 'phone';
|
||||||
call(destinationHash);
|
call(destinationHash);
|
||||||
"
|
"
|
||||||
@@ -2060,7 +2060,7 @@ export default {
|
|||||||
) {
|
) {
|
||||||
suggestions.push({
|
suggestions.push({
|
||||||
name: c.name,
|
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",
|
type: "contact",
|
||||||
icon: "account",
|
icon: "account",
|
||||||
});
|
});
|
||||||
@@ -2079,7 +2079,7 @@ export default {
|
|||||||
) {
|
) {
|
||||||
suggestions.push({
|
suggestions.push({
|
||||||
name: h.remote_identity_name || h.remote_identity_hash.substring(0, 8),
|
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",
|
type: "history",
|
||||||
icon: "history",
|
icon: "history",
|
||||||
});
|
});
|
||||||
@@ -2279,7 +2279,8 @@ export default {
|
|||||||
this.editingContact = null;
|
this.editingContact = null;
|
||||||
this.contactForm = {
|
this.contactForm = {
|
||||||
name: entry.remote_identity_name || "",
|
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,
|
preferred_ringtone_id: null,
|
||||||
};
|
};
|
||||||
this.isContactModalOpen = true;
|
this.isContactModalOpen = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user