aboutsummaryrefslogtreecommitdiff
path: root/src/tw
diff options
context:
space:
mode:
authorAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-02 01:27:41 -0700
committerAndy Wortman <ixineeringeverywhere@gmail.com>2017-10-02 02:32:46 -0700
commitfe80b29ca03ed5e4462800804f33ecc00e1f880f (patch)
treeb6dda082bbdbcfabebf426ba3cec41af0cb550f1 /src/tw
parentea4e93f01d9e4ef17effae1e9a807bb1977865fe (diff)
store and show reply_to info if present
Diffstat (limited to 'src/tw')
-rw-r--r--src/tw/tweet.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tw/tweet.rs b/src/tw/tweet.rs
index 778461a..aa272d6 100644
--- a/src/tw/tweet.rs
+++ b/src/tw/tweet.rs
@@ -14,6 +14,9 @@ pub struct Tweet {
#[serde(skip_serializing_if="Option::is_none")]
#[serde(default = "Option::default")]
pub rt_tweet: Option<String>,
+ #[serde(skip_serializing_if="Option::is_none")]
+ #[serde(default = "Option::default")]
+ pub reply_to_tweet: Option<String>,
#[serde(skip)]
pub internal_id: u64
}
@@ -47,6 +50,9 @@ impl Tweet {
.and_then(|x| x.get("id_str"))
.and_then(|x| x.as_str())
.map(|x| x.to_owned());
+ let reply_to_tweet = json_map.get("in_reply_to_status_id_str")
+ .and_then(|x| x.as_str())
+ .map(|x| x.to_owned());
if json_map.contains_key("id_str") &&
json_map.contains_key("user") &&
json_map.contains_key("created_at") {
@@ -68,6 +74,7 @@ impl Tweet {
.and_then(|x| x.as_str())
.map(|x| x.to_owned()),
rt_tweet: rt_twete,
+ reply_to_tweet: reply_to_tweet,
internal_id: 0
})
}