mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-08-31 01:20:30 +00:00
Merge commit from fork
Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com>
This commit is contained in:
@@ -20,9 +20,10 @@ pub async fn fetch(
|
|||||||
) -> Result<Json<v0::Message>> {
|
) -> Result<Json<v0::Message>> {
|
||||||
let channel = target.as_channel(db).await?;
|
let channel = target.as_channel(db).await?;
|
||||||
let mut query = DatabasePermissionQuery::new(db, &user).channel(&channel);
|
let mut query = DatabasePermissionQuery::new(db, &user).channel(&channel);
|
||||||
calculate_channel_permissions(&mut query)
|
let perms = calculate_channel_permissions(&mut query).await;
|
||||||
.await
|
|
||||||
.throw_if_lacking_channel_permission(ChannelPermission::ViewChannel)?;
|
perms.throw_if_lacking_channel_permission(ChannelPermission::ViewChannel)?;
|
||||||
|
perms.throw_if_lacking_channel_permission(ChannelPermission::ReadMessageHistory)?;
|
||||||
|
|
||||||
let message = msg.as_message(db).await?;
|
let message = msg.as_message(db).await?;
|
||||||
if message.channel != channel.id() {
|
if message.channel != channel.id() {
|
||||||
|
|||||||
Reference in New Issue
Block a user