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