]> Untitled Git - lemmy.git/blobdiff - crates/api_common/src/person.rs
Tag posts and comments with language (fixes #440) (#2269)
[lemmy.git] / crates / api_common / src / person.rs
index a910232565a59fb556884479ff217e0a8ec691bd..79e3041d8e8c8ab8ca0147b2bb52b6ae0eab442e 100644 (file)
@@ -1,6 +1,11 @@
 use crate::sensitive::Sensitive;
 use lemmy_db_views::structs::{CommentView, PostView, PrivateMessageView};
-use lemmy_db_views_actor::structs::{CommunityModeratorView, PersonMentionView, PersonViewSafe};
+use lemmy_db_views_actor::structs::{
+  CommentReplyView,
+  CommunityModeratorView,
+  PersonMentionView,
+  PersonViewSafe,
+};
 use serde::{Deserialize, Serialize};
 
 #[derive(Debug, Serialize, Deserialize, Clone, Default)]
@@ -9,7 +14,15 @@ pub struct Login {
   pub password: Sensitive<String>,
 }
 use lemmy_db_schema::{
-  newtypes::{CommunityId, PersonId, PersonMentionId, PrivateMessageId},
+  newtypes::{
+    CommentReplyId,
+    CommunityId,
+    LanguageId,
+    PersonId,
+    PersonMentionId,
+    PrivateMessageId,
+  },
+  CommentSortType,
   SortType,
 };
 
@@ -50,7 +63,7 @@ pub struct SaveUserSettings {
   pub theme: Option<String>,
   pub default_sort_type: Option<i16>,
   pub default_listing_type: Option<i16>,
-  pub lang: Option<String>,
+  pub interface_language: Option<String>,
   pub avatar: Option<String>,
   pub banner: Option<String>,
   pub display_name: Option<String>,
@@ -63,6 +76,7 @@ pub struct SaveUserSettings {
   pub show_bot_accounts: Option<bool>,
   pub show_read_posts: Option<bool>,
   pub show_new_post_notifs: Option<bool>,
+  pub discussion_languages: Option<Vec<LanguageId>>,
   pub auth: Sensitive<String>,
 }
 
@@ -105,7 +119,7 @@ pub struct GetPersonDetailsResponse {
 
 #[derive(Debug, Serialize, Deserialize, Clone, Default)]
 pub struct GetRepliesResponse {
-  pub replies: Vec<CommentView>,
+  pub replies: Vec<CommentReplyView>,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
@@ -171,7 +185,7 @@ pub struct BlockPersonResponse {
 
 #[derive(Debug, Serialize, Deserialize, Clone, Default)]
 pub struct GetReplies {
-  pub sort: Option<SortType>,
+  pub sort: Option<CommentSortType>,
   pub page: Option<i64>,
   pub limit: Option<i64>,
   pub unread_only: Option<bool>,
@@ -180,7 +194,7 @@ pub struct GetReplies {
 
 #[derive(Debug, Serialize, Deserialize, Clone, Default)]
 pub struct GetPersonMentions {
-  pub sort: Option<SortType>,
+  pub sort: Option<CommentSortType>,
   pub page: Option<i64>,
   pub limit: Option<i64>,
   pub unread_only: Option<bool>,
@@ -199,6 +213,18 @@ pub struct PersonMentionResponse {
   pub person_mention_view: PersonMentionView,
 }
 
+#[derive(Debug, Serialize, Deserialize, Clone, Default)]
+pub struct MarkCommentReplyAsRead {
+  pub comment_reply_id: CommentReplyId,
+  pub read: bool,
+  pub auth: Sensitive<String>,
+}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub struct CommentReplyResponse {
+  pub comment_reply_view: CommentReplyView,
+}
+
 #[derive(Debug, Serialize, Deserialize, Clone, Default)]
 pub struct DeleteAccount {
   pub password: Sensitive<String>,