mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 16:31:18 +00:00
parent
e132b940a1
commit
362e4c51b4
@ -38,17 +38,6 @@ pub async fn process_new_event(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the event is from mostr, ignore it
|
|
||||||
if GLOBALS.settings.read().block_mostr {
|
|
||||||
for etag in event.tags.iter() {
|
|
||||||
if let Tag::Other { tag, .. } = etag {
|
|
||||||
if tag == "mostr" {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save the event into the database
|
// Save the event into the database
|
||||||
if from_relay {
|
if from_relay {
|
||||||
// Convert a nostr Event into a DbEvent
|
// Convert a nostr Event into a DbEvent
|
||||||
|
@ -55,7 +55,6 @@ pub struct Settings {
|
|||||||
pub automatically_fetch_metadata: bool,
|
pub automatically_fetch_metadata: bool,
|
||||||
pub delegatee_tag: String,
|
pub delegatee_tag: String,
|
||||||
pub highlight_unread_events: bool,
|
pub highlight_unread_events: bool,
|
||||||
pub block_mostr: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Settings {
|
impl Default for Settings {
|
||||||
@ -84,7 +83,6 @@ impl Default for Settings {
|
|||||||
automatically_fetch_metadata: DEFAULT_AUTOMATICALLY_FETCH_METADATA,
|
automatically_fetch_metadata: DEFAULT_AUTOMATICALLY_FETCH_METADATA,
|
||||||
delegatee_tag: String::new(),
|
delegatee_tag: String::new(),
|
||||||
highlight_unread_events: DEFAULT_HIGHLIGHT_UNREAD_EVENTS,
|
highlight_unread_events: DEFAULT_HIGHLIGHT_UNREAD_EVENTS,
|
||||||
block_mostr: false,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,7 +169,6 @@ impl Settings {
|
|||||||
"highlight_unread_events" => {
|
"highlight_unread_events" => {
|
||||||
settings.highlight_unread_events = numstr_to_bool(row.1)
|
settings.highlight_unread_events = numstr_to_bool(row.1)
|
||||||
}
|
}
|
||||||
"block_mostr" => settings.block_mostr = numstr_to_bool(row.1),
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -214,8 +211,7 @@ impl Settings {
|
|||||||
('direct_messages', ?),\
|
('direct_messages', ?),\
|
||||||
('automatically_fetch_metadata', ?),\
|
('automatically_fetch_metadata', ?),\
|
||||||
('delegatee_tag', ?),\
|
('delegatee_tag', ?),\
|
||||||
('highlight_unread_events', ?),\
|
('highlight_unread_events', ?)",
|
||||||
('block_mostr', ?)",
|
|
||||||
)?;
|
)?;
|
||||||
stmt.execute(params![
|
stmt.execute(params![
|
||||||
self.feed_chunk,
|
self.feed_chunk,
|
||||||
@ -240,7 +236,6 @@ impl Settings {
|
|||||||
bool_to_numstr(self.automatically_fetch_metadata),
|
bool_to_numstr(self.automatically_fetch_metadata),
|
||||||
self.delegatee_tag,
|
self.delegatee_tag,
|
||||||
bool_to_numstr(self.highlight_unread_events),
|
bool_to_numstr(self.highlight_unread_events),
|
||||||
bool_to_numstr(self.block_mostr)
|
|
||||||
])?;
|
])?;
|
||||||
|
|
||||||
// Settings which are Options should not even exist when None. We don't accept null valued
|
// Settings which are Options should not even exist when None. We don't accept null valued
|
||||||
|
@ -110,12 +110,6 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, _frame: &mut eframe::Fra
|
|||||||
)
|
)
|
||||||
.on_hover_text("Takes effect when the feed refreshes.");
|
.on_hover_text("Takes effect when the feed refreshes.");
|
||||||
|
|
||||||
ui.checkbox(
|
|
||||||
&mut app.settings.block_mostr,
|
|
||||||
"Block Mostr",
|
|
||||||
)
|
|
||||||
.on_hover_text("Mostr is a gateway to the fediverse through which lots of Nazis flow");
|
|
||||||
|
|
||||||
ui.add_space(12.0);
|
ui.add_space(12.0);
|
||||||
ui.separator();
|
ui.separator();
|
||||||
ui.add_space(12.0);
|
ui.add_space(12.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user