This diff is a no-op; just refactoring things to prepare for later diffs.
- Use the new messages returned from fetchMessageNotifyType instead of threadsToMessageIndices and messageInfos. In a later diff, this has the benefit of including messageNotifyType
- Get rid of flattenLatestMessagesPerUser by simplifying logic
- Simplify types
Depends on D14335