android, desktop, ios: let caption-less media become the pending invitee preview

The prefer-content check used hasMsgContent (msgContent != null AND non-empty text), so a
caption-less photo/voice/file was treated like a no-content event and could not become the preview
when a prior text message was shown. Use msgContent != null (is-a-message) instead; the no-content
event re-cover guard still holds (events have msgContent == null).
This commit is contained in:
Narasimha-sc
2026-07-20 13:31:05 +00:00
parent 204cd2b835
commit cb4b1b7f50
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -664,7 +664,7 @@ final class ChatModel: ObservableObject {
// Pending invitee: surface the latest support message (broker vs local itemTs
// aren't comparable); don't let a no-content event re-cover an already-shown message.
if cInfo.groupInfo?.membership.memberPending ?? false {
(cItem.content.hasMsgContent || !currentPreviewItem.content.hasMsgContent) ? [cItem] : [currentPreviewItem]
(cItem.content.msgContent != nil || currentPreviewItem.content.msgContent == nil) ? [cItem] : [currentPreviewItem]
} else if cItem.meta.itemTs >= currentPreviewItem.meta.itemTs {
[cItem]
} else {
@@ -548,7 +548,7 @@ object ChatModel {
// Pending invitee: surface the latest support message (broker vs local itemTs aren't
// comparable); don't let a no-content event re-cover an already-shown message.
if (cInfo.groupInfo_?.membership?.memberPending == true) {
if (cItem.content.hasMsgContent || !currentPreviewItem.content.hasMsgContent) cItem else currentPreviewItem
if (cItem.content.msgContent != null || currentPreviewItem.content.msgContent == null) cItem else currentPreviewItem
} else if (cItem.meta.itemTs >= currentPreviewItem.meta.itemTs) {
cItem
} else {