mirror of
https://github.com/pdxlocations/contact.git
synced 2026-08-06 08:53:29 +02:00
custom prefix
This commit is contained in:
@@ -10,4 +10,5 @@ interface = None
|
||||
display_log = False
|
||||
db_file_path = "client.db"
|
||||
message_prefix = ">>"
|
||||
sent_message_prefix =">> Sent:"
|
||||
notification_symbol = "*"
|
||||
@@ -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
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user