diff options
| author | iximeow <me@iximeow.net> | 2017-12-31 04:49:49 -0800 |
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2017-12-31 04:49:49 -0800 |
| commit | 935c78ce7d2aaabca269d81cff3459cef1084fbc (patch) | |
| tree | 9b4ade0ad1d036df2c5f50016720d48355f50e5e /src/display | |
| parent | 9979821629fc8943ad50b06e934a83a24b352a7f (diff) | |
clean up DM support, add thing to send DMs
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/mod.rs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/display/mod.rs b/src/display/mod.rs index 6115472..098bb1c 100644 --- a/src/display/mod.rs +++ b/src/display/mod.rs @@ -27,7 +27,7 @@ pub enum Infos { TweetWithContext(TweetId, String), Thread(Vec<TweetId>), Event(tw::events::Event), - DM(String), + DM(String, String, String), User(tw::user::User), Text(Vec<String>) } @@ -549,10 +549,8 @@ pub fn paint(tweeter: &::tw::TwitterCache, display_info: &mut DisplayInfo) -> Re }; wrapped.into_iter().rev().collect() }, - Infos::DM(msg) => { - let mut lines = vec![format!("{}{}{} DM:", cursor::Goto(1, height - h), clear::CurrentLine, "from")]; - lines.push(msg); - lines + Infos::DM(msg, from_id, to_id) => { + into_display_lines(render_dm(msg, from_id, to_id, tweeter, display_info, width), width).into_iter().rev().collect() } Infos::User(user) => { vec