Sender side previews - fixing up PR comments
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
797279d6d7
commit
d095971cb3
|
@ -98,10 +98,8 @@ class CwtchNotifier {
|
|||
}
|
||||
if (profileCN.getProfile(data["ProfileOnion"])?.contactList.getContact(int.parse(data["ConversationID"])) == null) {
|
||||
profileCN.getProfile(data["ProfileOnion"])?.contactList.add(ContactInfoState(data["ProfileOnion"], int.parse(data["ConversationID"]), data["GroupID"],
|
||||
blocked: false,
|
||||
// we created
|
||||
accepted: true,
|
||||
// we created
|
||||
blocked: false, // we created
|
||||
accepted: true, // we created
|
||||
imagePath: data["PicturePath"],
|
||||
nickname: data["GroupName"],
|
||||
status: status,
|
||||
|
@ -246,11 +244,13 @@ class CwtchNotifier {
|
|||
case "UpdatedProfileAttribute":
|
||||
if (data["Key"] == "public.profile.name") {
|
||||
profileCN.getProfile(data["ProfileOnion"])?.nickname = data["Data"];
|
||||
} else if (data["Key"].toString().endsWith(".path")) {
|
||||
} else if (data["Key"].toString().startsWith("local.filesharing.") && data["Key"].toString().endsWith(".path")) {
|
||||
// local.conversation.filekey.path
|
||||
List<String> keyparts = data["Key"].toString().split(".");
|
||||
String filekey = keyparts[2] + "." + keyparts[3];
|
||||
profileCN.getProfile(data["ProfileOnion"])?.downloadSetPathDangerous(filekey, data["Data"]);
|
||||
if (keyparts.length == 5) {
|
||||
String filekey = keyparts[2] + "." + keyparts[3];
|
||||
profileCN.getProfile(data["ProfileOnion"])?.downloadSetPathForSender(filekey, data["Data"]);
|
||||
}
|
||||
} else {
|
||||
EnvironmentConfig.debugLog("unhandled set attribute event: ${data['Key']}");
|
||||
}
|
||||
|
|
|
@ -253,7 +253,8 @@ class ProfileInfoState extends ChangeNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
void downloadSetPathDangerous(String fileKey, String path) {
|
||||
// set the download path for the sender
|
||||
void downloadSetPathForSender(String fileKey, String path) {
|
||||
this._downloads[fileKey] = FileDownloadProgress(1, DateTime.now());
|
||||
this._downloads[fileKey]!.timeEnd = DateTime.now();
|
||||
this._downloads[fileKey]!.chunksDownloaded = 1;
|
||||
|
@ -264,7 +265,6 @@ class ProfileInfoState extends ChangeNotifier {
|
|||
}
|
||||
|
||||
String? downloadFinalPath(String fileKey) {
|
||||
var path = this._downloads[fileKey];
|
||||
return this._downloads.containsKey(fileKey) ? this._downloads[fileKey]!.downloadedTo : null;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,12 +62,9 @@ class FileBubbleState extends State<FileBubble> {
|
|||
if (downloadComplete && path == null && metadata.attributes["filepath"] != null) {
|
||||
path = metadata.attributes["filepath"];
|
||||
} else if (downloadComplete && path != null && metadata.attributes["filepath"] == null) {
|
||||
if (metadata.attributes["filepath"] == null) {
|
||||
Provider.of<FlwtchState>(context).cwtch.SetMessageAttribute(metadata.profileOnion, metadata.conversationIdentifier, 0, metadata.messageID, "filepath", path);
|
||||
}
|
||||
Provider.of<FlwtchState>(context).cwtch.SetMessageAttribute(metadata.profileOnion, metadata.conversationIdentifier, 0, metadata.messageID, "filepath", path);
|
||||
}
|
||||
|
||||
var fileKey = widget.fileKey();
|
||||
if (downloadComplete && path != null) {
|
||||
var lpath = path.toLowerCase();
|
||||
if (lpath.endsWith(".jpg") || lpath.endsWith(".jpeg") || lpath.endsWith(".png") || lpath.endsWith(".gif") || lpath.endsWith(".webp") || lpath.endsWith(".bmp")) {
|
||||
|
@ -93,8 +90,6 @@ class FileBubbleState extends State<FileBubble> {
|
|||
} else {
|
||||
senderDisplayStr = Provider.of<MessageMetadata>(context).senderHandle;
|
||||
}
|
||||
} else {
|
||||
senderIsContact = true;
|
||||
}
|
||||
return LayoutBuilder(builder: (bcontext, constraints) {
|
||||
var wdgSender = Visibility(
|
||||
|
|
Loading…
Reference in New Issue