mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
Don't favorite if WE are CLIENT_BASE role
This commit is contained in:
@@ -1078,19 +1078,12 @@ void CannedMessageModule::sendText(NodeNum dest, ChannelIndex channel, const cha
|
|||||||
} else {
|
} else {
|
||||||
sm.dest = dest;
|
sm.dest = dest;
|
||||||
sm.type = MessageType::DM_TO_US;
|
sm.type = MessageType::DM_TO_US;
|
||||||
// Only add as favorite if the destination's role is NOT CLIENT_BASE
|
// Only add as favorite if our role is NOT CLIENT_BASE
|
||||||
meshtastic_NodeInfoLite *destInfo = nodeDB->getMeshNode(dest);
|
if (config.device.role != 12) {
|
||||||
bool isClientBase = false;
|
|
||||||
if (destInfo) {
|
|
||||||
if (destInfo->user.role == 12 /* CLIENT_BASE */) {
|
|
||||||
isClientBase = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!isClientBase) {
|
|
||||||
LOG_INFO("Proactively adding %x as favorite node", dest);
|
LOG_INFO("Proactively adding %x as favorite node", dest);
|
||||||
nodeDB->set_favorite(true, dest);
|
nodeDB->set_favorite(true, dest);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("Not favoriting node %x (CLIENT_BASE role)", dest);
|
LOG_DEBUG("Not favoriting node %x as we are CLIENT_BASE role", dest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sm.ackStatus = AckStatus::NONE;
|
sm.ackStatus = AckStatus::NONE;
|
||||||
|
|||||||
Reference in New Issue
Block a user