cargo fmt

This commit is contained in:
Mike Dilger 2023-10-22 09:28:48 +13:00
parent f62a125171
commit 1e5300c0f7
4 changed files with 16 additions and 8 deletions

View File

@ -3,11 +3,13 @@ use crate::AVATAR_SIZE_F32;
use eframe::egui;
use egui::{Context, Image, RichText, Sense, Ui, Vec2};
use gossip_lib::comms::ToOverlordMessage;
use gossip_lib::{GLOBALS, Person, PersonList};
use gossip_lib::{Person, PersonList, GLOBALS};
use std::sync::atomic::Ordering;
pub(super) fn update(app: &mut GossipUi, ctx: &Context, _frame: &mut eframe::Frame, ui: &mut Ui) {
let followed_pubkeys = GLOBALS.storage.get_people_in_list(PersonList::Followed, None)
let followed_pubkeys = GLOBALS
.storage
.get_people_in_list(PersonList::Followed, None)
.unwrap_or(vec![]);
let mut people: Vec<Person> = Vec::new();
for pk in &followed_pubkeys {

View File

@ -3,11 +3,13 @@ use crate::AVATAR_SIZE_F32;
use eframe::egui;
use egui::{Context, Image, RichText, Sense, Ui, Vec2};
use gossip_lib::comms::ToOverlordMessage;
use gossip_lib::{GLOBALS, Person, PersonList};
use gossip_lib::{Person, PersonList, GLOBALS};
use std::sync::atomic::Ordering;
pub(super) fn update(app: &mut GossipUi, ctx: &Context, _frame: &mut eframe::Frame, ui: &mut Ui) {
let muted_pubkeys = GLOBALS.storage.get_people_in_list(PersonList::Muted, None)
let muted_pubkeys = GLOBALS
.storage
.get_people_in_list(PersonList::Muted, None)
.unwrap_or(vec![]);
let mut people: Vec<Person> = Vec::new();

View File

@ -1,4 +1,4 @@
use gossip_lib::{GLOBALS, PersonList, Relay};
use gossip_lib::{PersonList, Relay, GLOBALS};
use nostr_types::{Event, EventKind, PublicKey, RelayUrl};
use std::collections::HashSet;
@ -79,7 +79,9 @@ impl WizardState {
.unwrap_or(Vec::new());
}
self.followed = GLOBALS.storage.get_people_in_list(PersonList::Followed, None)
self.followed = GLOBALS
.storage
.get_people_in_list(PersonList::Followed, None)
.unwrap_or(vec![]);
if self.need_discovery_relays() {

View File

@ -64,8 +64,10 @@ pub async fn process_new_event(
}
// Spam filter (displayable and author is not followed)
if event.effective_kind().is_feed_displayable() &&
!GLOBALS.people.is_person_in_list(&event.pubkey, PersonList::Followed)
if event.effective_kind().is_feed_displayable()
&& !GLOBALS
.people
.is_person_in_list(&event.pubkey, PersonList::Followed)
{
let author = GLOBALS.storage.read_person(&event.pubkey)?;
match crate::filter::filter(event.clone(), author) {