mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-11-01 10:12:03 +00:00
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:
@@ -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 :
|
||||||
|
|||||||
Reference in New Issue
Block a user