Update LCG + Fuzzbot Fix
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details

Fix: #584
Fix: #575
This commit is contained in:
Sarah Jamie Lewis 2022-12-07 15:02:53 -08:00
parent 27a729d09a
commit 9a67008ece
3 changed files with 23 additions and 19 deletions

View File

@ -1 +1 @@
2022-12-06-12-16-v1.10.0-8-g137027d
2022-12-07-17-51-v1.10.1

View File

@ -1 +1 @@
2022-12-06-17-15-v1.10.0-8-g137027d
2022-12-07-22-53-v1.10.1

View File

@ -22,27 +22,31 @@ class FileMessage extends Message {
return ChangeNotifierProvider.value(
value: this.metadata,
builder: (bcontext, child) {
dynamic shareObj = jsonDecode(this.content);
if (shareObj == null) {
return MessageRow(MalformedBubble(), index);
}
String nameSuggestion = shareObj['f'] as String;
String rootHash = shareObj['h'] as String;
String nonce = shareObj['n'] as String;
int fileSize = shareObj['s'] as int;
String fileKey = rootHash + "." + nonce;
if (metadata.attributes["file-downloaded"] == "true") {
if (!Provider.of<ProfileInfoState>(context).downloadKnown(fileKey)) {
Provider.of<FlwtchState>(context, listen: false).cwtch.CheckDownloadStatus(Provider.of<ProfileInfoState>(context, listen: false).onion, fileKey);
try {
dynamic shareObj = jsonDecode(this.content);
if (shareObj == null) {
return MessageRow(MalformedBubble(), index);
}
}
String nameSuggestion = shareObj['f'] as String;
String rootHash = shareObj['h'] as String;
String nonce = shareObj['n'] as String;
int fileSize = shareObj['s'] as int;
String fileKey = rootHash + "." + nonce;
if (!validHash(rootHash, nonce)) {
if (metadata.attributes["file-downloaded"] == "true") {
if (!Provider.of<ProfileInfoState>(context).downloadKnown(fileKey)) {
Provider.of<FlwtchState>(context, listen: false).cwtch.CheckDownloadStatus(Provider.of<ProfileInfoState>(context, listen: false).onion, fileKey);
}
}
if (!validHash(rootHash, nonce)) {
return MessageRow(MalformedBubble(), index);
}
return MessageRow(FileBubble(nameSuggestion, rootHash, nonce, fileSize, isAuto: metadata.isAuto), index, key: key);
} catch (e) {
return MessageRow(MalformedBubble(), index);
}
return MessageRow(FileBubble(nameSuggestion, rootHash, nonce, fileSize, isAuto: metadata.isAuto), index, key: key);
});
}