Fix profile picture handling

pull/410/head
Niels Andriesse 3 years ago
parent f3afcc175e
commit 38a7c93967

@ -88,8 +88,9 @@ public final class FileServerAPIV2 : NSObject {
}
@objc(download:)
public static func objc_download(file: UInt64) -> AnyPromise {
return AnyPromise.from(download(file))
public static func objc_download(file: String) -> AnyPromise {
guard let id = UInt64(file) else { return AnyPromise.from(Promise<Data>(error: Error.invalidURL)) }
return AnyPromise.from(download(id))
}
public static func download(_ file: UInt64) -> Promise<Data> {

@ -807,7 +807,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
AnyPromise *promise;
if ([profilePictureURL containsString:SNFileServerAPIV2.server]) {
uint64_t *file = (uint64_t)[[profilePictureURL lastPathComponent] intValue];
NSString *file = [profilePictureURL lastPathComponent];
promise = [SNFileServerAPIV2 download:file];
} else {
promise = [SNFileServerAPI downloadAttachmentFrom:profilePictureURL];

Loading…
Cancel
Save