Commit c04268e1 authored by Haelwenn's avatar Haelwenn

Add emoji reaction notifications

parent 260de857
......@@ -189,7 +189,9 @@ var notifier =
body : item.content,
service : 'toot',
key : item.id
} break;
}
break;
case "follow":
msg = {
urgency : "critical",
......@@ -199,8 +201,9 @@ var notifier =
body : qsTr("followed you"),
service : 'profile',
key : item.account_username
} break;
}
break;
case "reblog":
msg = {
urgency : "low",
......@@ -211,7 +214,9 @@ var notifier =
body : item.content,
service : 'toot',
key : item.id
} break;
}
break;
case "mention":
msg = {
urgency : "critical",
......@@ -225,9 +230,24 @@ var notifier =
' ' + qsTr("said") + ': ' + item.content,
service : 'toot',
key : item.id
} break;
}
break;
case "pleroma:emoji_reaction":
msg = {
urgency : "low",
timestamp : item.created_at,
summary : (item.reblog_account_display_name !== "" ? item.reblog_account_display_name
: '@' + item.reblog_account_username) +
' ' + qsTr("reacted with: ") + item.emoji,
body : item.content,
service : 'toot',
key : item.id
}
break;
default:
//console.log(JSON.stringify(messageObject.data))
// console.log("Unknown notification: " + JSON.stringify(messageObject.data))
return;
}
notificationGenerator(msg)
......
......@@ -195,7 +195,6 @@ function parseNotification(data) {
item['status_reblog'] = true;
item['typeIcon'] = "image://theme/icon-s-favorite"
item['type'] = "favourite";
//item['retweetScreenName'] = item['reblog_account_username'];
break;
case "follow":
item['type'] = "follow";
......@@ -205,6 +204,14 @@ function parseNotification(data) {
item['typeIcon'] = "image://theme/icon-s-installed";
item['attachments'] = [];
break;
case "pleroma:emoji_reaction":
item = parseToot(data.status)
item = parseAccounts(item, "reblog_", data["account"])
item = parseAccounts(item, "", data["status"]["account"])
item['status_reblog'] = true;
item['typeIcon'] = "image://theme/icon-s-favorite"
item['type'] = "favourite";
break;
default: item['typeIcon'] = "image://theme/icon-s-sailfish"
}
......
......@@ -41,6 +41,9 @@ Item {
case "follow":
action = qsTr('followed you');
break;
case "pleroma:emoji_reaction":
action = qsTr('Reacted');
break;
/* disable status header for mentions and regular posts */
case "mention":
case "toot":
......
......@@ -40,6 +40,9 @@ BackgroundItem {
case "follow":
action = qsTr('followed you');
break;
case "pleroma:emoji_reaction":
action = qsTr('Reacted');
break;
default:
action = type;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment