Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9da9262
Create channel-mute toggle function
ford-jones Sep 11, 2025
67ecb60
Added mute state to channel settings
ford-jones Sep 11, 2025
fa1ccf4
Create node-mute toggle functions
ford-jones Sep 11, 2025
6b7ad9c
Added mute state to nodedb entries
ford-jones Sep 11, 2025
02cb306
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 11, 2025
1594421
Rebase protos
ford-jones Sep 11, 2025
a31fdf0
Decouple protobuf changes
ford-jones Sep 11, 2025
d5300a1
Disable bell-invoked ext notifs for muted nodes
ford-jones Sep 12, 2025
8c9c001
Clearly dilineate module mute from sender or channel mute
ford-jones Sep 12, 2025
4e879a7
Disable bell-invoked ext notifs for muted channels
ford-jones Sep 12, 2025
71f659c
Trunk fmt
ford-jones Sep 12, 2025
39c663f
Merge branch 'develop' of https://github.com/meshtastic/firmware into…
ford-jones Sep 12, 2025
693181b
Disable message-invoked ext notifs for muted channels and nodes
ford-jones Sep 12, 2025
5579d87
Disable on-screen 'new message' popup for muted nodes and channels
ford-jones Sep 12, 2025
e0890b2
Don't mute alerts
ford-jones Sep 12, 2025
ccff276
Make use of pre-existing channel_settings.module_settings.is_client_m…
ford-jones Sep 13, 2025
f8d44f8
Revert previous commit - this needs it's own proto
ford-jones Sep 13, 2025
bfadd9c
Regen protos
ford-jones Sep 13, 2025
a76f591
Fix - reference actual channel when changing settings
ford-jones Sep 15, 2025
5fca3a3
Update protos
ford-jones Sep 15, 2025
f0b7aab
Refactor ref syntax
ford-jones Sep 15, 2025
1c256cc
Update comments and remove unused function
ford-jones Sep 16, 2025
e0f88be
Merge branch 'develop' of https://github.com/meshtastic/firmware into…
ford-jones Sep 16, 2025
c9702fe
Regen protos
ford-jones Sep 16, 2025
4ac99c5
Regen protobuffs again
ford-jones Sep 16, 2025
43078a4
Fix build failure in ci, add missing argument
ford-jones Sep 16, 2025
c9cb2cf
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 16, 2025
c811e4c
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 21, 2025
97d0f32
Merge branch 'develop' into 7943-mute-target
fifieldt Sep 22, 2025
59f9e2a
Regen protos
ford-jones Sep 22, 2025
0db2e40
Use latest protos
ford-jones Sep 22, 2025
319cd6f
Regen protos for latest changes
ford-jones Sep 22, 2025
e784012
Decouple node-mute from channel-mute
ford-jones Sep 22, 2025
2fbfb19
Regen protos
ford-jones Sep 23, 2025
58602d5
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 24, 2025
1fc8d54
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 24, 2025
79bc286
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 25, 2025
52ee655
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 26, 2025
4dec912
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 27, 2025
9b1a118
Merge branch 'develop' into 7943-mute-target
thebentern Sep 27, 2025
f6a28e1
Pull latest, regen protos
ford-jones Sep 27, 2025
6448f06
Use channel as specified in the received packet
ford-jones Sep 28, 2025
a4a6ee1
Merge branch '7943-mute-target' of https://github.com/ford-jones/firm…
ford-jones Sep 28, 2025
abc011a
Use channel as specified in the received packet for OLED screen notif…
ford-jones Sep 28, 2025
85fe7d2
Merge branch 'develop' into 7943-mute-target
ford-jones Sep 28, 2025
a8a6644
Merge branch 'develop' into 7943-mute-target
ford-jones Oct 1, 2025
de67714
Merge branch 'develop' into 7943-mute-target
thebentern Oct 2, 2025
5ec0978
Merge branch 'develop' into 7943-mute-target
ford-jones Oct 2, 2025
51ad9d0
run trunk fmt
ford-jones Oct 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions src/graphics/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace graphics
#define NUM_EXTRA_FRAMES 3 // text message and debug frame
// if defined a pixel will blink to show redraws
// #define SHOW_REDRAWS

#define ASCII_BELL '\x07'
// A text message frame + debug frame + all the node infos
FrameCallback *normalFrames;
static uint32_t targetFramerate = IDLE_FRAMERATE;
Expand Down Expand Up @@ -1458,28 +1458,36 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
}
// === Prepare banner content ===
const meshtastic_NodeInfoLite *node = nodeDB->getMeshNode(packet->from);
const meshtastic_Channel channel =
channels.getByIndex(packet->channel ? packet->channel : channels.getPrimaryIndex());
const char *longName = (node && node->has_user) ? node->user.long_name : nullptr;

const char *msgRaw = reinterpret_cast<const char *>(packet->decoded.payload.bytes);

char banner[256];

// Check for bell character in message to determine alert type
bool isAlert = false;
for (size_t i = 0; i < packet->decoded.payload.size && i < 100; i++) {
if (msgRaw[i] == '\x07') {
isAlert = true;
break;

if (moduleConfig.external_notification.alert_bell || moduleConfig.external_notification.alert_bell_vibra ||
moduleConfig.external_notification.alert_bell_buzzer)
// Check for bell character to determine if this message is an alert
for (size_t i = 0; i < packet->decoded.payload.size && i < 100; i++) {
if (msgRaw[i] == ASCII_BELL) {
isAlert = true;
break;
}
}
}

// Unlike generic messages, alerts (when enabled via the ext notif module) ignore any
// 'mute' preferences set to any specific node or channel.
if (isAlert) {
if (longName && longName[0]) {
snprintf(banner, sizeof(banner), "Alert Received from\n%s", longName);
} else {
strcpy(banner, "Alert Received");
}
} else {
screen->showSimpleBanner(banner, 3000);
} else if (!channel.settings.mute) {
if (longName && longName[0]) {
#if defined(M5STACK_UNITC6L)
strcpy(banner, "New Message");
Expand All @@ -1490,20 +1498,21 @@ int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
} else {
strcpy(banner, "New Message");
}
}
#if defined(M5STACK_UNITC6L)
screen->setOn(true);
screen->showSimpleBanner(banner, 1500);
if (config.device.buzzer_mode != meshtastic_Config_DeviceConfig_BuzzerMode_DIRECT_MSG_ONLY ||
(isAlert && moduleConfig.external_notification.alert_bell_buzzer) || (!isBroadcast(packet->to) && isToUs(p))) {
// Beep if not in DIRECT_MSG_ONLY mode or if in DIRECT_MSG_ONLY mode and either
// - packet contains an alert and alert bell buzzer is enabled
// - packet is a non-broadcast that is addressed to this node
playLongBeep();
}
screen->setOn(true);
screen->showSimpleBanner(banner, 1500);
if (config.device.buzzer_mode != meshtastic_Config_DeviceConfig_BuzzerMode_DIRECT_MSG_ONLY ||
(isAlert && moduleConfig.external_notification.alert_bell_buzzer) ||
(!isBroadcast(packet->to) && isToUs(p))) {
// Beep if not in DIRECT_MSG_ONLY mode or if in DIRECT_MSG_ONLY mode and either
// - packet contains an alert and alert bell buzzer is enabled
// - packet is a non-broadcast that is addressed to this node
playLongBeep();
}
#else
screen->showSimpleBanner(banner, 3000);
screen->showSimpleBanner(banner, 3000);
#endif
}
}
}

Expand Down
11 changes: 6 additions & 5 deletions src/modules/ExternalNotificationModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ ExternalNotificationModule::ExternalNotificationModule()

ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshPacket &mp)
{
if (moduleConfig.external_notification.enabled && !isMuted) {
if (moduleConfig.external_notification.enabled && !isSilenced) {
#ifdef T_WATCH_S3
drv.setWaveform(0, 75);
drv.setWaveform(1, 56);
Expand All @@ -453,12 +453,13 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
// Check if the message contains a bell character. Don't do this loop for every pin, just once.
auto &p = mp.decoded;
bool containsBell = false;
for (int i = 0; i < p.payload.size; i++) {
for (size_t i = 0; i < p.payload.size; i++) {
if (p.payload.bytes[i] == ASCII_BELL) {
containsBell = true;
}
}

meshtastic_Channel ch = channels.getByIndex(mp.channel ? mp.channel : channels.getPrimaryIndex());
if (moduleConfig.external_notification.alert_bell) {
if (containsBell) {
LOG_INFO("externalNotificationModule - Notification Bell");
Expand Down Expand Up @@ -509,7 +510,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
}
}

if (moduleConfig.external_notification.alert_message) {
if (moduleConfig.external_notification.alert_message && !ch.settings.mute) {
LOG_INFO("externalNotificationModule - Notification Module");
isNagging = true;
setExternalState(0, true);
Expand All @@ -520,7 +521,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
}
}

if (moduleConfig.external_notification.alert_message_vibra) {
if (moduleConfig.external_notification.alert_message_vibra && !ch.settings.mute) {
LOG_INFO("externalNotificationModule - Notification Module (Vibra)");
isNagging = true;
setExternalState(1, true);
Expand All @@ -531,7 +532,7 @@ ProcessMessage ExternalNotificationModule::handleReceived(const meshtastic_MeshP
}
}

if (moduleConfig.external_notification.alert_message_buzzer) {
if (moduleConfig.external_notification.alert_message_buzzer && !ch.settings.mute) {
LOG_INFO("externalNotificationModule - Notification Module (Buzzer)");
if (config.device.buzzer_mode != meshtastic_Config_DeviceConfig_BuzzerMode_DIRECT_MSG_ONLY ||
(!isBroadcast(mp.to) && isToUs(&mp))) {
Expand Down
6 changes: 3 additions & 3 deletions src/modules/ExternalNotificationModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class ExternalNotificationModule : public SinglePortModule, private concurrency:
void setExternalState(uint8_t index = 0, bool on = false);
bool getExternal(uint8_t index = 0);

void setMute(bool mute) { isMuted = mute; }
bool getMute() { return isMuted; }
void setMute(bool mute) { isSilenced = mute; }
bool getMute() { return isSilenced; }

bool canBuzz();
bool nagging();
Expand All @@ -67,7 +67,7 @@ class ExternalNotificationModule : public SinglePortModule, private concurrency:

bool isNagging = false;

bool isMuted = false;
bool isSilenced = false;

virtual AdminMessageHandleResult handleAdminMessageForModule(const meshtastic_MeshPacket &mp,
meshtastic_AdminMessage *request,
Expand Down