add: allow users to block users who have blocked them/private users
fix: anonymous post page panic add: allow users to select home timeline
This commit is contained in:
parent
2460e2f8c5
commit
d42375441f
15 changed files with 313 additions and 122 deletions
|
@ -50,6 +50,40 @@ impl Default for ThemePreference {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum DefaultTimelineChoice {
|
||||
MyCommunities,
|
||||
MyCommunitiesQuestions,
|
||||
PopularPosts,
|
||||
PopularQuestions,
|
||||
FollowingPosts,
|
||||
FollowingQuestions,
|
||||
AllPosts,
|
||||
AllQuestions,
|
||||
}
|
||||
|
||||
impl Default for DefaultTimelineChoice {
|
||||
fn default() -> Self {
|
||||
Self::MyCommunities
|
||||
}
|
||||
}
|
||||
|
||||
impl DefaultTimelineChoice {
|
||||
/// Get the relative URL that the timeline should bring you to.
|
||||
pub fn relative_url(&self) -> &str {
|
||||
match &self {
|
||||
Self::MyCommunities => "/",
|
||||
Self::MyCommunitiesQuestions => "/questions",
|
||||
Self::PopularPosts => "/popular",
|
||||
Self::PopularQuestions => "/popular/questions",
|
||||
Self::FollowingPosts => "/following",
|
||||
Self::FollowingQuestions => "/following/questions",
|
||||
Self::AllPosts => "/all",
|
||||
Self::AllQuestions => "/all/questions",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, Default)]
|
||||
pub struct UserSettings {
|
||||
#[serde(default)]
|
||||
|
@ -148,6 +182,9 @@ pub struct UserSettings {
|
|||
/// If dislikes are hidden for the user.
|
||||
#[serde(default)]
|
||||
pub hide_dislikes: bool,
|
||||
/// The timeline that the "Home" button takes you to
|
||||
#[serde(default)]
|
||||
pub default_timeline: DefaultTimelineChoice,
|
||||
}
|
||||
|
||||
impl Default for User {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue