aboutsummaryrefslogtreecommitdiff
path: root/src/tw
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2017-11-08 02:05:09 -0800
committerAndy Wortman <ixineeringeverywhere@gmail.com>2017-11-08 02:05:09 -0800
commitaa5f8ff4bce898907ffc0c0e2b7ea36d7f8c10b7 (patch)
tree532704985e9b9484e9ac78fee9f95a29fdab48d3 /src/tw
parent41f6535a480bb9b0ff085e0144852827633f2305 (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
}
}