[READ ONLY MIRROR] Open Source TikTok alternative built on AT Protocol github.com/sprksocial/client
flutter atproto video dart
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(dm): preview for embedded posts

+15 -2
+15 -2
lib/src/features/messages/ui/pages/messages_page.dart
··· 33 33 final convo = tuple.$2; 34 34 final last = convo.lastMessage; 35 35 final ts = _formatTime(last?.sentAt); 36 - final preview = (last?.text ?? '').trim(); 36 + final text = (last?.text ?? '').trim(); 37 + String preview; 38 + if (text.isNotEmpty) { 39 + preview = text; 40 + } else if (last?.embed != null && last!.embed!.isNotEmpty) { 41 + final senderDid = last.sender.did; 42 + final senderProfile = convo.members.firstWhere( 43 + (m) => m.did == senderDid, 44 + orElse: () => profile, 45 + ); 46 + preview = 'Post by @${senderProfile.handle}'; 47 + } else { 48 + preview = ''; 49 + } 37 50 return ChatListItemData( 38 51 avatarUrl: profile.avatar?.toString(), 39 52 displayName: profile.displayName ?? profile.handle, 40 53 handle: profile.handle, 41 54 timestamp: ts, 42 - preview: preview.isNotEmpty ? preview : '', 55 + preview: preview, 43 56 unread: (convo.unreadCount) > 0, 44 57 ); 45 58 }).toList();