mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-02 14:26:12 -04:00
everything but reconcile
This commit is contained in:
parent
37f6ca19f7
commit
6d05c9f125
8 changed files with 305 additions and 150 deletions
|
@ -1,3 +1,7 @@
|
|||
import 'dart:typed_data';
|
||||
|
||||
import 'package:veilid_support/veilid_support.dart';
|
||||
|
||||
import 'proto.dart' as proto;
|
||||
|
||||
proto.Message messageFromJson(Map<String, dynamic> j) =>
|
||||
|
@ -10,3 +14,13 @@ proto.ReconciledMessage reconciledMessageFromJson(Map<String, dynamic> j) =>
|
|||
|
||||
Map<String, dynamic> reconciledMessageToJson(proto.ReconciledMessage m) =>
|
||||
m.writeToJsonMap();
|
||||
|
||||
extension MessageExt on proto.Message {
|
||||
Uint8List get uniqueIdBytes {
|
||||
final author = this.author.toVeilid().decode();
|
||||
final id = this.id;
|
||||
return Uint8List.fromList([...author, ...id]);
|
||||
}
|
||||
|
||||
String get uniqueIdString => base64UrlNoPadEncode(uniqueIdBytes);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue