mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-24 09:50:22 +00:00
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:
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user