chore: migrate all local dependancies to workspace dependancies (#710)
* chore: start moving all deps to workspace deps
Signed-off-by: Zomatree <me@zomatree.live>
* chore: migrate all deps to workspace deps
Signed-off-by: Zomatree <me@zomatree.live>
* chore: add more dep groups
Signed-off-by: Zomatree <me@zomatree.live>
* fix: add migration to update existing files to be animated (#705)
* fix: add migration to update existing files to be animated
Signed-off-by: Zomatree <me@zomatree.live>
* Revert "fix: add migration to update existing files to be animated"
This reverts commit 4e1f1c116c.
Signed-off-by: Zomatree <me@zomatree.live>
* fix: calculate animated for existing files when fetched
Signed-off-by: Zomatree <me@zomatree.live>
---------
Signed-off-by: Zomatree <me@zomatree.live>
* fix: mise start + missing docker image (#564)
* fix: mise start + missing docker image
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
* fix: bump livekit version
Signed-off-by: Damocles <106018783+Damocles078@users.noreply.github.com>
---------
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
Signed-off-by: Tom <iamtomahawkx@gmail.com>
Signed-off-by: Damocles <106018783+Damocles078@users.noreply.github.com>
Co-authored-by: Tom <iamtomahawkx@gmail.com>
* docs: update donation link (#709)
Signed-off-by: Zomatree <me@zomatree.live>
* fix: remove usage of deprecated functions
Signed-off-by: Zomatree <me@zomatree.live>
---------
Signed-off-by: Zomatree <me@zomatree.live>
Signed-off-by: Damocles078 <hellodamocles078@gmail.com>
Signed-off-by: Tom <iamtomahawkx@gmail.com>
Signed-off-by: Damocles <106018783+Damocles078@users.noreply.github.com>
Co-authored-by: Damocles <106018783+Damocles078@users.noreply.github.com>
Co-authored-by: Tom <iamtomahawkx@gmail.com>
Co-authored-by: Paul Makles <me@insrt.uk>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use chrono::Utc;
|
||||
use std::time::Duration;
|
||||
|
||||
use revolt_database::{
|
||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||
Database, Message, User,
|
||||
@@ -36,10 +37,9 @@ pub async fn bulk_delete_messages(
|
||||
if ulid::Ulid::from_string(id)
|
||||
.map_err(|_| create_error!(InvalidOperation))?
|
||||
.datetime()
|
||||
.signed_duration_since(Utc::now())
|
||||
.num_days()
|
||||
.abs()
|
||||
> 7
|
||||
.elapsed()
|
||||
.expect("Time went backwards")
|
||||
> Duration::from_hours(7 * 24) // 7 days
|
||||
{
|
||||
return Err(create_error!(InvalidOperation));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use chrono::{Duration, Utc};
|
||||
use std::time::Duration;
|
||||
|
||||
use redis_kiss::{get_connection, redis, AsyncCommands};
|
||||
use revolt_database::util::permissions::DatabasePermissionQuery;
|
||||
use revolt_database::{
|
||||
@@ -111,8 +112,12 @@ 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 {
|
||||
(Utc::now() - ulid::Ulid::from_string(&user.id).unwrap().datetime())
|
||||
>= Duration::hours(12)
|
||||
(ulid::Ulid::from_string(&user.id)
|
||||
.unwrap()
|
||||
.datetime()
|
||||
.elapsed()
|
||||
.expect("Time went backwards"))
|
||||
>= Duration::from_hours(12)
|
||||
} else {
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user