diff options
| author | Henry Jameson <me@hjkos.com> | 2019-03-27 22:14:26 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-03-27 22:14:26 +0200 |
| commit | a5e71d1dd1e158978bf36ed01c494628dec2c044 (patch) | |
| tree | 352ee8882143dfba6f5dcefae9f95dab5384d590 /src/services/api/api.service.js | |
| parent | ff18e339cf5c243a77e4035a1348c543ebcbf8d1 (diff) | |
| parent | f6e779a084a858da3461265a9a85ef40a6a433fb (diff) | |
Merge remote-tracking branch 'upstream/develop' into mastoapi/followers
* upstream/develop:
Revert "Merge branch 'revert-987b5162' into 'develop'"
Revert "Merge branch 'mastoapi/friends-tl' into 'develop'"
Add await to login action'
switch direct messages to mastoapi
switch public and TWKN to MastoAPI
Diffstat (limited to 'src/services/api/api.service.js')
| -rw-r--r-- | src/services/api/api.service.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 7de3b743..183334cf 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -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: MASTODON_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]) |
