-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix links looking like lemmy links being used as one #1048
Conversation
# Conflicts: # app/src/main/java/com/jerboa/MainActivity.kt # app/src/main/java/com/jerboa/ui/components/post/PostListing.kt # app/src/main/java/com/jerboa/ui/components/settings/about/AboutActivity.kt
@@ -24,6 +24,8 @@ const val DEFAULT_INSTANCE = "lemmy.ml" | |||
const val MINIMUM_API_VERSION: String = "0.18" | |||
val REDACTED_QUERY_PARAMS = setOf("auth") | |||
val REDACTED_BODY_FIELDS = setOf("jwt", "password") | |||
val TEMP_RECOGNISED_AS_LEMMY_INSTANCES = mutableSetOf<String>() | |||
val TEMP_NOT_RECOGNISED_AS_LEMMY_INSTANCES = mutableSetOf<String>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are these getting filled? Should you just use the hardcoded DEFAULT_INSTANCES
?
Globals should probably go inside the singleton if you really need them, but I don't see why you do, because DEFAULT_INSTANCES
already exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are getting filled from checkIfLemmyInstance, it caches the hosts. Not sure where I should put them. Which singleton do you mean? I don't want to update DEFAULT_INSTANCES for several reasons, first its not mutable, so updating would incur a much higher cost. And making it mutable would make it unstable for composable use. Secondly I would still need a temp_not_recongized list to cache the hosts not recognized as lemmy instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine I spose. The API's companion object is a singleton, and you could use it to store these temp lists, but that's up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it and checkIfLemmyInstance to the singleton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work, I'll let @twizmwazin look over before a merge.
@@ -24,6 +24,8 @@ const val DEFAULT_INSTANCE = "lemmy.ml" | |||
const val MINIMUM_API_VERSION: String = "0.18" | |||
val REDACTED_QUERY_PARAMS = setOf("auth") | |||
val REDACTED_BODY_FIELDS = setOf("jwt", "password") | |||
val TEMP_RECOGNISED_AS_LEMMY_INSTANCES = mutableSetOf<String>() | |||
val TEMP_NOT_RECOGNISED_AS_LEMMY_INSTANCES = mutableSetOf<String>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine I spose. The API's companion object is a singleton, and you could use it to store these temp lists, but that's up to you.
# Conflicts: # app/src/main/java/com/jerboa/ui/components/post/PostListing.kt
basically what would happen is:

at openLink receives
-> https://lemmy.one/c/technology@beehaw.org
Transformed and navigated to
-> lemmy.one/c/technology@beehaw.org
-> instance/c/community@otherinstance
by logic in navhost turned into
-> community@otherinstance@instance
due to {instance}/c/{name} -> {name}@{instance}
Shows the fix, this would previously show only errors
rC5OPRqCT1.mp4
Fully Fixes #1020
This link was previously thought as a community by Jerboa, (and crashed before my other fix)
8ge8yVQqGC.mp4