mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-04 03:06:12 +00:00
fix: remove redundant slen clamp and update stale comment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
34cfd27b8a
commit
0f5740f6b6
@@ -88,14 +88,13 @@ class QuickMsgScreen : public UIScreen {
|
|||||||
&sensors, batt);
|
&sensors, batt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build "@nick " prefix from a channel message text ("nick: body") into _reply_prefix.
|
// Build "@[nick] " prefix from a channel message text ("nick: body") into _reply_prefix.
|
||||||
// Returns false if sender is "Me" (own message — no reply prefix needed).
|
// Returns false if sender is "Me" (own message — no reply prefix needed).
|
||||||
bool buildChannelReplyPrefix(const char* text) {
|
bool buildChannelReplyPrefix(const char* text) {
|
||||||
const char* sep = strstr(text, ": ");
|
const char* sep = strstr(text, ": ");
|
||||||
if (!sep) return false;
|
if (!sep) return false;
|
||||||
int slen = (int)(sep - text);
|
int slen = (int)(sep - text);
|
||||||
if (slen == 2 && strncmp(text, "Me", 2) == 0) return false;
|
if (slen == 2 && strncmp(text, "Me", 2) == 0) return false;
|
||||||
if (slen > 32) slen = 32;
|
|
||||||
if (slen > 31) slen = 31;
|
if (slen > 31) slen = 31;
|
||||||
snprintf(_reply_prefix, sizeof(_reply_prefix), "@[%.*s] ", slen, text);
|
snprintf(_reply_prefix, sizeof(_reply_prefix), "@[%.*s] ", slen, text);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user