public enum Tootle.NotificationType {
MENTION,
REBLOG,
FAVORITE,
FOLLOW;
public string to_string() {
switch (this) {
case MENTION:
return "mention";
case REBLOG:
return "reblog";
case FAVORITE:
return "favourite";
case FOLLOW:
return "follow";
default:
assert_not_reached();
}
}
public static NotificationType from_string (string str) {
switch (str) {
case "mention":
return MENTION;
case "reblog":
return REBLOG;
case "favourite":
return FAVORITE;
case "follow":
return FOLLOW;
default:
assert_not_reached();
}
}
public string get_desc (Account? account) {
switch (this) {
case MENTION:
return _("%s mentioned you").printf (account.url, account.display_name);
case REBLOG:
return _("%s boosted your toot").printf (account.url, account.display_name);
case FAVORITE:
return _("%s favorited your toot").printf (account.url, account.display_name);
case FOLLOW:
return _("%s now follows you").printf (account.url, account.display_name);
default:
assert_not_reached();
}
}
public string get_icon () {
switch (this) {
case MENTION:
return "user-available-symbolic";
case REBLOG:
return "edit-undo-symbolic";
case FAVORITE:
return "help-about-symbolic";
case FOLLOW:
return "contact-new-symbolic";
default:
assert_not_reached();
}
}
}