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(), | ||||
|       unsigned: unsigned, | ||||
|       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 = | ||||
|     'com.famedly.famedlysdk.message_sending_status'; | ||||
| 
 | ||||
| const String sortOrderKey = 'com.famedly.famedlysdk.sort_order'; | ||||
| 
 | ||||
| /// Represents a Matrix room. | ||||
| class Room { | ||||
|   /// The full qualified Matrix ID for the room in the format '!localid:server.abc'. | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue