From a043c16d193d8097b207bb202425d6e5f4498af8 Mon Sep 17 00:00:00 2001 From: bleakgrey Date: Fri, 8 Mar 2019 14:54:44 +0300 Subject: [PATCH] Don't underline status labels with emoji --- src/API/NotificationType.vala | 31 +++++++++++++++++++------------ src/Widgets/StatusWidget.vala | 2 +- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/API/NotificationType.vala b/src/API/NotificationType.vala index 53598b5..8a06974 100644 --- a/src/API/NotificationType.vala +++ b/src/API/NotificationType.vala @@ -1,10 +1,11 @@ public enum Tootle.NotificationType { MENTION, REBLOG, + REBLOG_REMOTE_USER, // Internal FAVORITE, FOLLOW, - FOLLOW_REQUEST, // Internal - WATCHLIST; // Internal + FOLLOW_REQUEST, // Internal + WATCHLIST; // Internal public string to_string() { switch (this) { @@ -12,6 +13,8 @@ public enum Tootle.NotificationType { return "mention"; case REBLOG: return "reblog"; + case REBLOG_REMOTE_USER: + return "reblog_remote"; case FAVORITE: return "favourite"; case FOLLOW: @@ -24,13 +27,15 @@ public enum Tootle.NotificationType { assert_not_reached(); } } - + public static NotificationType from_string (string str) { switch (str) { case "mention": return MENTION; case "reblog": return REBLOG; + case "reblog_remote": + return REBLOG_REMOTE_USER; case "favourite": return FAVORITE; case "follow": @@ -43,26 +48,28 @@ public enum Tootle.NotificationType { assert_not_reached(); } } - + public string get_desc (Account? account) { switch (this) { case MENTION: - return _("%s mentioned you").printf (account.url, account.display_name); + return _("%s mentioned you").printf (account.url, account.display_name); case REBLOG: - return _("%s boosted your toot").printf (account.url, account.display_name); + return _("%s boosted your toot").printf (account.url, account.display_name); + case REBLOG_REMOTE_USER: + return _("%s boosted").printf (account.url, account.display_name); case FAVORITE: - return _("%s favorited your toot").printf (account.url, account.display_name); + return _("%s favorited your toot").printf (account.url, account.display_name); case FOLLOW: - return _("%s now follows you").printf (account.url, account.display_name); + return _("%s now follows you").printf (account.url, account.display_name); case FOLLOW_REQUEST: - return _("%s wants to follow you").printf (account.url, account.display_name); + return _("%s wants to follow you").printf (account.url, account.display_name); case WATCHLIST: - return _("%s posted a toot").printf (account.url, account.display_name); + return _("%s posted a toot").printf (account.url, account.display_name); default: assert_not_reached(); } } - + public string get_icon () { switch (this) { case MENTION: @@ -79,5 +86,5 @@ public enum Tootle.NotificationType { assert_not_reached(); } } - + } diff --git a/src/Widgets/StatusWidget.vala b/src/Widgets/StatusWidget.vala index 9e4d887..5daf647 100644 --- a/src/Widgets/StatusWidget.vala +++ b/src/Widgets/StatusWidget.vala @@ -134,7 +134,7 @@ public class Tootle.StatusWidget : Gtk.EventBox { image.margin_top = 6; image.show (); - var label_text = _("%s boosted").printf (this.status.account.url, this.status.account.display_name); + var label_text = NotificationType.REBLOG_REMOTE_USER.get_desc (status.account); var label = new RichLabel (label_text); label.halign = Align.START; label.margin_top = 6;