mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 13:36:59 +00:00
Temporary fix for compile.
Add badge ID.
This commit is contained in:
@@ -67,6 +67,7 @@ pub enum Badges {
|
||||
Translator = 2,
|
||||
Supporter = 4,
|
||||
ResponsibleDisclosure = 8,
|
||||
RevoltTeam = 16,
|
||||
EarlyAdopter = 256,
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ pub async fn req(user: User, target: Ref, options: Form<Options>) -> Result<Json
|
||||
let limit = options.limit.unwrap_or(50);
|
||||
let channel = target.id();
|
||||
if let Some(nearby) = &options.nearby {
|
||||
let cursors = try_join!(
|
||||
let mut cursors = try_join!(
|
||||
collection.find(
|
||||
doc! {
|
||||
"channel": channel,
|
||||
@@ -94,16 +94,25 @@ pub async fn req(user: User, target: Ref, options: Form<Options>) -> Result<Json
|
||||
with: "messages",
|
||||
})?;
|
||||
|
||||
for mut cursor in [ cursors.0, cursors.1 ] {
|
||||
while let Some(result) = cursor.next().await {
|
||||
if let Ok(doc) = result {
|
||||
messages.push(
|
||||
from_document::<Message>(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::<Message>(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::<Message>(doc).map_err(|_| Error::DatabaseError {
|
||||
operation: "from_document",
|
||||
with: "message",
|
||||
})?,
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user