fix(mesh): don't mark our own channel post as unread

An app-originated channel send (mirrored into the on-device history)
bumped that channel's unread badge whenever the device's own UI
wasn't already showing that exact channel -- unlike an on-device
compose, which sidesteps this by forcing itself into that channel's
view right before sending. Adds an explicit own_message flag through
addChannelMsg (MessageHistory -> AbstractUITask -> UITask ->
MessagesScreen) so an own post is never counted unread regardless of
what's on screen when it's sent.

Found the same bug in MyMeshBot.h's three auto-reply-into-channel call
sites (Remote Bot's own reply showing as unread on itself) and fixed
those with the same mechanism.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-08-30 20:26:57 +02:00
co-authored by Claude Sonnet 5
parent bdd2ed379d
commit ba3c3cc91f
7 changed files with 29 additions and 13 deletions
+2 -2
View File
@@ -1767,9 +1767,9 @@ int UITask::getRecentDMContacts(uint8_t out[][NodePrefs::FAVOURITE_PREFIX_LEN],
}
int UITask::addChannelMsg(uint8_t channel_idx, const char* text, uint32_t timestamp,
const uint8_t* path, uint8_t path_len) {
const uint8_t* path, uint8_t path_len, bool own_message) {
_last_notif_ch_idx = (int)channel_idx;
return ((MessagesScreen*)messages_screen)->addChannelMsg(channel_idx, text, timestamp, path, path_len);
return ((MessagesScreen*)messages_screen)->addChannelMsg(channel_idx, text, timestamp, path, path_len, own_message);
}
void UITask::armChannelRelay(int pos, uint32_t seq) {