mirror of
https://github.com/liberatedsystems/openCom-Companion.git
synced 2024-11-25 23:00:36 +01:00
Save and display stamp status on messages
This commit is contained in:
parent
7ec35db6c9
commit
c6f82a917d
@ -2606,6 +2606,14 @@ class SidebandCore():
|
|||||||
extras["snr"] = lxm.snr
|
extras["snr"] = lxm.snr
|
||||||
extras["q"] = lxm.q
|
extras["q"] = lxm.q
|
||||||
|
|
||||||
|
if lxm.stamp_checked:
|
||||||
|
extras["stamp_checked"] = True
|
||||||
|
extras["stamp_valid"] = lxm.stamp_valid
|
||||||
|
extras["stamp_value"] = lxm.stamp_value
|
||||||
|
|
||||||
|
if lxm.ratchet_id:
|
||||||
|
extras["ratchet_id"] = lxm.ratchet_id
|
||||||
|
|
||||||
if packed_telemetry != None:
|
if packed_telemetry != None:
|
||||||
extras["packed_telemetry"] = packed_telemetry
|
extras["packed_telemetry"] = packed_telemetry
|
||||||
|
|
||||||
@ -2671,7 +2679,7 @@ class SidebandCore():
|
|||||||
def lxmf_announce(self, attached_interface=None):
|
def lxmf_announce(self, attached_interface=None):
|
||||||
if self.is_standalone or self.is_service:
|
if self.is_standalone or self.is_service:
|
||||||
if self.config["lxmf_require_stamps"]:
|
if self.config["lxmf_require_stamps"]:
|
||||||
self.message_router.set_inbound_stamp_cost(self.lxmf_destination, self.config["lxmf_inbound_stamp_cost"])
|
self.message_router.set_inbound_stamp_cost(self.lxmf_destination.hash, self.config["lxmf_inbound_stamp_cost"])
|
||||||
self.message_router.announce(self.lxmf_destination.hash, attached_interface=attached_interface)
|
self.message_router.announce(self.lxmf_destination.hash, attached_interface=attached_interface)
|
||||||
else:
|
else:
|
||||||
self.lxmf_destination.announce(attached_interface=attached_interface)
|
self.lxmf_destination.announce(attached_interface=attached_interface)
|
||||||
|
@ -280,6 +280,8 @@ class Messages():
|
|||||||
has_attachment = False
|
has_attachment = False
|
||||||
force_markup = False
|
force_markup = False
|
||||||
signature_valid = False
|
signature_valid = False
|
||||||
|
stamp_valid = False
|
||||||
|
stamp_value = None
|
||||||
|
|
||||||
if "lxm" in m and m["lxm"] != None and m["lxm"].signature_validated:
|
if "lxm" in m and m["lxm"] != None and m["lxm"].signature_validated:
|
||||||
signature_valid = True
|
signature_valid = True
|
||||||
@ -290,6 +292,10 @@ class Messages():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if "extras" in m and m["extras"] != None and "stamp_checked" in m["extras"] and m["extras"]["stamp_checked"] == True:
|
||||||
|
stamp_valid = m["extras"]["stamp_valid"]
|
||||||
|
stamp_value = m["extras"]["stamp_value"]
|
||||||
|
|
||||||
if "lxm" in m and m["lxm"] != None and m["lxm"].fields != None and LXMF.FIELD_COMMANDS in m["lxm"].fields:
|
if "lxm" in m and m["lxm"] != None and m["lxm"].fields != None and LXMF.FIELD_COMMANDS in m["lxm"].fields:
|
||||||
try:
|
try:
|
||||||
commands = m["lxm"].fields[LXMF.FIELD_COMMANDS]
|
commands = m["lxm"].fields[LXMF.FIELD_COMMANDS]
|
||||||
@ -409,6 +415,8 @@ class Messages():
|
|||||||
heading_str = titlestr
|
heading_str = titlestr
|
||||||
if phy_stats_str != "" and self.app.sideband.config["advanced_stats"]:
|
if phy_stats_str != "" and self.app.sideband.config["advanced_stats"]:
|
||||||
heading_str += phy_stats_str+"\n"
|
heading_str += phy_stats_str+"\n"
|
||||||
|
if stamp_valid:
|
||||||
|
txstr += f" [b]Stamp[/b] value is {stamp_value} "
|
||||||
|
|
||||||
heading_str += "[b]Sent[/b] "+txstr
|
heading_str += "[b]Sent[/b] "+txstr
|
||||||
heading_str += "\n[b]Received[/b] "+rxstr
|
heading_str += "\n[b]Received[/b] "+rxstr
|
||||||
|
@ -821,6 +821,8 @@ class RVDetails(MDRecycleView):
|
|||||||
t_str = ", but have ticket"
|
t_str = ", but have ticket"
|
||||||
if stamp_cost:
|
if stamp_cost:
|
||||||
self.entries.append({"icon": "postage-stamp", "text": f"Required stamp cost [b]{stamp_cost}[/b]"+t_str, "on_release": pass_job})
|
self.entries.append({"icon": "postage-stamp", "text": f"Required stamp cost [b]{stamp_cost}[/b]"+t_str, "on_release": pass_job})
|
||||||
|
else:
|
||||||
|
self.entries.append({"icon": "postage-stamp", "text": f"No required stamp cost", "on_release": pass_job})
|
||||||
if ticket_expires:
|
if ticket_expires:
|
||||||
valid_for = ticket_expires - time.time()
|
valid_for = ticket_expires - time.time()
|
||||||
self.entries.append({"icon": "ticket-confirmation", "text": f"Delivery ticket valid for [b]{RNS.prettytime(valid_for)}[/b]", "on_release": pass_job})
|
self.entries.append({"icon": "ticket-confirmation", "text": f"Delivery ticket valid for [b]{RNS.prettytime(valid_for)}[/b]", "on_release": pass_job})
|
||||||
|
Loading…
Reference in New Issue
Block a user