summaryrefslogtreecommitdiff
path: root/pcr/tootle/handle-unknown-message-types.patch
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2019-11-24 12:17:16 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2019-11-24 12:19:58 -0500
commita02c7bab7ea9569147c7f7c25c1a839f49b12783 (patch)
tree5fd9718afb897c0f1748a04da6377b5100a50e3e /pcr/tootle/handle-unknown-message-types.patch
parentdac5525c7dd35172d583ffc289274893e739275a (diff)
downloadabslibre-a02c7bab7ea9569147c7f7c25c1a839f49b12783.tar.gz
abslibre-a02c7bab7ea9569147c7f7c25c1a839f49b12783.tar.bz2
abslibre-a02c7bab7ea9569147c7f7c25c1a839f49b12783.zip
[tootle]: bugfix - unhandled message types
Diffstat (limited to 'pcr/tootle/handle-unknown-message-types.patch')
-rw-r--r--pcr/tootle/handle-unknown-message-types.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/pcr/tootle/handle-unknown-message-types.patch b/pcr/tootle/handle-unknown-message-types.patch
new file mode 100644
index 000000000..4653b2675
--- /dev/null
+++ b/pcr/tootle/handle-unknown-message-types.patch
@@ -0,0 +1,56 @@
+diff --git a/src/API/NotificationType.vala b/src/API/NotificationType.vala
+index 53598b5..25c2b2c 100644
+--- a/src/API/NotificationType.vala
++++ b/src/API/NotificationType.vala
+@@ -4,7 +4,8 @@ public enum Tootle.NotificationType {
+ FAVORITE,
+ FOLLOW,
+ FOLLOW_REQUEST, // Internal
+- WATCHLIST; // Internal
++ WATCHLIST, // Internal
++ UNKNOWN; // Fallback
+
+ public string to_string() {
+ switch (this) {
+@@ -20,8 +21,9 @@ public enum Tootle.NotificationType {
+ return "follow_request";
+ case WATCHLIST:
+ return "watchlist";
++ case UNKNOWN:
+ default:
+- assert_not_reached();
++ return "unknown";
+ }
+ }
+
+@@ -39,8 +41,9 @@ public enum Tootle.NotificationType {
+ return FOLLOW_REQUEST;
+ case "watchlist":
+ return WATCHLIST;
++ case "unknown":
+ default:
+- assert_not_reached();
++ return UNKNOWN;
+ }
+ }
+
+@@ -58,6 +61,8 @@ public enum Tootle.NotificationType {
+ return _("<a href=\"%s\"><b>%s</b></a> wants to follow you").printf (account.url, account.display_name);
+ case WATCHLIST:
+ return _("<a href=\"%s\"><b>%s</b></a> posted a toot").printf (account.url, account.display_name);
++ case UNKNOWN:
++ return _("<a href=\"%s\"><b>%s</b></a> posted an unrecognized type of message").printf (account.url, account.display_name);
+ default:
+ assert_not_reached();
+ }
+@@ -75,8 +80,9 @@ public enum Tootle.NotificationType {
+ case FOLLOW:
+ case FOLLOW_REQUEST:
+ return "contact-new-symbolic";
++ case UNKNOWN:
+ default:
+- assert_not_reached();
++ return "dialog-warning";
+ }
+ }
+