refactor: Add sortOrderKey and check for this while Event creation
This makes it easier to write a store which just stores the Event json and does not have a dedicated scheme for each object like Moor has.
This commit is contained in:
parent
26261ecd5e
commit
d0f67f914a
|
|
@ -173,7 +173,7 @@ class Event extends MatrixEvent {
|
||||||
: DateTime.now(),
|
: DateTime.now(),
|
||||||
unsigned: unsigned,
|
unsigned: unsigned,
|
||||||
room: room,
|
room: room,
|
||||||
sortOrder: sortOrder ?? 0.0,
|
sortOrder: sortOrder ?? unsigned.tryGet<num>(sortOrderKey) ?? 0.0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ const Map<HistoryVisibility, String> _historyVisibilityMap = {
|
||||||
const String messageSendingStatusKey =
|
const String messageSendingStatusKey =
|
||||||
'com.famedly.famedlysdk.message_sending_status';
|
'com.famedly.famedlysdk.message_sending_status';
|
||||||
|
|
||||||
|
const String sortOrderKey = 'com.famedly.famedlysdk.sort_order';
|
||||||
|
|
||||||
/// Represents a Matrix room.
|
/// Represents a Matrix room.
|
||||||
class Room {
|
class Room {
|
||||||
/// The full qualified Matrix ID for the room in the format '!localid:server.abc'.
|
/// The full qualified Matrix ID for the room in the format '!localid:server.abc'.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue