custom prefix

This commit is contained in:
pdxlocations
2025-01-12 17:34:07 -08:00
parent 5258cbbc21
commit d1e1b6320e
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -10,4 +10,5 @@ interface = None
display_log = False
db_file_path = "client.db"
message_prefix = ">>"
sent_message_prefix =">> Sent:"
notification_symbol = "*"
+1 -1
View File
@@ -49,7 +49,7 @@ def on_receive(packet):
message_from_string = ""
for node in globals.interface.nodes.values():
if message_from_id == node['num']:
message_from_string = node["user"]["longName"] # Get the long name using the node ID
message_from_string = node["user"]["shortName"] # Get the long name using the node ID
break
else:
message_from_string = str(decimal_to_hex(message_from_id)) # If long name not found, use the ID as string
+1 -1
View File
@@ -42,7 +42,7 @@ def update_messages_window():
wrapped_messages = textwrap.wrap(full_message, messages_win.getmaxyx()[1] - 2)
for wrapped_message in wrapped_messages:
messages_win.addstr(row, 1, wrapped_message, curses.color_pair(1) if prefix.startswith(">> Sent:") else curses.color_pair(2))
messages_win.addstr(row, 1, wrapped_message, curses.color_pair(1) if prefix.startswith(globals.sent_message_prefix) else curses.color_pair(2))
row += 1
messages_win.box()