reverse iterator funk
This commit is contained in:
@@ -189,10 +189,7 @@ impl Media {
|
|||||||
original_prefix.extend_from_slice(&0_u32.to_be_bytes()); // Height = 0 if it's not a thumbnail
|
original_prefix.extend_from_slice(&0_u32.to_be_bytes()); // Height = 0 if it's not a thumbnail
|
||||||
original_prefix.push(0xff);
|
original_prefix.push(0xff);
|
||||||
|
|
||||||
if let Some((key, _)) = {
|
if let Some((key, _)) = self.mediaid_file.scan_prefix(thumbnail_prefix).next() {
|
||||||
/* scoped to explicitly drop iterator */
|
|
||||||
self.mediaid_file.scan_prefix(thumbnail_prefix).next()
|
|
||||||
} {
|
|
||||||
// Using saved thumbnail
|
// Using saved thumbnail
|
||||||
let path = globals.get_media_file(&key);
|
let path = globals.get_media_file(&key);
|
||||||
let mut file = Vec::new();
|
let mut file = Vec::new();
|
||||||
@@ -227,10 +224,7 @@ impl Media {
|
|||||||
content_type,
|
content_type,
|
||||||
file: file.to_vec(),
|
file: file.to_vec(),
|
||||||
}))
|
}))
|
||||||
} else if let Some((key, _)) = {
|
} else if let Some((key, _)) = self.mediaid_file.scan_prefix(original_prefix).next() {
|
||||||
/* scoped to explicitly drop iterator */
|
|
||||||
self.mediaid_file.scan_prefix(original_prefix).next()
|
|
||||||
} {
|
|
||||||
// Generate a thumbnail
|
// Generate a thumbnail
|
||||||
let path = globals.get_media_file(&key);
|
let path = globals.get_media_file(&key);
|
||||||
let mut file = Vec::new();
|
let mut file = Vec::new();
|
||||||
|
|||||||
@@ -733,8 +733,6 @@ impl Rooms {
|
|||||||
.filter(|user_id| user_id.server_name() == db.globals.server_name())
|
.filter(|user_id| user_id.server_name() == db.globals.server_name())
|
||||||
.filter(|user_id| !db.users.is_deactivated(user_id).unwrap_or(false))
|
.filter(|user_id| !db.users.is_deactivated(user_id).unwrap_or(false))
|
||||||
.filter(|user_id| self.is_joined(&user_id, &pdu.room_id).unwrap_or(false))
|
.filter(|user_id| self.is_joined(&user_id, &pdu.room_id).unwrap_or(false))
|
||||||
.collect::<Vec<_>>()
|
|
||||||
/* to consume iterator */
|
|
||||||
{
|
{
|
||||||
// Don't notify the user of their own events
|
// Don't notify the user of their own events
|
||||||
if user == pdu.sender {
|
if user == pdu.sender {
|
||||||
|
|||||||
Reference in New Issue
Block a user