mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +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:
@@ -2033,7 +2033,11 @@ void MyMesh::handleCmdFrame(size_t len) {
|
||||
int tlen = len - i;
|
||||
if (tlen > MAX_TEXT_LEN) tlen = MAX_TEXT_LEN;
|
||||
snprintf(entry, sizeof(entry), "Me: %.*s", tlen, text);
|
||||
int pos = _ui->addChannelMsg(channel_idx, entry, msg_timestamp);
|
||||
// own_message=true: this is our own post, so it must never bump the
|
||||
// channel's unread badge even though the device's own UI isn't
|
||||
// necessarily showing this channel right now (unlike an on-device
|
||||
// compose, which is always looking at the channel it just sent to).
|
||||
int pos = _ui->addChannelMsg(channel_idx, entry, msg_timestamp, nullptr, 0, true);
|
||||
// Same "relayed into mesh" marker an on-device channel send arms (see
|
||||
// MessagesScreen::afterSend): sendGroupMessage above already went
|
||||
// through sendFloodScoped(GroupChannel&, ...), which calls
|
||||
|
||||
Reference in New Issue
Block a user