...
 
Commits (13)
......@@ -53,15 +53,17 @@ ApplicationWindow {
"instance": Logic.conf['instance'],
"api_user_token": ""
})
}
Logic.api.get('instance', [], function (data) {
if(data.max_toot_chars && data.max_toot_chars > 499) {
Logic.conf['max_toot_chars'] = data.max_toot_chars;
} else {
Logic.conf['max_toot_chars'] = 5000;
}
})
Logic.api.get('instance', [], function (data) {
if(data.max_toot_chars && data.max_toot_chars > 499) {
Logic.conf['max_toot_chars'] = data.max_toot_chars;
} else {
Logic.conf['max_toot_chars'] = 5000;
}
})
} else {
Logic.conf['max_toot_chars'] = 5000;
}
if (Logic.conf['login']) {
//Logic.conf['notificationLastID'] = 0
......
......@@ -108,6 +108,8 @@ var tootParser = function(data) {
ret.sensitive = data.sensitive ? true : false
ret.visibility = data.visibility ? data.visibility : false
ret.bookmarked = data.bookmarked ? true : false
console.log(ret)
} var test = 1;
......@@ -189,7 +191,9 @@ var notifier =
body : item.content,
service : 'toot',
key : item.id
} break;
}
break;
case "follow":
msg = {
urgency : "critical",
......@@ -199,8 +203,9 @@ var notifier =
body : qsTr("followed you"),
service : 'profile',
key : item.account_username
} break;
}
break;
case "reblog":
msg = {
urgency : "low",
......@@ -211,7 +216,9 @@ var notifier =
body : item.content,
service : 'toot',
key : item.id
} break;
}
break;
case "mention":
msg = {
urgency : "critical",
......@@ -225,9 +232,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)
......
......@@ -152,7 +152,9 @@ function addDataToModel(model, mode, items) {
}
model.sync()
} function parseAccounts(collection, prefix, data) {
}
function parseAccounts(collection, prefix, data) {
var res = collection;
res[prefix + 'account_id'] = data["id"]
......@@ -193,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";
......@@ -203,6 +204,15 @@ 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-sailfish"
item['type'] = "pleroma:emoji_reaction";
item['reaction_emoji'] = data.emoji;
break;
default: item['typeIcon'] = "image://theme/icon-s-sailfish"
}
......@@ -254,6 +264,7 @@ function parseToot(data) {
item['favourites_count'] = data["favourites_count"]
item['reblogged'] = data["reblogged"]
item['favourited'] = data["favourited"]
item['bookmarked'] = data["bookmarked"]
item['status_sensitive'] = data["sensitive"]
item['status_spoiler_text'] = data["spoiler_text"]
item['status_visibility'] = data["visibility"]
......@@ -323,7 +334,8 @@ function addEmojis(item, data) {
emoji = data["emojis"][i];
item['content'] = item['content'].replaceAll(
":" + emoji.shortcode + ":",
"<img src=\"" + emoji.static_url + "\" align=\"middle\" width=\"24\" height=\"24\">")
"<img src=\"" + emoji.static_url +
"\" align=\"top\" width=\"2em\" height=\"2em\" alt=" + emoji.shortcode + ">")
//console.log(JSON.stringify(data["emojis"][i]))
}
if(data["reblog"])
......@@ -332,7 +344,8 @@ function addEmojis(item, data) {
emoji = data["reblog"]["emojis"][i];
item['content'] = item['content'].replaceAll(
":" + emoji.shortcode + ":",
"<img src=\"" + emoji.static_url + "\" align=\"middle\" width=\"24\" height=\"24\">")
"<img src=\"" + emoji.static_url +
"\" align=\"top\" width=\"2em\" height=\"2em\" alt=" + emoji.shortcode + ">")
}
return item;
......
......@@ -18,6 +18,7 @@ Page {
property int count_moments
property string profile_background: ""
property string note: ""
property string url: ""
property bool locked: false
property date created_at
......@@ -84,6 +85,9 @@ Page {
case 'note':
note = messageObject.data
break
case 'url':
url = messageObject.data
break
case 'following':
following = messageObject.data
followers_count = followers_count + (following ? 1 : -1)
......@@ -170,40 +174,23 @@ Page {
right: parent.right
}
ExpandingSection {
title: qsTr("Summary")
title: qsTr("Actions & Description")
content.sourceComponent: Column {
spacing: Theme.paddingMedium
anchors.bottomMargin: Theme.paddingLarge
DetailItem {
visible: followers_count ? true : false
label: qsTr("Followers")
value: followers_count
}
DetailItem {
visible: following_count ? true : false
label: qsTr("Following")
value: (following_count)
}
DetailItem {
visible: statuses_count ? true : false
label: qsTr("Statuses")
value: (statuses_count)
}
DetailItem {
visible: favourites_count ? true : false
label: qsTr("Favourites")
value: (favourites_count)
}
// TODO: Put the buttons follow/block/mute buttons in one line
Column {
spacing: Theme.paddingMedium
anchors.horizontalCenter: parent.horizontalCenter
Button {
id: btnFollow
text: (
following ? qsTr("Unfollow") : (
requested ? qsTr("Follow request sent!") : qsTr("Follow")
)
following
? qsTr("Unfollow")
: (requested
? qsTr("Follow request sent!") : qsTr("Follow")
)
)
onClicked: {
var msg = {
......@@ -241,13 +228,31 @@ Page {
worker.sendMessage(msg)
}
}
}
Label {
text: " "
Text {
id: txtDescription
x: Theme.horizontalPageMargin
width: parent.width - ( 2 * Theme.horizontalPageMargin )
font.pixelSize: Theme.fontSizeSmall
color: Theme.secondaryColor
linkColor: Theme.secondaryHighlightColor
wrapMode: Text.Wrap
text: qsTr(note)
anchors {
horizontalCenter: parent.horizontalCenter
}
onLinkActivated: {
// TODO: Reuse the same function as for posts
Qt.openUrlExternally(link);
}
}
Button {
text: qsTr("Open profile in browser")
onClicked: {
Qt.openUrlExternally(url);
}
}
}
}
}
/*ExpandingSection { title: "Tweets" }*/
}
}
......@@ -135,7 +135,7 @@ Page {
anchors.centerIn: parent
id: videoError
width: parent.width - 2*Theme.paddingMedium
wrapMode: Text.WordWrap
wrapMode: Text.Wrap
height: contentHeight
visible: false;
font.pixelSize: Theme.fontSizeSmall;
......
......@@ -41,6 +41,9 @@ Item {
case "follow":
action = qsTr('followed you');
break;
case "pleroma:emoji_reaction":
action = qsTr('reacted with') + reaction_emoji;
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 with') + reaction_emoji;
break;
default:
action = type;
}
......@@ -170,7 +173,7 @@ BackgroundItem {
}
text: content
textFormat: Text.StyledText
textFormat: Text.RichText
linkColor : Theme.highlightColor
wrapMode: Text.Wrap
maximumLineCount: 6
......
......@@ -145,8 +145,8 @@ BackgroundItem {
}
text: content.replace(new RegExp("<a ", 'g'), '<a style="text-decoration: none; color:'+(pressed ? Theme.secondaryColor : Theme.highlightColor)+'" ')
linkColor : Theme.highlightColor
wrapMode: Text.WordWrap
textFormat: Text.StyledText
wrapMode: Text.Wrap
textFormat: Text.RichText
font.pixelSize: Theme.fontSizeSmall
color: (pressed ? Theme.highlightColor : (!highlight ? Theme.primaryColor : Theme.secondaryColor))
Rectangle {
......@@ -170,7 +170,7 @@ BackgroundItem {
width: parent.width
truncationMode: TruncationMode.Fade
color: Theme.highlightColor
wrapMode: Text.WordWrap
wrapMode: Text.Wrap
text: model.status_spoiler_text
}
MouseArea {
......@@ -268,6 +268,31 @@ BackgroundItem {
color: !model.favourited ? Theme.highlightColor : Theme.primaryColor
}
}
MenuItem {
enabled: model.type !== "follow"
text: typeof model.bookmarked !== "undefined" && model.bookmarked ? qsTr("Unbookmark") : qsTr("Bookmark")
onClicked: {
var status = typeof model.bookmarked !== "undefined" && model.bookmarked
worker.sendMessage({
"conf" : Logic.conf,
"params" : [],
"method" : "POST",
"bgAction": true,
"action" : "statuses/"+model.status_id+"/" + (status ? "unbookmark" : "bookmark")
})
model.bookmarked = !model.bookmarked
}
Image {
anchors {
leftMargin: Theme.horizontalPageMargin
left: parent.left
verticalCenter: parent.verticalCenter
}
width: Theme.iconSizeExtraSmall
height: width
source: "image://theme/icon-s-asterisk?" + (!model.bookmarked ? Theme.highlightColor : Theme.primaryColor)
}
}
}
......
* Fri Feb 07 2020 Haelwenn (lanodan) Monnier <contact+kyclos@hacktivis.me> 0.2.1-0
- Fix application initialisation of a new profile
- Fix custom emojis sizing
- Fix wrapping to be able to break words
- Fix renderer to use Qt HTML4 subset rather than HTML-like markup
* Mon Jan 27 2020 Haelwenn (lanodan) Monnier <contact+kyclos@hacktivis.me> 0.2.0-0
- Hide status header on mentions and regular posts
- Use the instance configured character limit or fallback to 5000
......
......@@ -13,7 +13,7 @@ Name: harbour-kyclos
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Kyclos
Version: 0.2.0
Version: 0.2.1
Release: 0
Group: Applications/Internet
License: GPL-3
......
Name: harbour-kyclos
Summary: Kyclos
Version: 0.2.0
Version: 0.2.1
Release: 0
# The contents of the Group field should be one of the groups listed here:
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
......