...
 
Commits (2)
...@@ -108,6 +108,8 @@ var tootParser = function(data) { ...@@ -108,6 +108,8 @@ var tootParser = function(data) {
ret.sensitive = data.sensitive ? true : false ret.sensitive = data.sensitive ? true : false
ret.visibility = data.visibility ? data.visibility : false ret.visibility = data.visibility ? data.visibility : false
ret.bookmarked = data.bookmarked ? true : false
console.log(ret) console.log(ret)
} var test = 1; } var test = 1;
......
...@@ -256,6 +256,7 @@ function parseToot(data) { ...@@ -256,6 +256,7 @@ function parseToot(data) {
item['favourites_count'] = data["favourites_count"] item['favourites_count'] = data["favourites_count"]
item['reblogged'] = data["reblogged"] item['reblogged'] = data["reblogged"]
item['favourited'] = data["favourited"] item['favourited'] = data["favourited"]
item['bookmarked'] = data["bookmarked"]
item['status_sensitive'] = data["sensitive"] item['status_sensitive'] = data["sensitive"]
item['status_spoiler_text'] = data["spoiler_text"] item['status_spoiler_text'] = data["spoiler_text"]
item['status_visibility'] = data["visibility"] item['status_visibility'] = data["visibility"]
......
...@@ -268,6 +268,31 @@ BackgroundItem { ...@@ -268,6 +268,31 @@ BackgroundItem {
color: !model.favourited ? Theme.highlightColor : Theme.primaryColor 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)
}
}
} }
......