diff options
author | iximeow <me@iximeow.net> | 2018-01-15 12:21:27 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2018-01-15 12:24:15 -0800 |
commit | 7b84985857fd9bd1756439383f1a1ae82f9bd57a (patch) | |
tree | d1cf1a1891d7eb1ac05da483e3638f1b0b1c815a /src/commands/fav.rs | |
parent | 935c78ce7d2aaabca269d81cff3459cef1084fbc (diff) |
ensure all query string parameters are properly escaped
also un-escape html-encoded characters in DMs
also distinguish errors in auth commands
Diffstat (limited to 'src/commands/fav.rs')
-rw-r--r-- | src/commands/fav.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/commands/fav.rs b/src/commands/fav.rs index 02ec7dd..d853a0d 100644 --- a/src/commands/fav.rs +++ b/src/commands/fav.rs @@ -23,7 +23,7 @@ fn unfav(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer, di Ok(twid) => { if let Some(twete) = tweeter.retrieve_tweet(&twid) { let result = match tweeter.current_profile() { - Some(user_profile) => queryer.do_api_post(&format!("{}?id={}", UNFAV_TWEET_URL, twete.id), &tweeter.app_key, &user_profile.creds), + Some(user_profile) => queryer.do_api_post(UNFAV_TWEET_URL, &vec![("id", &twete.id)], &tweeter.app_key, &user_profile.creds), None => Err("No logged in user to unfav from".to_owned()) }; match result { @@ -55,7 +55,7 @@ fn fav(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer, disp // tweeter.to_twitter_tweet_id(twid)... if let Some(twete) = tweeter.retrieve_tweet(&twid) { let result = match tweeter.current_profile() { - Some(user_profile) => queryer.do_api_post(&format!("{}?id={}", FAV_TWEET_URL, twete.id), &tweeter.app_key, &user_profile.creds), + Some(user_profile) => queryer.do_api_post(FAV_TWEET_URL, &vec![("id", &twete.id)], &tweeter.app_key, &user_profile.creds), None => Err("No logged in user to fav from".to_owned()) }; match result { |