Basic mention support.
I still have to think about how to integrate them in the state system...
This commit is contained in:
parent
8cd1c690ca
commit
6c2941dba0
8 changed files with 64 additions and 4 deletions
|
@ -10,6 +10,7 @@ const STATUS_UPDATE_URL = '/api/statuses/update.json'
|
|||
const STATUS_URL = '/api/statuses/show'
|
||||
const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload'
|
||||
const CONVERSATION_URL = '/api/statusnet/conversation'
|
||||
const MENTIONS_URL = '/api/statuses/mentions.json'
|
||||
|
||||
const oldfetch = window.fetch
|
||||
|
||||
|
@ -27,6 +28,12 @@ const authHeaders = (user) => {
|
|||
}
|
||||
}
|
||||
|
||||
const fetchMentions = ({username, sinceId = 0, credentials}) => {
|
||||
let url = `${MENTIONS_URL}?since_id=${sinceId}&screen_name=${username}`
|
||||
return fetch(url, { headers: authHeaders(credentials) })
|
||||
.then((data) => data.json())
|
||||
}
|
||||
|
||||
const fetchConversation = ({id, credentials}) => {
|
||||
let url = `${CONVERSATION_URL}/${id}.json?count=100`
|
||||
return fetch(url, { headers: authHeaders(credentials) })
|
||||
|
@ -120,6 +127,7 @@ const apiService = {
|
|||
fetchTimeline,
|
||||
fetchConversation,
|
||||
fetchStatus,
|
||||
fetchMentions,
|
||||
favorite,
|
||||
unfavorite,
|
||||
retweet,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue