communities/core/entities/community_utils
library
Functions
-
convertMimeTypes(File file, String? mimeType)
→ String
-
Overrides mime types
-
enrichRoom({required MRoom room, required String roomID, required bool invite})
→ MRoom
-
Enriches a single room object with the group name, avatar URL, and invite status
-
enrichRooms(Map<String, MRoom>? roomsData, {bool invite = false})
→ Map<String, MRoom>?
-
Processes the initial room data after the sync API is called the first time
-
fibonacci(int n)
→ List<int>
-
-
formatMessageTimestamp(int? timestamp)
→ String
-
Returns a human readable format of a Matrix timestamp
-
formatTimestamp({required int? timestamp, bool showTime = true, bool showDate = true})
→ String
-
Formats a timestamp
-
formatUsername(String? name)
→ String
-
Truncates the unnecessary parts of a username
-
getInitials(String string)
→ String
-
Retrieves a name's initials
-
processMembership({required MembershipEventTypes? type, required String sender, required String target})
→ String
-
Returns a human-readable string representation of membership events.
-
processRoomUpdates({required MRoom serverRoom, required MRoom stateRoom, required bool invite})
→ MRoom
-
Cleans up room updates by removing duplicate events and redacted events
-
selectPhoto({required ImagePicker picker})
→ Future<File?>
-
-
sortEvents(List<MMessage?>? events)
→ List<MMessage?>
-
-
sortRoomsByLastActivity(List<MRoom> rooms)
→ List<MRoom>
-
-
updateRoomData({required Map<String, MRoom>? fromServer, required Map<String, MRoom>? fromState, required bool invite})
→ Map<String, MRoom>?
-
Loops through the new events from Matrix and runs updates on the old events