Merge remote-tracking branch 'origin/main' into ap07
This commit is contained in:
@@ -12,14 +12,14 @@ itertools = "0.10.3"
|
||||
lazy_static = "1.0"
|
||||
ldap3 = "0.10.4"
|
||||
migrations_internals= "1.4.0"
|
||||
openssl = "0.10.22"
|
||||
openssl = "0.10.40"
|
||||
rocket = "0.4.6"
|
||||
rocket_i18n = "0.4.1"
|
||||
reqwest = "0.11.10"
|
||||
scheduled-thread-pool = "0.2.2"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0.80"
|
||||
serde_json = "1.0.81"
|
||||
tantivy = "0.13.3"
|
||||
url = "2.1"
|
||||
walkdir = "2.2"
|
||||
|
||||
@@ -6,6 +6,7 @@ use crate::{
|
||||
Connection, Error, Result,
|
||||
};
|
||||
use diesel::{self, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl};
|
||||
use std::cmp::Ordering;
|
||||
use std::ops::Deref;
|
||||
|
||||
pub(crate) mod query;
|
||||
@@ -85,6 +86,16 @@ impl Timeline {
|
||||
.or(timeline_definition::user_id.is_null()),
|
||||
)
|
||||
.load::<Self>(conn)
|
||||
.map(|mut timelines| {
|
||||
timelines.sort_by(|t1, t2| {
|
||||
if t1.user_id.is_some() && t2.user_id.is_none() {
|
||||
Ordering::Less
|
||||
} else {
|
||||
Ordering::Equal
|
||||
}
|
||||
});
|
||||
timelines
|
||||
})
|
||||
.map_err(Error::from)
|
||||
} else {
|
||||
timeline_definition::table
|
||||
|
||||
Reference in New Issue
Block a user