aboutsummaryrefslogtreecommitdiff
path: root/src/tw
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2017-11-08 02:05:09 -0800
committeriximeow <me@iximeow.net>2017-11-08 02:05:09 -0800
commitc2c125a83cfdd3556df37f02907edcb1351d674b (patch)
tree532704985e9b9484e9ac78fee9f95a29fdab48d3 /src/tw
parent96425724b0e435c33876f4dd9685aed2bbdea1fd (diff)
first brush of a compose mode, support thread viewing again
Diffstat (limited to 'src/tw')
-rw-r--r--src/tw/mod.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/tw/mod.rs b/src/tw/mod.rs
index 82dfe10..b1bc9c2 100644
--- a/src/tw/mod.rs
+++ b/src/tw/mod.rs
@@ -22,6 +22,16 @@ use self::tweet::Tweet;
pub mod user;
use self::user::User;
+pub enum AppState {
+ Reconnect,
+ Compose,
+ View
+}
+
+impl Default for AppState {
+ fn default() -> AppState { AppState::View }
+}
+
pub fn full_twete_text(twete: &serde_json::map::Map<String, serde_json::Value>) -> String {
if twete.contains_key("retweeted_status") {
return full_twete_text(twete["retweeted_status"].as_object().unwrap())
@@ -103,7 +113,9 @@ pub struct TwitterCache {
#[serde(skip)]
id_conversions: IdConversions,
#[serde(skip)]
- pub display_info: display::DisplayInfo
+ pub display_info: display::DisplayInfo,
+ #[serde(skip)]
+ pub state: AppState
}
// Internally, a monotonically increasin i64 is always the id used.
@@ -259,7 +271,8 @@ impl TwitterCache {
current_user: User::default(),
threads: HashMap::new(),
id_conversions: IdConversions::default(),
- display_info: display::DisplayInfo::default()
+ display_info: display::DisplayInfo::default(),
+ state: AppState::View
}
}