Fix profile picture handling

This commit is contained in:
Niels Andriesse 2021-05-13 16:11:21 +10:00
parent f3afcc175e
commit 38a7c93967
2 changed files with 4 additions and 3 deletions

View File

@ -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> {

View File

@ -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];