diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-12-31 04:49:49 -0800 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-12-31 04:49:49 -0800 |
commit | f03dc86b2af24b133bc85f05941c9819ce6cd83b (patch) | |
tree | 9b4ade0ad1d036df2c5f50016720d48355f50e5e /src/tw/mod.rs | |
parent | 27bf6925db5fed3936e03a197bf256ac3e860a0b (diff) |
clean up DM support, add thing to send DMsdm-fixup
Diffstat (limited to 'src/tw/mod.rs')
-rw-r--r-- | src/tw/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tw/mod.rs b/src/tw/mod.rs index 2eb574f..9a14b11 100644 --- a/src/tw/mod.rs +++ b/src/tw/mod.rs @@ -1200,8 +1200,12 @@ fn handle_twitter_dm( display_info: &mut DisplayInfo, _queryer: &mut ::Queryer) { // show DM - display_info.recv(display::Infos::Text(vec![format!("{:?}", structure)])); - display_info.recv(display::Infos::DM(structure["direct_message"]["text"].as_str().unwrap().to_string())); + tweeter.cache_api_user(structure["direct_message"]["recipient"].clone()); + tweeter.cache_api_user(structure["direct_message"]["sender"].clone()); + let dm_text = structure["direct_message"]["text"].as_str().unwrap().to_string(); + let to = structure["direct_message"]["recipient_id_str"].as_str().unwrap().to_string(); + let from = structure["direct_message"]["sender_id_str"].as_str().unwrap().to_string(); + display_info.recv(display::Infos::DM(dm_text, from, to)); } fn handle_twitter_welcome( |