diff --git a/src/database/entities/user.rs b/src/database/entities/user.rs index c4d199d2..7c2a68b4 100644 --- a/src/database/entities/user.rs +++ b/src/database/entities/user.rs @@ -67,6 +67,7 @@ pub enum Badges { Translator = 2, Supporter = 4, ResponsibleDisclosure = 8, + RevoltTeam = 16, EarlyAdopter = 256, } diff --git a/src/routes/channels/message_query.rs b/src/routes/channels/message_query.rs index 672701b9..da58526e 100644 --- a/src/routes/channels/message_query.rs +++ b/src/routes/channels/message_query.rs @@ -59,7 +59,7 @@ pub async fn req(user: User, target: Ref, options: Form) -> Result) -> Result(doc).map_err(|_| Error::DatabaseError { - operation: "from_document", - with: "message", - })?, - ); - } + while let Some(result) = cursors.0.next().await { + if let Ok(doc) = result { + messages.push( + from_document::(doc).map_err(|_| Error::DatabaseError { + operation: "from_document", + with: "message", + })?, + ); + } + } + + while let Some(result) = cursors.1.next().await { + if let Ok(doc) = result { + messages.push( + from_document::(doc).map_err(|_| Error::DatabaseError { + operation: "from_document", + with: "message", + })?, + ); } } } else {