decodeRetrieveRequest static method
Decode retrieve messages request
Implementation
static RetrieveMessagesRequest decodeRetrieveRequest(Uint8List bytes) {
final json = utf8.decode(bytes);
final data = jsonDecode(json) as Map<String, dynamic>;
return RetrieveMessagesRequest(
peerId: PeerId.fromString(data['peerId'] as String),
folderPath: data['folderPath'] as String?,
fromSequence: data['fromSequence'] as int?,
maxMessages: data['maxMessages'] as int?,
minPriority: data['minPriority'] != null
? MessagePriority.fromValue(data['minPriority'] as int)
: null,
);
}