fix broken reblog/favourites counter

This commit is contained in:
molan-git 2020-07-03 10:45:03 +02:00
parent 071d446943
commit 699265fca7
3 changed files with 10 additions and 12 deletions

View file

@ -16,8 +16,7 @@ CONFIG += sailfishapp
QT += network dbus sql QT += network dbus sql
QT += multimedia QT += multimedia
CONFIG += link_pkgconfig CONFIG += link_pkgconfig
PKGCONFIG += sailfishapp PKGCONFIG += sailfishapp \
PKGCONFIG += \
nemonotifications-qt5 nemonotifications-qt5
DEFINES += "APPVERSION=\\\"$${SPECVERSION}\\\"" DEFINES += "APPVERSION=\\\"$${SPECVERSION}\\\""

View file

@ -160,7 +160,6 @@ function parseAccounts(collection, prefix, data) {
//res[prefix + 'account_fields'] = data["fields"] //res[prefix + 'account_fields'] = data["fields"]
res[prefix + 'account_bot'] = data["bot"] res[prefix + 'account_bot'] = data["bot"]
res[prefix + 'account_group'] = data["group"] res[prefix + 'account_group'] = data["group"]
res[prefix + 'account_source'] = data["source"]
//console.log(JSON.stringify(res)) //console.log(JSON.stringify(res))
return (res); return (res);
@ -228,7 +227,7 @@ function parseNotification(data){
return item; return item;
} }
/** Function: ?? */ /** Function: */
function collect() { function collect() {
var ret = {}; var ret = {};
var len = arguments.length; var len = arguments.length;
@ -261,7 +260,6 @@ function parseToot (data) {
item['status_spoiler_text'] = data["spoiler_text"] item['status_spoiler_text'] = data["spoiler_text"]
item['status_visibility'] = data["visibility"] item['status_visibility'] = data["visibility"]
item['status_language'] = data["language"] item['status_language'] = data["language"]
item['status_uri'] = data["uri"] item['status_uri'] = data["uri"]
item['status_url'] = data["url"] item['status_url'] = data["url"]
item['status_replies_count'] = data["replies_count"] item['status_replies_count'] = data["replies_count"]
@ -270,10 +268,8 @@ function parseToot (data) {
item['status_favourited'] = data["favourited"] item['status_favourited'] = data["favourited"]
item['status_reblogged'] = data["reblogged"] item['status_reblogged'] = data["reblogged"]
item['status_bookmarked'] = data["bookmarked"] item['status_bookmarked'] = data["bookmarked"]
item['status_content'] = data["content"] item['status_content'] = data["content"]
item['attachments'] = data['media_attachments'] item['attachments'] = data['media_attachments']
item['status_in_reply_to_id'] = data["in_reply_to_id"] item['status_in_reply_to_id'] = data["in_reply_to_id"]
item['status_in_reply_to_account_id'] = data["in_reply_to_account_id"] item['status_in_reply_to_account_id'] = data["in_reply_to_account_id"]
item['status_reblog'] = data["reblog"] ? true : false item['status_reblog'] = data["reblog"] ? true : false
@ -283,16 +279,19 @@ function parseToot (data) {
if(item['status_reblog']) { if(item['status_reblog']) {
item['type'] = "reblog"; item['type'] = "reblog";
item['typeIcon'] = "image://theme/icon-s-retweet" item['typeIcon'] = "image://theme/icon-s-retweet"
item['status_id'] = data["reblog"]["id"]; item['status_id'] = data["reblog"]["id"]
item['status_spoiler_text'] = data["reblog"]["spoiler_text"]
item['status_sensitive'] = data["reblog"]["sensitive"] item['status_sensitive'] = data["reblog"]["sensitive"]
item['status_spoiler_text'] = data["reblog"]["spoiler_text"]
item['status_replies_count'] = data["reblog"]["replies_count"]
item['status_reblogs_count'] = data["reblog"]["reblogs_count"]
item['status_favourites_count'] = data["reblog"]["favourites_count"]
item = parseAccounts(item, "", data['reblog']["account"]) item = parseAccounts(item, "", data['reblog']["account"])
item = parseAccounts(item, "reblog_", data["account"]) item = parseAccounts(item, "reblog_", data["account"])
} else { } else {
item = parseAccounts(item, "", data["account"]) item = parseAccounts(item, "", data["account"])
} }
/** Replace HTML content */ /** Replace HTML content in Toots */
item['content'] = data['content'] item['content'] = data['content']
.replaceAll('</span><span class="invisible">', '') .replaceAll('</span><span class="invisible">', '')
.replaceAll('<span class="invisible">', '') .replaceAll('<span class="invisible">', '')