diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-11-01 04:31:43 -0700 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-11-01 04:31:43 -0700 |
commit | 41f6535a480bb9b0ff085e0144852827633f2305 (patch) | |
tree | dd48118f712344d5dcea278148f3c82996f74021 /src/commands/view.rs | |
parent | bf7f5d32a7f05bb0a7bc19dcb443d3df439243ba (diff) |
move more logging to be through DisplayInfo statuses
move DisplayInfo into ... display
flush output, duh
Diffstat (limited to 'src/commands/view.rs')
-rw-r--r-- | src/commands/view.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/commands/view.rs b/src/commands/view.rs index a6ce647..0c9e974 100644 --- a/src/commands/view.rs +++ b/src/commands/view.rs @@ -5,8 +5,6 @@ use tw::TweetId; use commands::Command; -use std::str::FromStr; - use display; pub static VIEW: Command = Command { @@ -19,7 +17,10 @@ fn view(line: String, tweeter: &mut tw::TwitterCache, _queryer: &mut Queryer) { match TweetId::parse(line) { Ok(twid) => { if let Some(twete) = tweeter.retrieve_tweet(&twid).map(|x| x.clone()) { - tweeter.display_info.recv(display::Infos::Tweet(TweetId::Twitter(twete.id.to_owned()))); + tweeter.display_info.recv(display::Infos::TweetWithContext( + TweetId::Twitter(twete.id.to_owned()), + format!("link: https://twitter.com/i/web/status/{}", twete.id) + )); } else { tweeter.display_info.status(format!("No tweet for id {:?}", twid)); } @@ -28,8 +29,6 @@ fn view(line: String, tweeter: &mut tw::TwitterCache, _queryer: &mut Queryer) { tweeter.display_info.status(format!("Invalid id {:?}", e)); } } -// display::render_twete(&twete.id, tweeter); -// println!(" link: https://twitter.com/i/web/status/{}", twete.id); } pub static VIEW_THREAD: Command = Command { @@ -60,8 +59,6 @@ fn view_tr(line: String, mut tweeter: &mut tw::TwitterCache, queryer: &mut Query } tweeter.display_info.recv(display::Infos::Thread(thread)); -// display::render_twete(&twete.id, tweeter); -// println!("link: https://twitter.com/i/web/status/{}", twete.id); } pub static VIEW_THREAD_FORWARD: Command = Command { @@ -70,7 +67,7 @@ pub static VIEW_THREAD_FORWARD: Command = Command { exec: view_tr_forward }; -fn view_tr_forward(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer) { +fn view_tr_forward(_line: String, _tweeter: &mut tw::TwitterCache, _queryer: &mut Queryer) { // first see if we have a thread for the tweet named // if we do not, we'll have to mimic a request like // curl 'https://twitter.com/jojonila/status/914383908090691584' \ |