aboutsummaryrefslogtreecommitdiff
path: root/src/commands/auth.rs
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2017-11-18 16:49:23 -0800
committerAndy Wortman <ixineeringeverywhere@gmail.com>2017-11-18 16:49:23 -0800
commita3966446bab8bf849457c24a9a6d05216f950e11 (patch)
tree10ce6f47ba5ef8641aab53052dd69e958df3af3a /src/commands/auth.rs
parent799757386fa02339c20eff9f256de0f97b5fa042 (diff)
groundwork for multi-account use
add connection state tracked per-stream, add explicit TwitterProfile mapped to names that can be used for accounts. default names are the handle of the corresponding twitter account. partition out user Credential to be per TwitterProfile, so fav, reply, etc, all come from the selected account. Multiplex twitter connections and message streams across chan (instead of earlier plan, which was to have one chan per thread)
Diffstat (limited to 'src/commands/auth.rs')
-rw-r--r--src/commands/auth.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/commands/auth.rs b/src/commands/auth.rs
index 7d01451..65dcaf5 100644
--- a/src/commands/auth.rs
+++ b/src/commands/auth.rs
@@ -4,8 +4,6 @@ use std::collections::HashMap;
use hyper;
use ::Queryer;
-use tw::TweetId;
-
use commands::Command;
static FAV_TWEET_URL: &str = "https://api.twitter.com/1.1/favorites/create.json";
@@ -79,10 +77,11 @@ fn pin(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer) {
as_map.insert(part[0], part[1]);
}
// turns out the "actual" oauth creds are different
- tweeter.add_profile(tw::Credential {
+ // TODO: profile names?
+ tweeter.add_profile(tw::TwitterProfile::new(tw::Credential {
key: as_map["oauth_token"].to_owned(),
secret: as_map["oauth_token_secret"].to_owned()
- });
+ }, tw::user::User::default()), Some("iximeow".to_owned()));
tweeter.WIP_auth = None;
tweeter.state = tw::AppState::Reconnect;
tweeter.display_info.status("Looks like you authed! Connecting...".to_owned());