refactored and condensed technical documentation and comments across the codebase to improve readability

This commit is contained in:
2026-07-06 23:17:06 +02:00
parent c48f5ef215
commit a19b67eb84
27 changed files with 99 additions and 193 deletions
+7 -13
View File
@@ -77,15 +77,11 @@ List<ThreadMessage> removeThreadNid(List<ThreadMessage> messages, int nid) =>
/// History for the next notification after [message] arrives, given whether
/// the chat's previous notification is still on screen ([isActive]):
/// `true` → stacks onto existing history; `false` → notification gone
/// (dismissed/read), thread restarts with only [message]; `null` → probe
/// failed/unsupported, keep stacking (degraded stacking never loses a message).
///
/// - `true` → the user hasn't dismissed/read it, so [message] STACKS onto the
/// existing history.
/// - `false` → the notification is gone (swiped away or the chat was read
/// without our cleanup running), so the thread RESTARTS with only [message].
/// - `null` → the active-notification probe failed or isn't supported; keep
/// stacking defensively — degraded stacking never loses a message.
///
/// Android provides no reliable "notification dismissed" callback, so the
/// Android has no reliable "notification dismissed" callback, so the
/// visible-state probe at append time is the substitute.
List<ThreadMessage> threadAfterIncoming(
List<ThreadMessage> existing,
@@ -98,11 +94,9 @@ List<ThreadMessage> threadAfterIncoming(
}
/// MessagingStyle header per Android convention: a 1:1 chat gets NO
/// `conversationTitle` — the system then shows the person once as the header
/// and plain texts per line; setting a title would repeat the name on every
/// row. Groups get the ROOM NAME as title (parsed from the subject) plus
/// per-line sender names; when no room name is known, >1 distinct sender
/// still marks the thread as group with the last sender as title fallback.
/// `conversationTitle` (setting one would repeat the person's name on every
/// row); groups use the room name as title, falling back to the last sender
/// when there is >1 distinct sender but no room name is known.
({String? conversationTitle, bool groupConversation}) conversationHeader(
List<ThreadMessage> messages,
) {