From 699265fca78366276e63a98cf7eebbde9104e130 Mon Sep 17 00:00:00 2001 From: molan-git Date: Fri, 3 Jul 2020 10:45:03 +0200 Subject: [PATCH] fix broken reblog/favourites counter --- harbour-tooter.pro | 3 +-- qml/lib/API.js | 2 +- qml/lib/Worker.js | 17 ++++++++--------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/harbour-tooter.pro b/harbour-tooter.pro index fd7bec4..db171a3 100644 --- a/harbour-tooter.pro +++ b/harbour-tooter.pro @@ -16,8 +16,7 @@ CONFIG += sailfishapp QT += network dbus sql QT += multimedia CONFIG += link_pkgconfig -PKGCONFIG += sailfishapp -PKGCONFIG += \ +PKGCONFIG += sailfishapp \ nemonotifications-qt5 DEFINES += "APPVERSION=\\\"$${SPECVERSION}\\\"" diff --git a/qml/lib/API.js b/qml/lib/API.js index 9fbfa12..1373f9f 100644 --- a/qml/lib/API.js +++ b/qml/lib/API.js @@ -38,7 +38,7 @@ var init = function(){ tx.executeSql('CREATE TABLE IF NOT EXISTS settings (' + ' key TEXT UNIQUE, ' + ' value TEXT ' - +');'); + + ');'); //tx.executeSql('INSERT INTO settings (key, value) VALUES (?, ?)', ["conf", "{}"]); }); db.changeVersion('', '0.1', function(tx) { diff --git a/qml/lib/Worker.js b/qml/lib/Worker.js index 6e8bb69..1373fb0 100644 --- a/qml/lib/Worker.js +++ b/qml/lib/Worker.js @@ -160,7 +160,6 @@ function parseAccounts(collection, prefix, data) { //res[prefix + 'account_fields'] = data["fields"] res[prefix + 'account_bot'] = data["bot"] res[prefix + 'account_group'] = data["group"] - res[prefix + 'account_source'] = data["source"] //console.log(JSON.stringify(res)) return (res); @@ -228,7 +227,7 @@ function parseNotification(data){ return item; } -/** Function: ?? */ +/** Function: */ function collect() { var ret = {}; var len = arguments.length; @@ -261,7 +260,6 @@ function parseToot (data) { item['status_spoiler_text'] = data["spoiler_text"] item['status_visibility'] = data["visibility"] item['status_language'] = data["language"] - item['status_uri'] = data["uri"] item['status_url'] = data["url"] item['status_replies_count'] = data["replies_count"] @@ -270,10 +268,8 @@ function parseToot (data) { item['status_favourited'] = data["favourited"] item['status_reblogged'] = data["reblogged"] item['status_bookmarked'] = data["bookmarked"] - item['status_content'] = data["content"] item['attachments'] = data['media_attachments'] - 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_reblog'] = data["reblog"] ? true : false @@ -283,16 +279,19 @@ function parseToot (data) { if(item['status_reblog']) { item['type'] = "reblog"; item['typeIcon'] = "image://theme/icon-s-retweet" - item['status_id'] = data["reblog"]["id"]; - item['status_spoiler_text'] = data["reblog"]["spoiler_text"] + item['status_id'] = data["reblog"]["id"] 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, "reblog_", data["account"]) } else { item = parseAccounts(item, "", data["account"]) } - /** Replace HTML content */ + /** Replace HTML content in Toots */ item['content'] = data['content'] .replaceAll('