forked from mudhorn/TC2-BBS-mesh
Change group_chat_id to use BROADCAST_NUM
This change is to use BROADCAST_NUM from the Meshtastic Python lib instead of broadcast address "4294967295" in the code
This commit is contained in:
parent
ced378bef3
commit
5935c4d270
|
@ -4,6 +4,8 @@ import threading
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
from meshtastic import BROADCAST_NUM
|
||||||
|
|
||||||
from utils import (
|
from utils import (
|
||||||
send_bulletin_to_bbs_nodes,
|
send_bulletin_to_bbs_nodes,
|
||||||
send_delete_bulletin_to_bbs_nodes,
|
send_delete_bulletin_to_bbs_nodes,
|
||||||
|
@ -78,9 +80,8 @@ def add_bulletin(board, sender_short_name, subject, content, bbs_nodes, interfac
|
||||||
|
|
||||||
# New logic to send group chat notification for urgent bulletins
|
# New logic to send group chat notification for urgent bulletins
|
||||||
if board.lower() == "urgent":
|
if board.lower() == "urgent":
|
||||||
group_chat_id = 4294967295 # Default group chat ID (0xFFFFFFFF)
|
|
||||||
notification_message = f"💥NEW URGENT BULLETIN💥\nFrom: {sender_short_name}\nTitle: {subject}"
|
notification_message = f"💥NEW URGENT BULLETIN💥\nFrom: {sender_short_name}\nTitle: {subject}"
|
||||||
send_message(notification_message, group_chat_id, interface)
|
send_message(notification_message, BROADCAST_NUM, interface)
|
||||||
|
|
||||||
return unique_id
|
return unique_id
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from meshtastic import BROADCAST_NUM
|
||||||
|
|
||||||
from command_handlers import (
|
from command_handlers import (
|
||||||
handle_mail_command, handle_bulletin_command, handle_exit_command,
|
handle_mail_command, handle_bulletin_command, handle_exit_command,
|
||||||
handle_help_command, handle_stats_command, handle_fortune_command,
|
handle_help_command, handle_stats_command, handle_fortune_command,
|
||||||
|
@ -33,9 +35,8 @@ def process_message(sender_id, message, interface, is_sync_message=False):
|
||||||
add_bulletin(board, sender_short_name, subject, content, [], interface, unique_id=unique_id)
|
add_bulletin(board, sender_short_name, subject, content, [], interface, unique_id=unique_id)
|
||||||
|
|
||||||
if board.lower() == "urgent":
|
if board.lower() == "urgent":
|
||||||
group_chat_id = 4294967295
|
|
||||||
notification_message = f"💥NEW URGENT BULLETIN💥\nFrom: {sender_short_name}\nTitle: {subject}"
|
notification_message = f"💥NEW URGENT BULLETIN💥\nFrom: {sender_short_name}\nTitle: {subject}"
|
||||||
send_message(notification_message, group_chat_id, interface)
|
send_message(notification_message, BROADCAST_NUM, interface)
|
||||||
elif message.startswith("MAIL|"):
|
elif message.startswith("MAIL|"):
|
||||||
parts = message.split("|")
|
parts = message.split("|")
|
||||||
sender_id, sender_short_name, recipient_id, subject, content, unique_id = parts[1], parts[2], parts[3], parts[4], parts[5], parts[6]
|
sender_id, sender_short_name, recipient_id, subject, content, unique_id = parts[1], parts[2], parts[3], parts[4], parts[5], parts[6]
|
||||||
|
|
Loading…
Reference in a new issue