support for CW/Subject. fix replies.
This commit is contained in:
parent
80a7035154
commit
af36f4915a
2 changed files with 12 additions and 8 deletions
|
@ -276,26 +276,26 @@ const fetchFollowRequests = ({credentials}) => {
|
||||||
const fetchConversation = ({id, credentials}) => {
|
const fetchConversation = ({id, credentials}) => {
|
||||||
let url = `${CONVERSATION_URL}/${id}.json?count=100`
|
let url = `${CONVERSATION_URL}/${id}.json?count=100`
|
||||||
return fetch(url, { headers: authHeaders(credentials) })
|
return fetch(url, { headers: authHeaders(credentials) })
|
||||||
.then((data) => data.json())
|
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data.ok) {
|
if (data.ok) {
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
throw new Error('Error fetching timeline')
|
throw new Error('Error fetching timeline', data)
|
||||||
})
|
})
|
||||||
|
.then((data) => data.json())
|
||||||
.then((data) => data.map(parseStatus))
|
.then((data) => data.map(parseStatus))
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchStatus = ({id, credentials}) => {
|
const fetchStatus = ({id, credentials}) => {
|
||||||
let url = `${STATUS_URL}/${id}.json`
|
let url = `${STATUS_URL}/${id}.json`
|
||||||
return fetch(url, { headers: authHeaders(credentials) })
|
return fetch(url, { headers: authHeaders(credentials) })
|
||||||
.then((data) => data.json())
|
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data.ok) {
|
if (data.ok) {
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
throw new Error('Error fetching timeline')
|
throw new Error('Error fetching timeline', data)
|
||||||
})
|
})
|
||||||
|
.then((data) => data.json())
|
||||||
.then((data) => parseStatus(data))
|
.then((data) => parseStatus(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
|
||||||
if (data.ok) {
|
if (data.ok) {
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
throw new Error('Error fetching timeline')
|
throw new Error('Error fetching timeline', data)
|
||||||
})
|
})
|
||||||
.then((data) => data.json())
|
.then((data) => data.json())
|
||||||
.then((data) => data.map(isNotifications ? parseNotification : parseStatus))
|
.then((data) => data.map(isNotifications ? parseNotification : parseStatus))
|
||||||
|
|
|
@ -126,7 +126,7 @@ export const parseStatus = (data) => {
|
||||||
output.text = data.content
|
output.text = data.content
|
||||||
|
|
||||||
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_user_id
|
output.in_reply_to_user_id = data.in_reply_to_account_id
|
||||||
|
|
||||||
// Not exactly the same but works
|
// Not exactly the same but works
|
||||||
output.statusnet_conversation_id = data.id
|
output.statusnet_conversation_id = data.id
|
||||||
|
@ -134,6 +134,8 @@ export const parseStatus = (data) => {
|
||||||
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
|
||||||
} else {
|
} else {
|
||||||
output.favorited = data.favorited
|
output.favorited = data.favorited
|
||||||
output.fave_num = data.fave_num
|
output.fave_num = data.fave_num
|
||||||
|
@ -158,14 +160,16 @@ export const parseStatus = (data) => {
|
||||||
output.statusnet_html = data.statusnet_html
|
output.statusnet_html = data.statusnet_html
|
||||||
output.text = data.text
|
output.text = data.text
|
||||||
|
|
||||||
output.in_reply_to_status_id = data.in_reply_to_id
|
output.in_reply_to_status_id = data.in_reply_to_status_id
|
||||||
output.in_reply_to_user_id = data.in_reply_to_account_id
|
output.in_reply_to_user_id = data.in_reply_to_user_id
|
||||||
|
|
||||||
output.statusnet_conversation_id = data.statusnet_conversation_id
|
output.statusnet_conversation_id = data.statusnet_conversation_id
|
||||||
|
|
||||||
if (output.type === 'retweet') {
|
if (output.type === 'retweet') {
|
||||||
output.retweeted_status = parseStatus(data.retweeted_status)
|
output.retweeted_status = parseStatus(data.retweeted_status)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output.summary = data.summary
|
||||||
}
|
}
|
||||||
|
|
||||||
output.id = String(data.id)
|
output.id = String(data.id)
|
||||||
|
|
Loading…
Reference in a new issue