Skip to content

Conversation

@JonET
Copy link
Contributor

@JonET JonET commented Aug 10, 2025

This PR adds a new option to upload images to PostImages.org instead of Imgur. I've also taken away the option to completely disable image uploads since that caused some confusion.

The new option is under "Settings" under "Image Hosting". Postimages is made the default, and there's a little bit of text explaining the reason for the migration.

Imgur is still available in case users have a strong preference for it, and a protocol was put down in case we want to add other image hosts later.

The rational:
Imgur has been getting less reliable. Recent company layoffs, and the SSO for authentication has been hit or miss. See https://forums.somethingawful.com/showthread.php?threadid=3837546&userid=0&perpage=40&pagenumber=215#post547839086

@JonET JonET requested review from dfsm and nolanw August 10, 2025 17:59
Copy link
Member

@nolanw nolanw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! couple nits

private class ImgurUploadProviderAdapter: ImageUploadProvider {

func upload(_ image: UIImage, completion: @escaping (Result<ImageUploadResponse, Error>) -> Void) -> Progress {
return ImgurUploader.shared.upload(image) { result in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding this singleton access seems weird. At minimum can we pass it in?


// If they had "Off", set Imgur mode to anonymous for when they switch back
if imgurMode == "Off" {
defaults.set("Anonymous", forKey: Settings.imgurUploadMode.key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably use ImgurUploadMode (raw) values for this and "PostImages" below.

@AppStorage(Settings.automaticTimg) private var timgLargeImages
@AppStorage(Settings.useNewSmiliePicker) private var useNewSmiliePicker
@AppStorage("imgur_upload_mode") private var imgurUploadMode: String = "Off"
@AppStorage("image_hosting_provider") private var imageHostingProvider: String = "Imgur"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use ImageHostingProvider here instead of a plain String? I thought AppStorage could handle that but maybe I'm wrong.

public init() {
let config = URLSessionConfiguration.ephemeral
config.httpAdditionalHeaders = [
"User-Agent": "Awful iOS App"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We set a custom user-agent in Awful proper, would be nice to reuse that here. Could pass it in to the initializer maybe.


// Move everyone to PostImages.org by default (they can switch back if they want)
defaults.set("PostImages", forKey: Settings.imageHostingProvider.key)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking more about this. I don’t think we should forcibly move people over if they’ve manually chosen imgur. I do like changing the default for when nothing has been chosen.

if we still want to give a little push for people who intentionally chose imgur, maybe a one time alert somewhere suggesting the change and offering to make it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants