mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-27 15:02:41 +00:00
Merge d36b919346 into 13c4c2037d
This commit is contained in:
commit
2714f846e7
@ -1498,7 +1498,7 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
|
|||||||
snprintf(banner, sizeof(banner), "New Message from\n%s", longName);
|
snprintf(banner, sizeof(banner), "New Message from\n%s", longName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else {
|
} else if (!node->is_muted) {
|
||||||
strcpy(banner, "New Message");
|
strcpy(banner, "New Message");
|
||||||
}
|
}
|
||||||
#if defined(M5STACK_UNITC6L)
|
#if defined(M5STACK_UNITC6L)
|
||||||
|
|||||||
@ -369,6 +369,24 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case meshtastic_AdminMessage_set_muted_node_tag: {
|
||||||
|
LOG_INFO("Client received set_muted_node command");
|
||||||
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(r->set_muted_node);
|
||||||
|
if (node != NULL) {
|
||||||
|
node->is_muted = true;
|
||||||
|
saveChanges(SEGMENT_NODEDATABASE, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case meshtastic_AdminMessage_remove_muted_node_tag: {
|
||||||
|
LOG_INFO("Client received remove_muted_node command");
|
||||||
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(r->remove_muted_node);
|
||||||
|
if (node != NULL) {
|
||||||
|
node->is_muted = false;
|
||||||
|
saveChanges(SEGMENT_NODEDATABASE, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case meshtastic_AdminMessage_set_fixed_position_tag: {
|
case meshtastic_AdminMessage_set_fixed_position_tag: {
|
||||||
LOG_INFO("Client received set_fixed_position command");
|
LOG_INFO("Client received set_fixed_position command");
|
||||||
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(nodeDB->getNodeNum());
|
||||||
|
|||||||
@ -458,7 +458,9 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
meshtastic_NodeInfoLite *sender = nodeDB->getMeshNode(mp.from);
|
||||||
meshtastic_Channel ch = channels.getByIndex(mp.channel ? mp.channel : channels.getPrimaryIndex());
|
meshtastic_Channel ch = channels.getByIndex(mp.channel ? mp.channel : channels.getPrimaryIndex());
|
||||||
|
|
||||||
if (moduleConfig.external_notification.alert_bell) {
|
if (moduleConfig.external_notification.alert_bell) {
|
||||||
if (containsBell) {
|
if (containsBell) {
|
||||||
LOG_INFO("externalNotificationModule - Notification Bell");
|
LOG_INFO("externalNotificationModule - Notification Bell");
|
||||||
@ -509,7 +511,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moduleConfig.external_notification.alert_message &&
|
if (moduleConfig.external_notification.alert_message && !sender->is_muted &&
|
||||||
(!ch.settings.has_module_settings || !ch.settings.module_settings.is_muted)) {
|
(!ch.settings.has_module_settings || !ch.settings.module_settings.is_muted)) {
|
||||||
LOG_INFO("externalNotificationModule - Notification Module");
|
LOG_INFO("externalNotificationModule - Notification Module");
|
||||||
isNagging = true;
|
isNagging = true;
|
||||||
@ -521,7 +523,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moduleConfig.external_notification.alert_message_vibra &&
|
if (moduleConfig.external_notification.alert_message_vibra && !sender->is_muted &&
|
||||||
(!ch.settings.has_module_settings || !ch.settings.module_settings.is_muted)) {
|
(!ch.settings.has_module_settings || !ch.settings.module_settings.is_muted)) {
|
||||||
LOG_INFO("externalNotificationModule - Notification Module (Vibra)");
|
LOG_INFO("externalNotificationModule - Notification Module (Vibra)");
|
||||||
isNagging = true;
|
isNagging = true;
|
||||||
@ -533,7 +535,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moduleConfig.external_notification.alert_message_buzzer &&
|
if (moduleConfig.external_notification.alert_message_buzzer && !sender->is_muted &&
|
||||||
(!ch.settings.has_module_settings || !ch.settings.module_settings.is_muted)) {
|
(!ch.settings.has_module_settings || !ch.settings.module_settings.is_muted)) {
|
||||||
LOG_INFO("externalNotificationModule - Notification Module (Buzzer)");
|
LOG_INFO("externalNotificationModule - Notification Module (Buzzer)");
|
||||||
if (config.device.buzzer_mode != meshtastic_Config_DeviceConfig_BuzzerMode_DIRECT_MSG_ONLY ||
|
if (config.device.buzzer_mode != meshtastic_Config_DeviceConfig_BuzzerMode_DIRECT_MSG_ONLY ||
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user