From 7e2fc12487a999a33b8877c6529edb07474e6238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VERET=20Cl=C3=A9ment?= Date: Thu, 5 Mar 2020 11:38:57 +0100 Subject: [PATCH] Add the support of threads without replies: if we replied to ourselves, it is considered, if not, it is rejected --- README.md | 2 ++ src/lib.rs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 3e5ebed..65c9986 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ It: If any of the last steps failed, the Toot gets published with the exact same text as the Tweet. +RT are excluded, replies are included.but only the source threads are copied, not the actual replies to other Twitter users. + # Usage First up, create a configuration file (default path is `/usr/local/etc/scootaloo.toml`). It will look like this: diff --git a/src/lib.rs b/src/lib.rs index dcf1329..c1c7874 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -320,6 +320,14 @@ pub fn run(config: Config) { feed.reverse(); for tweet in &feed { + // determine if the tweet is part of a thread (response to self) or a standard response + if let Some(r) = &tweet.in_reply_to_screen_name { + if &r.to_lowercase() != &config.twitter.username.to_lowercase() { + // we are responding not threading + continue; + } + }; + // build basic status by just yielding text and dereferencing contained urls let mut status = match build_basic_status(tweet) { Ok(t) => t,