aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-03-07 20:16:35 +0200
committerHenry Jameson <me@hjkos.com>2019-03-07 20:16:35 +0200
commit8522063b2c4a35f0926517a3b75376c81131dd79 (patch)
tree3af537226350c67dab538eeacd1b28afb59b3bc7 /src
parent09736691ea79e66c9e41d6f723384769088eb2d0 (diff)
switch public and TWKN to MastoAPI
Diffstat (limited to 'src')
-rw-r--r--src/services/api/api.service.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 2de87026..f9b556c0 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -2,8 +2,6 @@
const LOGIN_URL = '/api/account/verify_credentials.json'
const FRIENDS_TIMELINE_URL = '/api/statuses/friends_timeline.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'
@@ -43,6 +41,7 @@ const DENY_USER_URL = '/api/pleroma/friendships/deny'
const SUGGESTIONS_URL = '/api/v1/suggestions'
const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites'
+const MASTODON_PUBLIC_TIMELINE = '/api/v1/timelines/public'
import { each, map } from 'lodash'
import { parseStatus, parseUser, parseNotification } from '../entity_normalizer/entity_normalizer.service.js'
@@ -341,12 +340,12 @@ const setUserMute = ({id, credentials, muted = true}) => {
const fetchTimeline = ({timeline, credentials, since = false, until = false, userId = false, tag = false}) => {
const timelineUrls = {
- public: PUBLIC_TIMELINE_URL,
+ public: MASTODON_PUBLIC_TIMELINE,
friends: FRIENDS_TIMELINE_URL,
mentions: MENTIONS_URL,
dms: DM_TIMELINE_URL,
notifications: QVITTER_USER_NOTIFICATIONS_URL,
- 'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL,
+ 'publicAndExternal': MASTODON_PUBLIC_TIMELINE,
user: QVITTER_USER_TIMELINE_URL,
media: QVITTER_USER_TIMELINE_URL,
favorites: MASTODON_USER_FAVORITES_TIMELINE_URL,
@@ -372,6 +371,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])