diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-11-11 16:56:13 -0800 |
---|---|---|
committer | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-11-11 16:56:13 -0800 |
commit | fcc590c763afd4fde667286cb8f3b127eaf35595 (patch) | |
tree | 1f0932faf73f9fa90ecbea1069b15d9cbe158c73 /src/commands | |
parent | d1a33a3a167d47541561ca9597d2d5f28431605f (diff) |
checking for tweet length in-client is dumb
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/twete.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/commands/twete.rs b/src/commands/twete.rs index dbea81b..c5c0c1a 100644 --- a/src/commands/twete.rs +++ b/src/commands/twete.rs @@ -61,19 +61,13 @@ fn twete(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer) { pub fn send_twete(text: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer) { let substituted = ::url_encode(&text); - if text.len() <= 140 { - let result = match tweeter.profile.clone() { - Some(user_creds) => queryer.do_api_post(&format!("{}?status={}", CREATE_TWEET_URL, substituted), &tweeter.app_key, &user_creds), - None => Err("No logged in user to tweet as".to_owned()) - }; - match result { - Ok(_) => (), - Err(e) => tweeter.display_info.status(e) - } - } else { - // TODO: this 140 is maybe sometimes 280.. :) - // and see if weighted_character_count still does things? - tweeter.display_info.status(format!("tweet is too long: {}/140 chars", text.len())); + let result = match tweeter.profile.clone() { + Some(user_creds) => queryer.do_api_post(&format!("{}?status={}", CREATE_TWEET_URL, substituted), &tweeter.app_key, &user_creds), + None => Err("No logged in user to tweet as".to_owned()) + }; + match result { + Ok(_) => (), + Err(e) => tweeter.display_info.status(e) } } |