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 _("%s wants to follow you").printf (account.url, account.display_name); case WATCHLIST: return _("%s posted a toot").printf (account.url, account.display_name); + case UNKNOWN: + return _("%s 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"; } }