forked from janek/mostr
feat: use author name consistently
This commit is contained in:
parent
f8a4777f71
commit
f4cff3d702
|
@ -379,11 +379,12 @@ async fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Some('@') => {
|
Some('@') => {
|
||||||
let author = arg.and_then(|a| PublicKey::from_str(a).ok()).unwrap_or_else(|| keys.public_key());
|
let key = arg.and_then(|a| PublicKey::from_str(a).ok()).unwrap_or_else(|| keys.public_key());
|
||||||
|
let author = tasks.get_author(&key);
|
||||||
info!("Filtering for events by {author}");
|
info!("Filtering for events by {author}");
|
||||||
tasks.set_filter(
|
tasks.set_filter(
|
||||||
tasks.filtered_tasks(tasks.get_position_ref())
|
tasks.filtered_tasks(tasks.get_position_ref())
|
||||||
.filter(|t| t.event.pubkey == author)
|
.filter(|t| t.event.pubkey == key)
|
||||||
.map(|t| t.event.id)
|
.map(|t| t.event.id)
|
||||||
.collect()
|
.collect()
|
||||||
)
|
)
|
||||||
|
|
|
@ -214,11 +214,11 @@ impl Tasks {
|
||||||
} else {
|
} else {
|
||||||
format_stamp(end, "%H:%M")
|
format_stamp(end, "%H:%M")
|
||||||
},
|
},
|
||||||
key))
|
self.get_author(key)))
|
||||||
}
|
}
|
||||||
iter.into_buffer()
|
iter.into_buffer()
|
||||||
.for_each(|(stamp, _)|
|
.for_each(|(stamp, _)|
|
||||||
vec.push(format!("{} started by {}", local_datetimestamp(stamp), key)));
|
vec.push(format!("{} started by {}", local_datetimestamp(stamp), self.get_author(key))));
|
||||||
vec
|
vec
|
||||||
}).sorted_unstable(); // TODO sorting depends on timestamp format - needed to interleave different people
|
}).sorted_unstable(); // TODO sorting depends on timestamp format - needed to interleave different people
|
||||||
(format!("Times Tracked on {:?}", self.get_task_title(&id)), Box::from(history))
|
(format!("Times Tracked on {:?}", self.get_task_title(&id)), Box::from(history))
|
||||||
|
|
Loading…
Reference in New Issue