newThreadToQueue method
Future<int>
newThreadToQueue(
- String _baseUrl,
- String text,
- Uint8List attachement,
- String _nick,
- String _avatar,
- String shortLinkOfPrevious,
- String cid,
- String attachmentType,
- String xxHash,
- String _blurHash,
- int attachmentLength,
)
Implementation
Future<int> newThreadToQueue(
String _baseUrl,
String text,
Uint8List attachement,
String _nick,
String _avatar,
String shortLinkOfPrevious,
String cid,
String attachmentType,
String xxHash,
String _blurHash,
int attachmentLength) async {
if (shortLinkOfPrevious.isEmpty) {
//patch in latest root
final own = LatestThreads.latestMineShortLink;
if (own.isEmpty) {
shortLinkOfPrevious = LatestThreads.posts.last.shortLink;
} else {
shortLinkOfPrevious = own;
}
}
final ogm = _ogMessages.addPost(
_nick,
_avatar,
text,
shortLinkOfPrevious,
'',
now,
attachement,
cid,
attachmentType,
xxHash,
_blurHash,
attachmentLength);
if (ogm == null) return -1;
//just push to disk when no net availablus
_ogMessages.pushToDiskQueue(ogm.timestamp);
//update cache of fake entries to show
//dirty so flutter updates cache for queued entries
_dirty = true;
currentPendingAsModeratorEntries;
return ogm.timestamp;
}