feat: Update app icons and display 'GIF' as message preview for GIF URLs in conversations.
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 736 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 11 KiB |
@@ -386,6 +386,20 @@ class _ConversationTile extends StatelessWidget {
|
|||||||
required this.onTap,
|
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) {
|
String _resolveAvatarUrl(String? avatarKey) {
|
||||||
if (avatarKey == null || avatarKey.isEmpty) return '';
|
if (avatarKey == null || avatarKey.isEmpty) return '';
|
||||||
if (avatarKey.startsWith('http://') || avatarKey.startsWith('https://')) {
|
if (avatarKey.startsWith('http://') || avatarKey.startsWith('https://')) {
|
||||||
@@ -402,7 +416,7 @@ class _ConversationTile extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final otherParty = conversation.otherParty;
|
final otherParty = conversation.otherParty;
|
||||||
final avatarUrl = _resolveAvatarUrl(otherParty.avatar);
|
final avatarUrl = _resolveAvatarUrl(otherParty.avatar);
|
||||||
final lastMessage = conversation.lastMessageText ?? '';
|
final lastMessage = _formatPreview(conversation.lastMessageText ?? '');
|
||||||
final timestamp = _formatTimestamp(conversation.lastMessageAt);
|
final timestamp = _formatTimestamp(conversation.lastMessageAt);
|
||||||
final unread = conversation.unreadCount;
|
final unread = conversation.unreadCount;
|
||||||
final firstLetter = otherParty.name.isNotEmpty
|
final firstLetter = otherParty.name.isNotEmpty
|
||||||
|
|||||||