forked from jmug/stoatchat
chore: clippy recommendations
This commit is contained in:
@@ -111,7 +111,7 @@ pub async fn calculate_channel_permissions<P: PermissionQuery>(query: &mut P) ->
|
||||
query.set_server_from_channel().await;
|
||||
|
||||
if query.are_we_server_owner().await {
|
||||
return ChannelPermission::GrantAllSafe.into();
|
||||
ChannelPermission::GrantAllSafe.into()
|
||||
} else if query.are_we_a_member().await {
|
||||
let mut permissions = calculate_server_permissions(query).await;
|
||||
permissions.apply(query.get_default_channel_permissions().await);
|
||||
|
||||
@@ -65,13 +65,8 @@ pub async fn message_send(
|
||||
// Disallow mentions for new users (TRUST-0: <12 hours age) in public servers
|
||||
let allow_mentions = if let Some(server) = query.server_ref() {
|
||||
if server.discoverable {
|
||||
if (Utc::now() - ulid::Ulid::from_string(&user.id).unwrap().datetime())
|
||||
< Duration::hours(12)
|
||||
{
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
(Utc::now() - ulid::Ulid::from_string(&user.id).unwrap().datetime())
|
||||
>= Duration::hours(12)
|
||||
} else {
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user