@ -1,8 +1,6 @@
/* eslint-env browser */
const LOGIN _URL = '/api/account/verify_credentials.json'
const ALL _FOLLOWING _URL = '/api/qvitter/allfollowing'
const PUBLIC _TIMELINE _URL = '/api/statuses/public_timeline.json'
const PUBLIC _AND _EXTERNAL _TIMELINE _URL = '/api/statuses/public_and_external_timeline.json'
const TAG _TIMELINE _URL = '/api/statusnet/tags/timeline'
const FAVORITE _URL = '/api/favorites/create'
const UNFAVORITE _URL = '/api/favorites/destroy'
@ -10,7 +8,6 @@ const RETWEET_URL = '/api/statuses/retweet'
const UNRETWEET _URL = '/api/statuses/unretweet'
const STATUS _DELETE _URL = '/api/statuses/destroy'
const MENTIONS _URL = '/api/statuses/mentions.json'
const DM _TIMELINE _URL = '/api/statuses/dm_timeline.json'
const FOLLOWING _URL = '/api/friendships/create.json'
const UNFOLLOWING _URL = '/api/friendships/destroy.json'
const REGISTRATION _URL = '/api/account/register.json'
@ -32,6 +29,8 @@ const SUGGESTIONS_URL = '/api/v1/suggestions'
const MASTODON _USER _FAVORITES _TIMELINE _URL = '/api/v1/favourites'
const MASTODON _FOLLOWING _URL = id => ` /api/v1/accounts/ ${ id } /following `
const MASTODON _FOLLOWERS _URL = id => ` /api/v1/accounts/ ${ id } /followers `
const MASTODON _DIRECT _MESSAGES _TIMELINE _URL = '/api/v1/timelines/direct'
const MASTODON _PUBLIC _TIMELINE = '/api/v1/timelines/public'
const MASTODON _USER _HOME _TIMELINE _URL = '/api/v1/timelines/home'
const MASTODON _STATUS _URL = id => ` /api/v1/statuses/ ${ id } `
const MASTODON _STATUS _CONTEXT _URL = id => ` /api/v1/statuses/ ${ id } /context `
@ -355,12 +354,12 @@ const fetchStatus = ({id, credentials}) => {
const fetchTimeline = ( { timeline , credentials , since = false , until = false , userId = false , tag = false , withMuted = false } ) => {
const timelineUrls = {
public : PUBLIC_TIMELINE _URL ,
public : MASTODON_ PUBLIC_TIMELINE ,
friends : MASTODON _USER _HOME _TIMELINE _URL ,
mentions : MENTIONS _URL ,
dms : DM_TIMELINE _URL ,
dms : MASTO DON_DIRECT _ MESSAGES _TIMELINE _URL ,
notifications : QVITTER _USER _NOTIFICATIONS _URL ,
'publicAndExternal' : PUBLIC_AND _EXTERNAL _TIMELINE _URL ,
'publicAndExternal' : MASTODON_PUBLIC _TIMELINE ,
user : MASTODON _USER _TIMELINE _URL ,
media : MASTODON _USER _TIMELINE _URL ,
favorites : MASTODON _USER _FAVORITES _TIMELINE _URL ,
@ -387,6 +386,12 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
if ( timeline === 'media' ) {
params . push ( [ 'only_media' , 1 ] )
}
if ( timeline === 'public' ) {
params . push ( [ 'local' , true ] )
}
if ( timeline === 'public' || timeline === 'publicAndExternal' ) {
params . push ( [ 'only_media' , false ] )
}
params . push ( [ 'count' , 20 ] )
params . push ( [ 'with_muted' , withMuted ] )