This document summarizes the changes made to the Solstice Matrix/Social implementation to achieve full functionality, session persistence, modular settings parity with Element X, and comprehensive chat features.
- File Modified:
MatrixClientManager.kt(diff) - Change: Added
baseClient.restoreSession(session)inside theinitblock's coroutine. Previously, the app checked if a session existed on disk viabaseClient.session(), but never actually restored/authenticated it, causing the session to be lost on app restart. Now, it properly restores the session and starts syncing on cold start.
The settings UI was refactored from a single monolithic file into a clean, modular structure matching Element X Android.
- File Modified:
SocialSettingsScreen.kt(diff)- Refactored to act as a clean navigation hub.
- Delegated all sub-settings views to the new modular screen composables.
- New Files Created:
AccountSettingsScreen.kt(file)- Displays user avatar (with upload/change support), display name (with edit support), and Matrix ID (with click-to-copy).
- Contains links for online account management and the Sign Out button.
SessionsSettingsScreen.kt(file)- Displays current session details (verification status, device ID, last seen IP).
- Displays a list of other active sessions with last seen timestamps, IP addresses, and a button to sign out of them.
NotificationsSettingsScreen.kt(file)- Features local toggles for enabling notifications, muting groups, and muting DMs.
- Integrates homeserver-synchronized push rules (
.m.rule.master,.m.rule.contains_display_name,.m.rule.message).
SecuritySettingsScreen.kt(file)- Lists linked discovery options (emails and phone numbers).
- Manages identity server connection settings.
- Features integration manager toggles.
EncryptionSettingsScreen.kt(file)- Manages secure backup status and recovery key generation.
- Implements the recovery key reset flow (generating a new key and displaying it securely with copy-to-clipboard functionality).
- File Modified:
MatrixSearchScreen.kt(diff) - Changes:
- Public Room Search: Wired clicking on a public room search result to call
client.joinRoomById(room.room_id)and navigate directly to the chat screen. - People Search: Wired clicking on a user search result to create an encrypted DM using
client.createRoom(params)withisDirect = trueand the target user ID, then navigate directly to the new chat.
- Public Room Search: Wired clicking on a public room search result to call
- File Modified:
ChatScreen.kt(diff) - Changes:
- Message Editing:
- Long-pressing a message and selecting "Edit" populates the input field and displays an "Editing" banner.
- Sending the edited text calls
timeline.edit(editedContent, eventOrTxnId)using the FFI timeline methods.
- Pinning & Unpinning:
- Added "Pin" and "Unpin" actions to the message context menu.
- Checks if the message is already pinned via
room.roomInfo().pinnedEventIds. - Invokes
timeline.pinEvent(eventId)ortimeline.unpinEvent(eventId)accordingly.
- Read Receipts & Edited Indicators:
- Displays
editednext to the message body ifmessage.isEditedis true. - If the message was sent by the current user, displays a single tick (
Doneicon) if sent, or a double tick (DoneAllicon) if read by any other room member (checkingevent.readReceipts).
- Displays
- Reply Navigation:
- Implemented
LazyListStateon the chatLazyColumn. - Clicking a reply preview inside a chat bubble finds the index of the original message by event ID and animated-scrolls the list to that message.
- Implemented
- Group Roles:
- On room load, fetches all room members asynchronously via
r.membersNoSync()and stores them in a map. - Inside group chats, checks the sender's role via
member.suggestedRoleForPowerLevel(). - Displays a prominent "Admin" (red/error container) or "Mod" (purple/tertiary container) badge next to the sender's name in the chat bubble.
- On room load, fetches all room members asynchronously via
- Message Editing: