updates normalizer for proper user handling and adds support for friends tl via mastoapi

This commit is contained in:
Henry Jameson 2019-03-07 19:49:41 +02:00
parent 09736691ea
commit 2e59ab738b
2 changed files with 14 additions and 5 deletions

View file

@ -1,6 +1,5 @@
/* eslint-env browser */ /* eslint-env browser */
const LOGIN_URL = '/api/account/verify_credentials.json' 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 ALL_FOLLOWING_URL = '/api/qvitter/allfollowing'
const PUBLIC_TIMELINE_URL = '/api/statuses/public_timeline.json' const PUBLIC_TIMELINE_URL = '/api/statuses/public_timeline.json'
const PUBLIC_AND_EXTERNAL_TIMELINE_URL = '/api/statuses/public_and_external_timeline.json' const PUBLIC_AND_EXTERNAL_TIMELINE_URL = '/api/statuses/public_and_external_timeline.json'
@ -43,6 +42,7 @@ const DENY_USER_URL = '/api/pleroma/friendships/deny'
const SUGGESTIONS_URL = '/api/v1/suggestions' const SUGGESTIONS_URL = '/api/v1/suggestions'
const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites' const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites'
const MASTODON_USER_HOME_TIMELINE_URL = '/api/v1/timelines/home'
import { each, map } from 'lodash' import { each, map } from 'lodash'
import { parseStatus, parseUser, parseNotification } from '../entity_normalizer/entity_normalizer.service.js' import { parseStatus, parseUser, parseNotification } from '../entity_normalizer/entity_normalizer.service.js'
@ -342,7 +342,7 @@ const setUserMute = ({id, credentials, muted = true}) => {
const fetchTimeline = ({timeline, credentials, since = false, until = false, userId = false, tag = false}) => { const fetchTimeline = ({timeline, credentials, since = false, until = false, userId = false, tag = false}) => {
const timelineUrls = { const timelineUrls = {
public: PUBLIC_TIMELINE_URL, public: PUBLIC_TIMELINE_URL,
friends: FRIENDS_TIMELINE_URL, friends: MASTODON_USER_HOME_TIMELINE_URL,
mentions: MENTIONS_URL, mentions: MENTIONS_URL,
dms: DM_TIMELINE_URL, dms: DM_TIMELINE_URL,
notifications: QVITTER_USER_NOTIFICATIONS_URL, notifications: QVITTER_USER_NOTIFICATIONS_URL,

View file

@ -60,9 +60,18 @@ export const parseUser = (data) => {
if (data.pleroma) { if (data.pleroma) {
const pleroma = data.pleroma const pleroma = data.pleroma
output.follows_you = pleroma.follows_you const relationship = pleroma.relationship
output.statusnet_blocking = pleroma.statusnet_blocking output.follows_you = relationship.followed_by
output.muted = pleroma.muted output.statusnet_blocking = relationship.blocking
output.muted = relationship.muting
output.following = relationship.following
// Unused:
// domain_blocking
// endorsed
// muting_notifications
// requested
// showing_reblogs
} }
// Missing, trying to recover // Missing, trying to recover