diff --git a/src/components/status/status.js b/src/components/status/status.js index c01cfe79cc..c52e026a2a 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -353,6 +353,16 @@ const Status = { this.expandingSubject = true } }, + pinStatus () { + this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => { + this.$store.dispatch('updatePinned', status) + }) + }, + unpinStatus () { + this.$store.state.api.backendInteractor.unpinOwnStatus(this.status.id).then((status) => { + this.$store.dispatch('updatePinned', status) + }) + }, replyEnter (id, event) { this.showPreview = true const targetId = id diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 210779723f..0a2562c0fe 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -52,12 +52,18 @@ - - +
+ +
+
+ +
+
+ +
+
+ +
@@ -678,6 +684,10 @@ a.unmute { } } +.button-action-icon { + cursor: pointer; +} + @media all and (max-width: 800px) { .status-el { .retweet-info { diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 4c92d4e153..176e5f4298 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -424,6 +424,10 @@ export const mutations = { newStatus.favoritedBy.push(user) } }, + setPinned (state, { status }) { + const newStatus = state.allStatusesObject[status.id] + newStatus.pinned = status.pinned + }, setRetweeted (state, { status, value }) { const newStatus = state.allStatusesObject[status.id] @@ -533,6 +537,9 @@ const statuses = { rootState.api.backendInteractor.unfavorite(status.id) .then(status => commit('setFavoritedConfirm', { status, user: rootState.users.currentUser })) }, + updatePinned ({ rootState, commit }, status) { + commit('setPinned', { status }) + }, retweet ({ rootState, commit }, status) { // Optimistic retweeting... commit('setRetweeted', { status, value: true }) diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 7a8708d563..97e20b997e 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -211,6 +211,7 @@ export const parseStatus = (data) => { output.summary_html = addEmojis(data.spoiler_text, data.emojis) output.external_url = data.url + output.pinned = data.pinned } else { output.favorited = data.favorited output.fave_num = data.fave_num