Files
goose/ui
spencrmartin d9d7edcb2e fix: display correct sender avatars in collaborative chat messages
👥 COLLABORATIVE AVATAR FIX: Show actual sender's avatar instead of current user

## Message Type Enhancement:
✅ Extended Message interface to include optional sender metadata
✅ Sender info includes userId, displayName, and avatarUrl
✅ Backward compatible - existing messages without sender info still work

## Matrix Service Enhancement:
✅ Enhanced handleMessage() to extract sender profile information
✅ Gets sender details from room member or Matrix user data
✅ Includes sender avatar URL (MXC format) in message data
✅ Fallback to username extraction from Matrix ID if no display name

## Session Sharing Enhancement:
✅ Updated message creation to use sender information from Matrix events
✅ Searches friends and participants list to find sender details
✅ Includes complete sender profile (userId, displayName, avatarUrl)
✅ Fallback logic for unknown senders

## UserMessage Component Fix:
✅ Uses message.sender info when available, falls back to current user
✅ Displays correct avatar for each message sender
✅ Shows proper display name for collaborative session participants
✅ Maintains existing functionality for non-collaborative messages

## Key Benefits:
🎯 **Correct Attribution**: Each message shows the actual sender's avatar
👥 **Multi-User Support**: Perfect for collaborative sessions with multiple participants
🔄 **Real-time Updates**: Sender avatars update when profiles change
🛡️ **Backward Compatible**: Works with existing messages and solo sessions

## Technical Flow:
1. Matrix message received → Extract sender profile info
2. Create Message with sender metadata → Pass to session sharing
3. UserMessage component → Use sender info if available, fallback to current user
4. Display correct avatar → Show actual sender's profile picture

Now in collaborative sessions, you'll see each participant's actual avatar
next to their messages, making it crystal clear who said what! 🦆👥✨
2025-11-14 11:09:27 -05:00
..