mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-25 12:16:38 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user