Skip to content
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

Adding registration applications queue. #1339

Merged
merged 23 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f4fe8c3
Starting to work on registration applications.
dessalines Jan 30, 2024
35d4132
Remove ImmutableList and add stability config file (#1342)
MV-GH Feb 5, 2024
42d37e8
Adding admin / mod view votes. (#1331)
dessalines Feb 5, 2024
fb11307
Temp workaround for compose-settings height bug. (#1345)
dessalines Feb 5, 2024
d71f554
Swipe post/comment to upvote/downvote/reply/save (#1327)
Snow4DV Feb 5, 2024
455d1f9
Almost finished viewmodel.
dessalines Feb 5, 2024
6dfc40c
Merge branch 'main' into registration_apps
dessalines Feb 6, 2024
974c6a0
A few more additions.
dessalines Feb 7, 2024
592701b
Finishing up registration applications.
dessalines Feb 7, 2024
478c7f9
Adding a locally generated changelog.
dessalines Feb 8, 2024
f074a93
Removing 27 schema
dessalines Feb 8, 2024
9708b5d
Removing 27 schema 2
dessalines Feb 8, 2024
247b6f9
Moving changelog fetching to viewModel.
dessalines Feb 9, 2024
bbb6b1b
Merge branch 'changelog_local' into registration_apps
dessalines Feb 9, 2024
04629f1
Persisting admin and mod status to DB.
dessalines Feb 9, 2024
9b65730
Fixing format.
dessalines Feb 9, 2024
f37266c
Merge remote-tracking branch 'origin/main' into registration_apps
dessalines Feb 9, 2024
249cc06
Removing weird changes.
dessalines Feb 9, 2024
091fdd0
Merge remote-tracking branch 'origin/main' into registration_apps
dessalines Feb 12, 2024
394e3cd
Don't display bottomNav until acc loads
MV-GH Feb 12, 2024
5aa44e6
Fix formatting
MV-GH Feb 12, 2024
16150ab
Fix swapToAnon invalidating jwt + fix navbar not showing for anon
MV-GH Feb 12, 2024
3de467f
Merge branch 'main' into registration_apps
dessalines Feb 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ dependencies {
implementation("androidx.profileinstaller:profileinstaller:1.3.1")
baselineProfile(project(":benchmarks"))

implementation("it.vercruysse.lemmyapi:lemmy-api:0.2.8-SNAPSHOT")
implementation("it.vercruysse.lemmyapi:lemmy-api:0.2.9-SNAPSHOT")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
// Ktor uses SLF4J
implementation("org.slf4j:slf4j-api:2.0.11")
Expand Down
279 changes: 279 additions & 0 deletions app/schemas/com.jerboa.db.AppDB/29.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
{
"formatVersion": 1,
"database": {
"version": 29,
"identityHash": "731bf955d6f87beffb10a163f0070c90",
"entities": [
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `current` INTEGER NOT NULL, `instance` TEXT NOT NULL, `name` TEXT NOT NULL, `jwt` TEXT NOT NULL, `default_listing_type` INTEGER NOT NULL DEFAULT 0, `default_sort_type` INTEGER NOT NULL DEFAULT 0, `verification_state` INTEGER NOT NULL DEFAULT 0, `is_admin` INTEGER NOT NULL, `is_mod` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "current",
"columnName": "current",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "instance",
"columnName": "instance",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "jwt",
"columnName": "jwt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "defaultListingType",
"columnName": "default_listing_type",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "defaultSortType",
"columnName": "default_sort_type",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "verificationState",
"columnName": "verification_state",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "isAdmin",
"columnName": "is_admin",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isMod",
"columnName": "is_mod",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "AppSettings",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `font_size` INTEGER NOT NULL DEFAULT 16, `theme` INTEGER NOT NULL DEFAULT 0, `theme_color` INTEGER NOT NULL DEFAULT 0, `viewed_changelog` INTEGER NOT NULL DEFAULT 0, `post_view_mode` INTEGER NOT NULL DEFAULT 0, `show_bottom_nav` INTEGER NOT NULL DEFAULT 1, `post_navigation_gesture_mode` INTEGER NOT NULL DEFAULT 0, `show_collapsed_comment_content` INTEGER NOT NULL DEFAULT 0, `show_comment_action_bar_by_default` INTEGER NOT NULL DEFAULT 1, `show_voting_arrows_in_list_view` INTEGER NOT NULL DEFAULT 1, `show_parent_comment_navigation_buttons` INTEGER NOT NULL DEFAULT 0, `navigate_parent_comments_with_volume_buttons` INTEGER NOT NULL DEFAULT 0, `use_custom_tabs` INTEGER NOT NULL DEFAULT 1, `use_private_tabs` INTEGER NOT NULL DEFAULT 0, `secure_window` INTEGER NOT NULL DEFAULT 0, `blur_nsfw` INTEGER NOT NULL DEFAULT 1, `show_text_descriptions_in_navbar` INTEGER NOT NULL DEFAULT 1, `markAsReadOnScroll` INTEGER NOT NULL DEFAULT 0, `backConfirmationMode` INTEGER NOT NULL DEFAULT 1, `show_post_link_previews` INTEGER NOT NULL DEFAULT 1, `post_actionbar_mode` INTEGER NOT NULL DEFAULT 0, `auto_play_gifs` INTEGER NOT NULL DEFAULT 0, `swipe_to_action_preset` INTEGER NOT NULL DEFAULT 1, `last_version_code_viewed` INTEGER NOT NULL DEFAULT 0)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "fontSize",
"columnName": "font_size",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "16"
},
{
"fieldPath": "theme",
"columnName": "theme",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "themeColor",
"columnName": "theme_color",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "viewedChangelog",
"columnName": "viewed_changelog",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "postViewMode",
"columnName": "post_view_mode",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "showBottomNav",
"columnName": "show_bottom_nav",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "postNavigationGestureMode",
"columnName": "post_navigation_gesture_mode",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "showCollapsedCommentContent",
"columnName": "show_collapsed_comment_content",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "showCommentActionBarByDefault",
"columnName": "show_comment_action_bar_by_default",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "showVotingArrowsInListView",
"columnName": "show_voting_arrows_in_list_view",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "showParentCommentNavigationButtons",
"columnName": "show_parent_comment_navigation_buttons",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "navigateParentCommentsWithVolumeButtons",
"columnName": "navigate_parent_comments_with_volume_buttons",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "useCustomTabs",
"columnName": "use_custom_tabs",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "usePrivateTabs",
"columnName": "use_private_tabs",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "secureWindow",
"columnName": "secure_window",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "blurNSFW",
"columnName": "blur_nsfw",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "showTextDescriptionsInNavbar",
"columnName": "show_text_descriptions_in_navbar",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "markAsReadOnScroll",
"columnName": "markAsReadOnScroll",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "backConfirmationMode",
"columnName": "backConfirmationMode",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "showPostLinkPreviews",
"columnName": "show_post_link_previews",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "postActionbarMode",
"columnName": "post_actionbar_mode",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "autoPlayGifs",
"columnName": "auto_play_gifs",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
},
{
"fieldPath": "swipeToActionPreset",
"columnName": "swipe_to_action_preset",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "1"
},
{
"fieldPath": "lastVersionCodeViewed",
"columnName": "last_version_code_viewed",
"affinity": "INTEGER",
"notNull": true,
"defaultValue": "0"
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"id"
]
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '731bf955d6f87beffb10a163f0070c90')"
]
}
}
12 changes: 12 additions & 0 deletions app/src/main/java/com/jerboa/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import com.jerboa.ui.components.post.create.CreatePostActivity
import com.jerboa.ui.components.post.edit.PostEditActivity
import com.jerboa.ui.components.privatemessage.CreatePrivateMessageActivity
import com.jerboa.ui.components.privatemessage.PrivateMessageReplyActivity
import com.jerboa.ui.components.registrationapplications.RegistrationApplicationsActivity
import com.jerboa.ui.components.remove.comment.CommentRemoveActivity
import com.jerboa.ui.components.remove.post.PostRemoveActivity
import com.jerboa.ui.components.report.comment.CreateCommentReportActivity
Expand Down Expand Up @@ -438,6 +439,17 @@ class MainActivity : AppCompatActivity() {
)
}

composable(
route = Route.REGISTRATION_APPLICATIONS,
) {
RegistrationApplicationsActivity(
appState = appState,
accountViewModel = accountViewModel,
siteViewModel = siteViewModel,
drawerState = drawerState,
)
}

composable(
route = Route.POST,
deepLinks =
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/java/com/jerboa/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,23 @@ fun findAndUpdatePrivateMessage(
}
}

fun findAndUpdateApplication(
applications: List<RegistrationApplicationView>,
updatedApplication: RegistrationApplicationView,
): List<RegistrationApplicationView> {
val foundIndex =
applications.indexOfFirst {
it.registration_application.id == updatedApplication.registration_application.id
}
return if (foundIndex != -1) {
val mutable = applications.toMutableList()
mutable[foundIndex] = updatedApplication
mutable.toList()
} else {
applications
}
}

fun showBlockPersonToast(
blockPersonRes: ApiState<BlockPersonResponse>,
ctx: Context,
Expand Down
Loading