forked from jmug/stoatchat
Database: Add user settings sync entity.
Run cargo fmt.
This commit is contained in:
@@ -111,7 +111,10 @@ pub async fn req(user: User, target: Ref, data: Json<Data>) -> Result<()> {
|
||||
Message::create(
|
||||
"00000000000000000000000000".to_string(),
|
||||
id.clone(),
|
||||
Content::SystemMessage(SystemMessage::ChannelRenamed { name, by: user.id.clone() }),
|
||||
Content::SystemMessage(SystemMessage::ChannelRenamed {
|
||||
name,
|
||||
by: user.id.clone(),
|
||||
}),
|
||||
)
|
||||
.publish(&target)
|
||||
.await
|
||||
@@ -122,7 +125,9 @@ pub async fn req(user: User, target: Ref, data: Json<Data>) -> Result<()> {
|
||||
Message::create(
|
||||
"00000000000000000000000000".to_string(),
|
||||
id.clone(),
|
||||
Content::SystemMessage(SystemMessage::ChannelDescriptionChanged { by: user.id.clone() }),
|
||||
Content::SystemMessage(SystemMessage::ChannelDescriptionChanged {
|
||||
by: user.id.clone(),
|
||||
}),
|
||||
)
|
||||
.publish(&target)
|
||||
.await
|
||||
|
||||
@@ -28,7 +28,7 @@ pub struct Options {
|
||||
#[validate(length(min = 26, max = 26))]
|
||||
after: Option<String>,
|
||||
sort: Option<Sort>,
|
||||
include_users: Option<bool>
|
||||
include_users: Option<bool>,
|
||||
}
|
||||
|
||||
#[get("/<target>/messages?<options..>")]
|
||||
|
||||
@@ -59,7 +59,9 @@ pub async fn req(user: User, target: Ref, message: Json<Data>) -> Result<JsonVal
|
||||
|
||||
let id = Ulid::new().to_string();
|
||||
let attachments = if let Some(attachment_id) = &message.attachment {
|
||||
Some(vec![ File::find_and_use(attachment_id, "attachments", "message", &id).await? ])
|
||||
Some(vec![
|
||||
File::find_and_use(attachment_id, "attachments", "message", &id).await?,
|
||||
])
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user