Skip to content
Snippets Groups Projects
Unverified Commit cf1c32d2 authored by SleeplessOne1917's avatar SleeplessOne1917 Committed by GitHub
Browse files

Enable animated avatars setting (#4040)


* feat: Add user setting for toggling avatar gif animations

* Add forgotten post listing mode option to settings form

* Fix compilation error

* Fix formatting

* Change name of column to be more general purpose

* Fix sql format.

* Fix comments

* Running format.

---------

Co-authored-by: default avatarDessalines <tyhou13@gmx.com>
Co-authored-by: default avatarDessalines <dessalines@users.noreply.github.com>
parent 56322c75
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,9 @@ pub async fn save_user_settings(
interface_language: data.interface_language.clone(),
open_links_in_new_tab: data.open_links_in_new_tab,
infinite_scroll_enabled: data.infinite_scroll_enabled,
post_listing_mode: data.post_listing_mode,
enable_keyboard_navigation: data.enable_keyboard_navigation,
enable_animated_images: data.enable_animated_images,
..Default::default()
};
......
......@@ -3,6 +3,7 @@ use lemmy_db_schema::{
newtypes::{CommentReplyId, CommunityId, LanguageId, PersonId, PersonMentionId},
CommentSortType,
ListingType,
PostListingMode,
SortType,
};
use lemmy_db_views::structs::{CommentView, PostView};
......@@ -123,8 +124,11 @@ pub struct SaveUserSettings {
pub open_links_in_new_tab: Option<bool>,
/// Enable infinite scroll
pub infinite_scroll_enabled: Option<bool>,
pub post_listing_mode: Option<PostListingMode>,
/// Whether to allow keyboard navigation (for browsing and interacting with posts and comments).
pub enable_keyboard_navigation: Option<bool>,
/// Whether user avatars or inline images in the UI that are gifs should be allowed to play or should be paused
pub enable_animated_images: Option<bool>,
}
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
......
......@@ -444,6 +444,7 @@ diesel::table! {
post_listing_mode -> PostListingModeEnum,
totp_2fa_enabled -> Bool,
enable_keyboard_navigation -> Bool,
enable_animated_images -> Bool,
}
}
......
......@@ -58,6 +58,8 @@ pub struct LocalUser {
pub totp_2fa_enabled: bool,
/// Whether to allow keyboard navigation (for browsing and interacting with posts and comments).
pub enable_keyboard_navigation: bool,
/// Whether user avatars and inline images in the UI that are gifs should be allowed to play or should be paused
pub enable_animated_images: bool,
}
#[derive(Clone, TypedBuilder)]
......@@ -91,6 +93,7 @@ pub struct LocalUserInsertForm {
pub post_listing_mode: Option<PostListingMode>,
pub totp_2fa_enabled: Option<bool>,
pub enable_keyboard_navigation: Option<bool>,
pub enable_animated_images: Option<bool>,
}
#[derive(Clone, Default)]
......@@ -120,4 +123,5 @@ pub struct LocalUserUpdateForm {
pub post_listing_mode: Option<PostListingMode>,
pub totp_2fa_enabled: Option<bool>,
pub enable_keyboard_navigation: Option<bool>,
pub enable_animated_images: Option<bool>,
}
......@@ -267,6 +267,7 @@ mod tests {
post_listing_mode: inserted_sara_local_user.post_listing_mode,
totp_2fa_enabled: inserted_sara_local_user.totp_2fa_enabled,
enable_keyboard_navigation: inserted_sara_local_user.enable_keyboard_navigation,
enable_animated_images: inserted_sara_local_user.enable_animated_images,
},
creator: Person {
id: inserted_sara_person.id,
......
Subproject commit e943f97fe481dc425acdebc8872bf1fdcabaf875
Subproject commit d0f3548379e446d2c333e582734bc68f8d684f4d
ALTER TABLE local_user
DROP COLUMN enable_animated_images;
ALTER TABLE local_user
ADD COLUMN enable_animated_images boolean DEFAULT TRUE NOT NULL;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment