feat: Update app icons and display 'GIF' as message preview for GIF URLs in conversations.

This commit is contained in:
pradeepkumar
2026-03-16 15:37:29 +05:30
parent e195696733
commit d86c862ed7
28 changed files with 15 additions and 1 deletions

View File

@@ -386,6 +386,20 @@ class _ConversationTile extends StatelessWidget {
required this.onTap,
});
static bool _isGifUrl(String text) {
final lower = text.trim().toLowerCase();
return lower.endsWith('.gif') ||
lower.contains('giphy.com/') ||
lower.contains('giphy.gif') ||
lower.contains('tenor.com/');
}
static String _formatPreview(String text) {
if (text.isEmpty) return text;
if (_isGifUrl(text)) return 'GIF';
return text;
}
String _resolveAvatarUrl(String? avatarKey) {
if (avatarKey == null || avatarKey.isEmpty) return '';
if (avatarKey.startsWith('http://') || avatarKey.startsWith('https://')) {
@@ -402,7 +416,7 @@ class _ConversationTile extends StatelessWidget {
Widget build(BuildContext context) {
final otherParty = conversation.otherParty;
final avatarUrl = _resolveAvatarUrl(otherParty.avatar);
final lastMessage = conversation.lastMessageText ?? '';
final lastMessage = _formatPreview(conversation.lastMessageText ?? '');
final timestamp = _formatTimestamp(conversation.lastMessageAt);
final unread = conversation.unreadCount;
final firstLetter = otherParty.name.isNotEmpty