Skip to content

Commit

Permalink
Make trunacated messages end in "..." to indicate that message has mo…
Browse files Browse the repository at this point in the history
…re on iOS
  • Loading branch information
cyberneel committed Jan 5, 2025
1 parent c2b392b commit f888483
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/ble/AppleNotificationCenterClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ void AppleNotificationCenterClient::OnNotification(ble_gap_event* event) {
notifStr += decodedMessage;
}

// Adjust notification if too long
if (notifStr.size() > 100) {
notifStr.resize(97);
notifStr += "...";
}

notif.message = std::array<char, 101> {};
std::strncpy(notif.message.data(), notifStr.c_str(), notif.message.size() - 1);

Expand Down

0 comments on commit f888483

Please sign in to comment.