Skip to content

Latest commit

 

History

History
66 lines (56 loc) · 5.47 KB

File metadata and controls

66 lines (56 loc) · 5.47 KB

Refactoring Summary: Full Social Overhaul & Element X Settings Parity

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.


1. Authentication & Session Persistence

  • File Modified: MatrixClientManager.kt (diff)
  • Change: Added baseClient.restoreSession(session) inside the init block's coroutine. Previously, the app checked if a session existed on disk via baseClient.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.

2. Modular Settings UI (Element X Parity)

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:
    1. 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.
    2. 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.
    3. 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).
    4. SecuritySettingsScreen.kt (file)
      • Lists linked discovery options (emails and phone numbers).
      • Manages identity server connection settings.
      • Features integration manager toggles.
    5. 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).

3. Comprehensive Search & Discoverability

  • 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) with isDirect = true and the target user ID, then navigate directly to the new chat.

4. Chat & Messaging Enhancements

  • 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) or timeline.unpinEvent(eventId) accordingly.
    • Read Receipts & Edited Indicators:
      • Displays edited next to the message body if message.isEdited is true.
      • If the message was sent by the current user, displays a single tick (Done icon) if sent, or a double tick (DoneAll icon) if read by any other room member (checking event.readReceipts).
    • Reply Navigation:
      • Implemented LazyListState on the chat LazyColumn.
      • 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.
    • 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.