From 1de0593b707540b4c1bd03f2c0a151281a893be6 Mon Sep 17 00:00:00 2001 From: Andy Wortman Date: Sat, 18 Nov 2017 19:15:34 -0800 Subject: remove silly dependence on author's handle --- src/commands/auth.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/commands/auth.rs') diff --git a/src/commands/auth.rs b/src/commands/auth.rs index 65dcaf5..0743d4e 100644 --- a/src/commands/auth.rs +++ b/src/commands/auth.rs @@ -78,10 +78,26 @@ fn pin(line: String, tweeter: &mut tw::TwitterCache, queryer: &mut Queryer) { } // turns out the "actual" oauth creds are different // TODO: profile names? + /* + * Option 1: + * ask user. + * yes, but I want this to be optional though (auth, pin 1234, profile now + * named main or after you or something) + * Option 2: + * make a request for profile settings when auth succeeds + * this becomes the fallback when nothing is provided in option 1 + * what happens when you successfully auth, internet drops, and you fail to + * request settings? + * + * fallback to asking user to name the profile, i guess? + */ + if tweeter.curr_profile.is_none() { + tweeter.curr_profile = Some("default".to_owned()); + } 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())); + }, tw::user::User::default()), Some("default".to_owned())); tweeter.WIP_auth = None; tweeter.state = tw::AppState::Reconnect; tweeter.display_info.status("Looks like you authed! Connecting...".to_owned()); -- cgit v1.1