feat: add optional mood to thoughts with custom moods support
Mood is an optional label+emoji string (e.g. "relaxed 😌") on thoughts.
Users can define up to 8 custom moods in profile settings.
Mood federates via AP Note JSON and displays on thought cards.
This commit is contained in:
@@ -22,6 +22,7 @@ pub struct Thought {
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: Option<DateTime<Utc>>,
|
||||
pub note_extensions: Option<serde_json::Value>,
|
||||
pub mood: Option<String>,
|
||||
}
|
||||
|
||||
impl Visibility {
|
||||
@@ -55,6 +56,7 @@ pub struct NewThought {
|
||||
pub visibility: Visibility,
|
||||
pub content_warning: Option<String>,
|
||||
pub sensitive: bool,
|
||||
pub mood: Option<String>,
|
||||
}
|
||||
|
||||
impl Thought {
|
||||
@@ -71,6 +73,7 @@ impl Thought {
|
||||
created_at: Utc::now(),
|
||||
updated_at: None,
|
||||
note_extensions: None,
|
||||
mood: p.mood,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ pub struct UpdateProfileInput {
|
||||
pub header_url: Option<String>,
|
||||
pub custom_css: Option<String>,
|
||||
pub profile_fields: Option<Vec<(String, String)>>,
|
||||
pub custom_moods: Option<Vec<(String, String)>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -23,6 +24,7 @@ pub struct User {
|
||||
pub header_url: Option<String>,
|
||||
pub custom_css: Option<String>,
|
||||
pub profile_fields: Vec<(String, String)>,
|
||||
pub custom_moods: Vec<(String, String)>,
|
||||
pub local: bool,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
@@ -47,6 +49,7 @@ impl User {
|
||||
header_url: None,
|
||||
custom_css: None,
|
||||
profile_fields: vec![],
|
||||
custom_moods: vec![],
|
||||
local: true,
|
||||
created_at: now,
|
||||
updated_at: now,
|
||||
@@ -66,6 +69,7 @@ impl User {
|
||||
header_url: None,
|
||||
custom_css: None,
|
||||
profile_fields: vec![],
|
||||
custom_moods: vec![],
|
||||
local: false,
|
||||
created_at: now,
|
||||
updated_at: now,
|
||||
|
||||
Reference in New Issue
Block a user