diff --git a/contact/message_handlers/rx_handler.py b/contact/message_handlers/rx_handler.py index c979b9a..5ca01b2 100644 --- a/contact/message_handlers/rx_handler.py +++ b/contact/message_handlers/rx_handler.py @@ -101,6 +101,11 @@ def on_receive(packet: Dict[str, Any], interface: Any) -> None: maybe_store_nodeinfo_in_db(packet) elif packet["decoded"]["portnum"] == "TEXT_MESSAGE_APP": + hop_start = packet.get('hopStart', 0) + hop_limit = packet.get('hopLimit', 0) + + hops = hop_start - hop_limit + if config.notification_sound == "True": play_sound() @@ -140,7 +145,7 @@ def on_receive(packet: Dict[str, Any], interface: Any) -> None: message_from_id = packet["from"] message_from_string = get_name_from_database(message_from_id, type="short") + ":" - add_new_message(channel_id, f"{config.message_prefix} {message_from_string} ", message_string) + add_new_message(channel_id, f"{config.message_prefix} [{hops}] {message_from_string} ", message_string) if refresh_channels: draw_channel_list() diff --git a/contact/message_handlers/tx_handler.py b/contact/message_handlers/tx_handler.py index 6dafe2f..c8e2656 100644 --- a/contact/message_handlers/tx_handler.py +++ b/contact/message_handlers/tx_handler.py @@ -1,3 +1,5 @@ +import time + from typing import Any, Dict import google.protobuf.json_format @@ -49,7 +51,7 @@ def onAckNak(packet: Dict[str, Any]) -> None: ack_type = "Nak" ui_state.all_messages[acknak["channel"]][acknak["messageIndex"]] = ( - config.sent_message_prefix + confirm_string + ": ", + time.strftime("[%H:%M:%S] ") + config.sent_message_prefix + confirm_string + ": ", message, )