diff --git a/harbour-tooter.pro b/harbour-tooter.pro index b2c86c8..b92557c 100644 --- a/harbour-tooter.pro +++ b/harbour-tooter.pro @@ -11,10 +11,14 @@ # The name of your application TARGET = harbour-tooter +CONFIG += sailfishapp QT += network dbus sql -CONFIG += sailfishapp link_pkgconfig -PKGCONFIG += sailfishapp nemonotifications-qt5 + +#CONFIG += sailfishapp_qml +CONFIG += link_pkgconfig +PKGCONFIG += sailfishapp +PKGCONFIG += nemonotifications-qt5 DEFINES += "APPVERSION=\\\"$${SPECVERSION}\\\"" DEFINES += "APPNAME=\\\"$${TARGET}\\\"" @@ -66,16 +70,6 @@ OTHER_FILES += qml/harbour-tooter.qml \ SAILFISHAPP_ICONS = 86x86 108x108 128x128 256x256 -# to disable building translations every time, comment out the -# following CONFIG line -# CONFIG += sailfishapp_i18n - -# German translation is enabled as an example. If you aren't -# planning to localize your app, remember to comment out the -# following TRANSLATIONS line. And also do not forget to -# modify the localized app name in the the .desktop file. -TRANSLATIONS += \ - translations/harbour-tooter.ts DISTFILES += \ qml/lib/API.js \ @@ -96,7 +90,11 @@ DISTFILES += \ qml/pages/components/ImageFullScreen.qml \ config/icon-lock-harbour-tooter.png \ config/x-harbour.tooter.activity.conf \ - rpm/harbour-tooter.changes + rpm/harbour-tooter.changes \ + rpm/harbour-tooter.spec \ + rpm/harbour-tooter.yaml \ + translations/*.ts + HEADERS += \ src/imageuploader.h \ @@ -104,3 +102,24 @@ HEADERS += \ src/notifications.h \ src/dbusAdaptor.h \ src/dbus.h +# to disable building translations every time, comment out the +# following CONFIG line +CONFIG += sailfishapp_i18n +CONFIG += sailfishapp_i18n_idbased + +# German translation is enabled as an example. If you aren't +# planning to localize your app, remember to comment out the +# following TRANSLATIONS line. And also do not forget to +# modify the localized app name in the the .desktop file. +TRANSLATIONS += translations/harbour-tooter-de.ts +TRANSLATIONS += translations/harbour-tooter-el.ts +TRANSLATIONS += translations/harbour-tooter-es.ts +TRANSLATIONS += translations/harbour-tooter-fi.ts +TRANSLATIONS += translations/harbour-tooter-fr.ts +TRANSLATIONS += translations/harbour-tooter-nl.ts +TRANSLATIONS += translations/harbour-tooter-nl_BE.ts +TRANSLATIONS += translations/harbour-tooter-oc.ts +TRANSLATIONS += translations/harbour-tooter-pl.ts +TRANSLATIONS += translations/harbour-tooter-ru.ts +TRANSLATIONS += translations/harbour-tooter-sr.ts +TRANSLATIONS += translations/harbour-tooter-sv.ts diff --git a/qml/lib/Worker.js b/qml/lib/Worker.js index 2f3e49c..889f79d 100644 --- a/qml/lib/Worker.js +++ b/qml/lib/Worker.js @@ -206,6 +206,7 @@ function getDate(dateStr){ return new Date(ts.getFullYear(), ts.getMonth(), ts.getDate(), 0, 0, 0) } function parseToot (data){ + var i = 0; var item = {}; item['type'] = "toot" @@ -226,11 +227,13 @@ function parseToot (data){ item['status_spoiler_text'] = data["spoiler_text"] item['status_visibility'] = data["visibility"] - 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_sensitive'] = data["reblog"]["sensitive"] + item['emojis'] = data["reblog"]["emojis"]; item = parseAccounts(item, "", data['reblog']["account"]) item = parseAccounts(item, "reblog_", data["account"]) } else { @@ -240,7 +243,9 @@ function parseToot (data){ item['attachments'] = []; - for(var i = 0; i < data['media_attachments'].length ; i++){ + + + for(i = 0; i < data['media_attachments'].length ; i++){ var attachments = data['media_attachments'][i]; item['content'] = item['content'].replaceAll(attachments['text_url'], '') var tmp = { @@ -253,7 +258,7 @@ function parseToot (data){ item['attachments'].push(tmp) } if(item['status_reblog']){ - for(var i = 0; i < data['reblog']['media_attachments'].length ; i++){ + for(i = 0; i < data['reblog']['media_attachments'].length ; i++){ var attachments = data['reblog']['media_attachments'][i]; item['content'] = item['content'].replaceAll(attachments['text_url'], '') var tmp = { @@ -265,5 +270,21 @@ function parseToot (data){ item['attachments'].push(tmp) } } + return addEmojis(item, data); +} + +function addEmojis(item, data){ + var emoji, i; + for (i = 0; i < data["emojis"].length; i++){ + emoji = data["emojis"][i]; + item['content'] = item['content'].replaceAll(":"+emoji.shortcode+":", "") + //console.log(JSON.stringify(data["emojis"][i])) + } + if (data["reblog"]) + for (i = 0; i < data["reblog"]["emojis"].length; i++){ + emoji = data["reblog"]["emojis"][i]; + item['content'] = item['content'].replaceAll(":"+emoji.shortcode+":", "") + } + return item; } diff --git a/qml/pages/components/VisualContainer.qml b/qml/pages/components/VisualContainer.qml index 4e4355b..9f649d9 100644 --- a/qml/pages/components/VisualContainer.qml +++ b/qml/pages/components/VisualContainer.qml @@ -107,7 +107,7 @@ BackgroundItem { right: parent.right } } - Label { + Text { id: lblContent anchors { left: miniHeader.left @@ -144,9 +144,9 @@ BackgroundItem { } } text: content.replace(new RegExp(" 0.2.7-0 -- Minor bugfix +- Added emoji custom support +- Bugfix: missing media on boosted toots * Thu May 24 2018 Dusko Angirevic 0.2.6-0 - Minor bugfix @@ -25,7 +26,7 @@ - Added Copy URL option - Privacy option in the conversation is now inherited by toot in the thread -* Thu Oct 10 2017 Dusko Angirevic 0.2.1-0 +* Tue Oct 10 2017 Dusko Angirevic 0.2.1-0 - Added bugs for later (merging branches and contributions) * Thu Jul 20 2017 Dusko Angirevic 0.2.0-0 diff --git a/rpm/harbour-tooter.yaml b/rpm/harbour-tooter.yaml index a872ad8..9442878 100644 --- a/rpm/harbour-tooter.yaml +++ b/rpm/harbour-tooter.yaml @@ -33,14 +33,17 @@ PkgConfigBR: # Runtime dependencies which are not automatically detected Requires: - - sailfishsilica-qt5 >= 0.10.9 + - sailfishsilica-qt5 >= 0.10.9 +# - libsailfishapp-launcher + # All installed files Files: - - '%{_bindir}' - - '%{_datadir}/%{name}' - - '%{_datadir}/applications/%{name}.desktop' - - '%{_datadir}/icons/hicolor/*/apps/%{name}.png' + - '%{_bindir}' + - '%{_datadir}/%{name}' + - '%{_datadir}/applications/%{name}.desktop' + - '%{_datadir}/icons/hicolor/*/apps/%{name}.png' + # For more information about yaml and what's supported in Sailfish OS # build system, please see https://wiki.merproject.org/wiki/Spectacle diff --git a/translations/harbour-tooter-de.ts b/translations/harbour-tooter-de.ts index 4d23ebc..a62d8e8 100644 --- a/translations/harbour-tooter-de.ts +++ b/translations/harbour-tooter-de.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-el.ts b/translations/harbour-tooter-el.ts index ad7a6e5..0c35388 100644 --- a/translations/harbour-tooter-el.ts +++ b/translations/harbour-tooter-el.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-es.ts b/translations/harbour-tooter-es.ts index 28da234..cc72ebf 100644 --- a/translations/harbour-tooter-es.ts +++ b/translations/harbour-tooter-es.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-fi.ts b/translations/harbour-tooter-fi.ts index 85e1dd8..66d46dd 100644 --- a/translations/harbour-tooter-fi.ts +++ b/translations/harbour-tooter-fi.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-fr.ts b/translations/harbour-tooter-fr.ts index 489e6df..0e1913a 100644 --- a/translations/harbour-tooter-fr.ts +++ b/translations/harbour-tooter-fr.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-nl.ts b/translations/harbour-tooter-nl.ts index c394b64..b79c6be 100644 --- a/translations/harbour-tooter-nl.ts +++ b/translations/harbour-tooter-nl.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-nl_BE.ts b/translations/harbour-tooter-nl_BE.ts index 8f45774..3926b98 100644 --- a/translations/harbour-tooter-nl_BE.ts +++ b/translations/harbour-tooter-nl_BE.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-oc.ts b/translations/harbour-tooter-oc.ts index 894d702..4f83e20 100644 --- a/translations/harbour-tooter-oc.ts +++ b/translations/harbour-tooter-oc.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-pl.ts b/translations/harbour-tooter-pl.ts index 1e49465..4358085 100644 --- a/translations/harbour-tooter-pl.ts +++ b/translations/harbour-tooter-pl.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-ru.ts b/translations/harbour-tooter-ru.ts index 5b4feb3..a781273 100644 --- a/translations/harbour-tooter-ru.ts +++ b/translations/harbour-tooter-ru.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-sr.ts b/translations/harbour-tooter-sr.ts index d76baee..0c5165d 100644 --- a/translations/harbour-tooter-sr.ts +++ b/translations/harbour-tooter-sr.ts @@ -1,6 +1,6 @@ - + API diff --git a/translations/harbour-tooter-sv.ts b/translations/harbour-tooter-sv.ts index 0137394..449f492 100644 --- a/translations/harbour-tooter-sv.ts +++ b/translations/harbour-tooter-sv.ts @@ -1,6 +1,6 @@ - + API