aboutsummaryrefslogtreecommitdiff
path: root/src/display
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2018-01-15 14:33:10 -0800
committerGitHub <noreply@github.com>2018-01-15 14:33:10 -0800
commitba66e351757c2b1a1efae8be294313d0806d48b4 (patch)
tree8a4e0117e8f2bb7754c512360ce97a6765d1a24f /src/display
parentdeb7dff15aaef57a6fb1ecefeba9bfd3d895d84d (diff)
parent5ecfb0b6204481e9ca4ed1af09ce22ff4591c1e3 (diff)
Merge pull request #10 from iximeow/hm-translation
add flag to translate emoji to/from a description
Diffstat (limited to 'src/display')
-rw-r--r--src/display/mod.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/display/mod.rs b/src/display/mod.rs
index 098bb1c..f2f59da 100644
--- a/src/display/mod.rs
+++ b/src/display/mod.rs
@@ -830,8 +830,19 @@ pub fn render_twete_no_recurse(twete_id: &TweetId, tweeter: &tw::TwitterCache, d
colorized_lines.push(new_line);
}
+ let emoji_replaced: Vec<String> = if tweeter.translate_emoji {
+ colorized_lines.iter().map(|line| {
+ line
+ .replace("🤔", ":thinking:")
+ .replace("👏",":clap:")
+ }).collect()
+ } else {
+ colorized_lines
+ };
+
+
let mut urls_to_include: Vec<&str> = vec![];
- let urls_replaced = colorized_lines
+ let urls_replaced = emoji_replaced
.into_iter()
.map(|line| {
let mut result: String = line.to_owned();