messaging: Fix send_cmd destination type handling

- Fall back to repeater commands when a destination has no contact type.
- Keep an explicit dst_type instead of overwriting it with REPEATER.
This commit is contained in:
Kyle Manna
2026-09-19 12:16:39 -07:00
parent 7e5f2ab470
commit d48b941d56
+5 -4
View File
@@ -73,10 +73,11 @@ class MessagingCommands(CommandHandlerBase):
timestamp = int(time.time()) timestamp = int(time.time())
if dst_type is None: if dst_type is None:
dst_type = dst["type"] if isinstance(dst, dict) and "type" in dst:
else: # assume destination is a repeater dst_type = dst["type"]
logger.warning("Can't determine destination type, please ensure contacts first or specify dst_type when calling `send_cmd`. Assuming it's a repeater.") else: # assume destination is a repeater
dst_type = AdvType.REPEATER.value logger.warning("Can't determine destination type, please ensure contacts first or specify dst_type when calling `send_cmd`. Assuming it's a repeater.")
dst_type = AdvType.REPEATER.value
cmd_data = bytearray([CommandType.SEND_TXT_MSG.value]) cmd_data = bytearray([CommandType.SEND_TXT_MSG.value])
if dst_type == AdvType.CHAT.value : if dst_type == AdvType.CHAT.value :