Commit 2af47806 authored by Haelwenn's avatar Haelwenn

Add ability to bookmark posts

parent 260de857
Pipeline #22862 passed with stage
in 1 minute and 15 seconds
......@@ -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;
......
......@@ -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)
}
}
}
......
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