#436 - merge develop

This commit is contained in:
dave 2019-04-10 12:54:33 -04:00
commit 40e9eebf91
2 changed files with 13 additions and 10 deletions

View file

@ -171,9 +171,10 @@ const getCustomEmoji = async ({ store }) => {
try { try {
const res = await window.fetch('/api/pleroma/emoji.json') const res = await window.fetch('/api/pleroma/emoji.json')
if (res.ok) { if (res.ok) {
const values = await res.json() const result = await res.json()
const values = Array.isArray(result) ? Object.assign({}, ...result) : result
const emoji = Object.keys(values).map((key) => { const emoji = Object.keys(values).map((key) => {
return { shortcode: key, image_url: values[key] } return { shortcode: key, image_url: values[key].image_url || values[key] }
}) })
store.dispatch('setInstanceOption', { name: 'customEmoji', value: emoji }) store.dispatch('setInstanceOption', { name: 'customEmoji', value: emoji })
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: true }) store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: true })

View file

@ -189,8 +189,16 @@ export const parseStatus = (data) => {
output.statusnet_html = addEmojis(data.content, data.emojis) output.statusnet_html = addEmojis(data.content, data.emojis)
// Not exactly the same but works? if (data.pleroma) {
const { pleroma } = data
output.text = pleroma.content ? data.pleroma.content['text/plain'] : data.content
output.summary = pleroma.spoiler_text ? data.pleroma.spoiler_text['text/plain'] : data.spoiler_text
output.statusnet_conversation_id = data.pleroma.conversation_id
output.is_local = pleroma.local
} else {
output.text = data.content output.text = data.content
output.summary = data.spoiler_text
}
output.in_reply_to_status_id = data.in_reply_to_id output.in_reply_to_status_id = data.in_reply_to_id
output.in_reply_to_user_id = data.in_reply_to_account_id output.in_reply_to_user_id = data.in_reply_to_account_id
@ -198,18 +206,12 @@ export const parseStatus = (data) => {
// Missing!! fix in UI? // Missing!! fix in UI?
// output.in_reply_to_screen_name = ??? // output.in_reply_to_screen_name = ???
// It breaks the conversation when combined with notification
// output.statusnet_conversation_id = data.id
if (output.type === 'retweet') { if (output.type === 'retweet') {
output.retweeted_status = parseStatus(data.reblog) output.retweeted_status = parseStatus(data.reblog)
} }
output.summary = data.spoiler_text
output.summary_html = addEmojis(data.spoiler_text, data.emojis) output.summary_html = addEmojis(data.spoiler_text, data.emojis)
output.external_url = data.url output.external_url = data.url
output.is_local = data.pleroma.local
} else { } else {
output.favorited = data.favorited output.favorited = data.favorited
output.fave_num = data.fave_num output.fave_num = data.fave_num