mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 11:43:43 +00:00
Remove settings.view_threaded, force non-threaded feed for the moment
This commit is contained in:
parent
f8bb4d74b0
commit
0174bd2751
16
src/feed.rs
16
src/feed.rs
@ -87,16 +87,13 @@ impl Feed {
|
||||
let mut events: Vec<Event> = events
|
||||
.iter()
|
||||
.filter(|e| !GLOBALS.dismissed.blocking_read().contains(&e.id))
|
||||
.filter(|e| {
|
||||
if settings.view_threaded {
|
||||
e.replies_to().is_none()
|
||||
} else {
|
||||
true
|
||||
}
|
||||
})
|
||||
//.filter(|e| { for Threaded
|
||||
//e.replies_to().is_none()
|
||||
//})
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
/* for threaded
|
||||
if settings.view_threaded {
|
||||
events.sort_unstable_by(|a, b| {
|
||||
let a_last = GLOBALS.last_reply.blocking_read().get(&a.id).cloned();
|
||||
@ -105,9 +102,10 @@ impl Feed {
|
||||
let b_time = b_last.unwrap_or(b.created_at);
|
||||
b_time.cmp(&a_time)
|
||||
});
|
||||
} else {
|
||||
events.sort_unstable_by(|a, b| b.created_at.cmp(&a.created_at));
|
||||
}
|
||||
*/
|
||||
|
||||
events.sort_unstable_by(|a, b| b.created_at.cmp(&a.created_at));
|
||||
|
||||
self.feed = events.iter().map(|e| e.id).collect();
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ pub const DEFAULT_FEED_CHUNK: u64 = 43200; // 12 hours
|
||||
pub const DEFAULT_OVERLAP: u64 = 600; // 10 minutes
|
||||
pub const DEFAULT_VIEW_POSTS_REFERRED_TO: bool = true;
|
||||
pub const DEFAULT_VIEW_POSTS_REFERRING_TO: bool = false;
|
||||
pub const DEFAULT_VIEW_THREADED: bool = true;
|
||||
pub const DEFAULT_NUM_RELAYS_PER_PERSON: u8 = 4;
|
||||
pub const DEFAULT_MAX_RELAYS: u8 = 15;
|
||||
pub const DEFAULT_MAX_FPS: u32 = 30;
|
||||
@ -21,7 +20,6 @@ pub struct Settings {
|
||||
pub overlap: u64,
|
||||
pub view_posts_referred_to: bool,
|
||||
pub view_posts_referring_to: bool,
|
||||
pub view_threaded: bool,
|
||||
pub num_relays_per_person: u8,
|
||||
pub max_relays: u8,
|
||||
pub public_key: Option<PublicKey>,
|
||||
@ -39,7 +37,6 @@ impl Default for Settings {
|
||||
overlap: DEFAULT_OVERLAP,
|
||||
view_posts_referred_to: DEFAULT_VIEW_POSTS_REFERRED_TO,
|
||||
view_posts_referring_to: DEFAULT_VIEW_POSTS_REFERRING_TO,
|
||||
view_threaded: DEFAULT_VIEW_THREADED,
|
||||
num_relays_per_person: DEFAULT_NUM_RELAYS_PER_PERSON,
|
||||
max_relays: DEFAULT_MAX_RELAYS,
|
||||
public_key: None,
|
||||
@ -76,7 +73,6 @@ impl Settings {
|
||||
"view_posts_referring_to" => {
|
||||
settings.view_posts_referring_to = numstr_to_bool(row.1)
|
||||
}
|
||||
"view_threaded" => settings.view_threaded = numstr_to_bool(row.1),
|
||||
"num_relays_per_person" => {
|
||||
settings.num_relays_per_person =
|
||||
row.1.parse::<u8>().unwrap_or(DEFAULT_NUM_RELAYS_PER_PERSON)
|
||||
@ -130,7 +126,6 @@ impl Settings {
|
||||
('overlap', ?),\
|
||||
('view_posts_referred_to', ?),\
|
||||
('view_posts_referring_to', ?),\
|
||||
('view_threaded', ?),\
|
||||
('num_relays_per_person', ?),\
|
||||
('max_relays', ?),\
|
||||
('max_fps', ?),\
|
||||
@ -143,7 +138,6 @@ impl Settings {
|
||||
self.overlap,
|
||||
bool_to_numstr(self.view_posts_referred_to),
|
||||
bool_to_numstr(self.view_posts_referring_to),
|
||||
bool_to_numstr(self.view_threaded),
|
||||
self.num_relays_per_person,
|
||||
self.max_relays,
|
||||
self.max_fps,
|
||||
|
@ -166,7 +166,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
|
||||
|
||||
ui.separator();
|
||||
|
||||
let threaded = GLOBALS.settings.blocking_read().view_threaded;
|
||||
let threaded = false;
|
||||
|
||||
ScrollArea::vertical().show(ui, |ui| {
|
||||
let bgcolor = if ctx.style().visuals.dark_mode {
|
||||
|
@ -57,10 +57,6 @@ pub(super) fn update(
|
||||
|
||||
ui.heading("Feed");
|
||||
|
||||
ui.checkbox(&mut app.settings.view_threaded, "Threaded feed")
|
||||
.on_hover_text("If selected, replies are under what they reply to and the newest replied-to thread comes first. Otherwise all posts are independent and in time order.");
|
||||
|
||||
ui.add_space(24.0);
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Recompute feed every (milliseconds): ")
|
||||
.on_hover_text(
|
||||
|
Loading…
Reference in New Issue
Block a user