# Conflicts: # static/fontello.jsonfeat/virtual-scrolling-timeline
commit
215662afde
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"presets": ["es2015", "stage-2", "env"],
|
"presets": ["@babel/preset-env"],
|
||||||
"plugins": ["transform-runtime", "lodash", "transform-vue-jsx"],
|
"plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-transform-vue-jsx"],
|
||||||
"comments": false
|
"comments": false
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
const NavPanel = {
|
const NavPanel = {
|
||||||
created () {
|
created () {
|
||||||
if (this.currentUser && this.currentUser.locked) {
|
if (this.currentUser && this.currentUser.locked) {
|
||||||
this.$store.dispatch('startFetchingFollowRequest')
|
this.$store.dispatch('startFetchingFollowRequest')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: mapState({
|
||||||
currentUser () {
|
currentUser: state => state.users.currentUser,
|
||||||
return this.$store.state.users.currentUser
|
chat: state => state.chat.channel,
|
||||||
},
|
followRequestCount: state => state.api.followRequests.length,
|
||||||
chat () {
|
privateMode: state => state.instance.private,
|
||||||
return this.$store.state.chat.channel
|
federating: state => state.instance.federating
|
||||||
},
|
})
|
||||||
followRequestCount () {
|
|
||||||
return this.$store.state.api.followRequests.length
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NavPanel
|
export default NavPanel
|
||||||
|
@ -1,230 +1,39 @@
|
|||||||
import apiService from '../api/api.service.js'
|
import apiService, { getMastodonSocketURI, ProcessedWS } from '../api/api.service.js'
|
||||||
import timelineFetcherService from '../timeline_fetcher/timeline_fetcher.service.js'
|
import timelineFetcherService from '../timeline_fetcher/timeline_fetcher.service.js'
|
||||||
import notificationsFetcher from '../notifications_fetcher/notifications_fetcher.service.js'
|
import notificationsFetcher from '../notifications_fetcher/notifications_fetcher.service.js'
|
||||||
import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
|
import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
|
||||||
|
|
||||||
const backendInteractorService = credentials => {
|
const backendInteractorService = credentials => ({
|
||||||
const fetchStatus = ({ id }) => {
|
startFetchingTimeline ({ timeline, store, userId = false, tag }) {
|
||||||
return apiService.fetchStatus({ id, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchConversation = ({ id }) => {
|
|
||||||
return apiService.fetchConversation({ id, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchFriends = ({ id, maxId, sinceId, limit }) => {
|
|
||||||
return apiService.fetchFriends({ id, maxId, sinceId, limit, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
const exportFriends = ({ id }) => {
|
|
||||||
return apiService.exportFriends({ id, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchFollowers = ({ id, maxId, sinceId, limit }) => {
|
|
||||||
return apiService.fetchFollowers({ id, maxId, sinceId, limit, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchUser = ({ id }) => {
|
|
||||||
return apiService.fetchUser({ id, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchUserRelationship = ({ id }) => {
|
|
||||||
return apiService.fetchUserRelationship({ id, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
const followUser = ({ id, reblogs }) => {
|
|
||||||
return apiService.followUser({ credentials, id, reblogs })
|
|
||||||
}
|
|
||||||
|
|
||||||
const unfollowUser = (id) => {
|
|
||||||
return apiService.unfollowUser({ credentials, id })
|
|
||||||
}
|
|
||||||
|
|
||||||
const blockUser = (id) => {
|
|
||||||
return apiService.blockUser({ credentials, id })
|
|
||||||
}
|
|
||||||
|
|
||||||
const unblockUser = (id) => {
|
|
||||||
return apiService.unblockUser({ credentials, id })
|
|
||||||
}
|
|
||||||
|
|
||||||
const approveUser = (id) => {
|
|
||||||
return apiService.approveUser({ credentials, id })
|
|
||||||
}
|
|
||||||
|
|
||||||
const denyUser = (id) => {
|
|
||||||
return apiService.denyUser({ credentials, id })
|
|
||||||
}
|
|
||||||
|
|
||||||
const startFetchingTimeline = ({ timeline, store, userId = false, tag }) => {
|
|
||||||
return timelineFetcherService.startFetching({ timeline, store, credentials, userId, tag })
|
return timelineFetcherService.startFetching({ timeline, store, credentials, userId, tag })
|
||||||
}
|
},
|
||||||
|
|
||||||
const startFetchingNotifications = ({ store }) => {
|
startFetchingNotifications ({ store }) {
|
||||||
return notificationsFetcher.startFetching({ store, credentials })
|
return notificationsFetcher.startFetching({ store, credentials })
|
||||||
}
|
},
|
||||||
|
|
||||||
const startFetchingFollowRequest = ({ store }) => {
|
|
||||||
return followRequestFetcher.startFetching({ store, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
const tagUser = ({ screen_name }, tag) => {
|
|
||||||
return apiService.tagUser({ screen_name, tag, credentials })
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
fetchAndUpdateNotifications ({ store }) {
|
||||||
const untagUser = ({ screen_name }, tag) => {
|
return notificationsFetcher.fetchAndUpdate({ store, credentials })
|
||||||
return apiService.untagUser({ screen_name, tag, credentials })
|
},
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
startFetchingFollowRequest ({ store }) {
|
||||||
const addRight = ({ screen_name }, right) => {
|
return followRequestFetcher.startFetching({ store, credentials })
|
||||||
return apiService.addRight({ screen_name, right, credentials })
|
},
|
||||||
}
|
|
||||||
|
startUserSocket ({ store }) {
|
||||||
// eslint-disable-next-line camelcase
|
const serv = store.rootState.instance.server.replace('http', 'ws')
|
||||||
const deleteRight = ({ screen_name }, right) => {
|
const url = serv + getMastodonSocketURI({ credentials, stream: 'user' })
|
||||||
return apiService.deleteRight({ screen_name, right, credentials })
|
return ProcessedWS({ url, id: 'User' })
|
||||||
}
|
},
|
||||||
|
|
||||||
// eslint-disable-next-line camelcase
|
...Object.entries(apiService).reduce((acc, [key, func]) => {
|
||||||
const setActivationStatus = ({ screen_name }, status) => {
|
return {
|
||||||
return apiService.setActivationStatus({ screen_name, status, credentials })
|
...acc,
|
||||||
}
|
[key]: (args) => func({ credentials, ...args })
|
||||||
|
}
|
||||||
// eslint-disable-next-line camelcase
|
}, {}),
|
||||||
const deleteUser = ({ screen_name }) => {
|
|
||||||
return apiService.deleteUser({ screen_name, credentials })
|
verifyCredentials: apiService.verifyCredentials
|
||||||
}
|
})
|
||||||
|
|
||||||
const vote = (pollId, choices) => {
|
|
||||||
return apiService.vote({ credentials, pollId, choices })
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchPoll = (pollId) => {
|
|
||||||
return apiService.fetchPoll({ credentials, pollId })
|
|
||||||
}
|
|
||||||
|
|
||||||
const updateNotificationSettings = ({ settings }) => {
|
|
||||||
return apiService.updateNotificationSettings({ credentials, settings })
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchMutes = () => apiService.fetchMutes({ credentials })
|
|
||||||
const muteUser = (id) => apiService.muteUser({ credentials, id })
|
|
||||||
const unmuteUser = (id) => apiService.unmuteUser({ credentials, id })
|
|
||||||
const subscribeUser = (id) => apiService.subscribeUser({ credentials, id })
|
|
||||||
const unsubscribeUser = (id) => apiService.unsubscribeUser({ credentials, id })
|
|
||||||
const fetchBlocks = () => apiService.fetchBlocks({ credentials })
|
|
||||||
const fetchOAuthTokens = () => apiService.fetchOAuthTokens({ credentials })
|
|
||||||
const revokeOAuthToken = (id) => apiService.revokeOAuthToken({ id, credentials })
|
|
||||||
const fetchPinnedStatuses = (id) => apiService.fetchPinnedStatuses({ credentials, id })
|
|
||||||
const pinOwnStatus = (id) => apiService.pinOwnStatus({ credentials, id })
|
|
||||||
const unpinOwnStatus = (id) => apiService.unpinOwnStatus({ credentials, id })
|
|
||||||
const muteConversation = (id) => apiService.muteConversation({ credentials, id })
|
|
||||||
const unmuteConversation = (id) => apiService.unmuteConversation({ credentials, id })
|
|
||||||
|
|
||||||
const getCaptcha = () => apiService.getCaptcha()
|
|
||||||
const register = (params) => apiService.register({ credentials, params })
|
|
||||||
const updateAvatar = ({ avatar }) => apiService.updateAvatar({ credentials, avatar })
|
|
||||||
const updateBg = ({ background }) => apiService.updateBg({ credentials, background })
|
|
||||||
const updateBanner = ({ banner }) => apiService.updateBanner({ credentials, banner })
|
|
||||||
const updateProfile = ({ params }) => apiService.updateProfile({ credentials, params })
|
|
||||||
|
|
||||||
const importBlocks = (file) => apiService.importBlocks({ file, credentials })
|
|
||||||
const importFollows = (file) => apiService.importFollows({ file, credentials })
|
|
||||||
|
|
||||||
const deleteAccount = ({ password }) => apiService.deleteAccount({ credentials, password })
|
|
||||||
const changeEmail = ({ email, password }) => apiService.changeEmail({ credentials, email, password })
|
|
||||||
const changePassword = ({ password, newPassword, newPasswordConfirmation }) =>
|
|
||||||
apiService.changePassword({ credentials, password, newPassword, newPasswordConfirmation })
|
|
||||||
|
|
||||||
const fetchSettingsMFA = () => apiService.settingsMFA({ credentials })
|
|
||||||
const generateMfaBackupCodes = () => apiService.generateMfaBackupCodes({ credentials })
|
|
||||||
const mfaSetupOTP = () => apiService.mfaSetupOTP({ credentials })
|
|
||||||
const mfaConfirmOTP = ({ password, token }) => apiService.mfaConfirmOTP({ credentials, password, token })
|
|
||||||
const mfaDisableOTP = ({ password }) => apiService.mfaDisableOTP({ credentials, password })
|
|
||||||
|
|
||||||
const fetchFavoritedByUsers = (id) => apiService.fetchFavoritedByUsers({ id })
|
|
||||||
const fetchRebloggedByUsers = (id) => apiService.fetchRebloggedByUsers({ id })
|
|
||||||
const reportUser = (params) => apiService.reportUser({ credentials, ...params })
|
|
||||||
|
|
||||||
const favorite = (id) => apiService.favorite({ id, credentials })
|
|
||||||
const unfavorite = (id) => apiService.unfavorite({ id, credentials })
|
|
||||||
const retweet = (id) => apiService.retweet({ id, credentials })
|
|
||||||
const unretweet = (id) => apiService.unretweet({ id, credentials })
|
|
||||||
const search2 = ({ q, resolve, limit, offset, following }) =>
|
|
||||||
apiService.search2({ credentials, q, resolve, limit, offset, following })
|
|
||||||
const searchUsers = (query) => apiService.searchUsers({ query, credentials })
|
|
||||||
|
|
||||||
const backendInteractorServiceInstance = {
|
|
||||||
fetchStatus,
|
|
||||||
fetchConversation,
|
|
||||||
fetchFriends,
|
|
||||||
exportFriends,
|
|
||||||
fetchFollowers,
|
|
||||||
followUser,
|
|
||||||
unfollowUser,
|
|
||||||
blockUser,
|
|
||||||
unblockUser,
|
|
||||||
fetchUser,
|
|
||||||
fetchUserRelationship,
|
|
||||||
verifyCredentials: apiService.verifyCredentials,
|
|
||||||
startFetchingTimeline,
|
|
||||||
startFetchingNotifications,
|
|
||||||
startFetchingFollowRequest,
|
|
||||||
fetchMutes,
|
|
||||||
muteUser,
|
|
||||||
unmuteUser,
|
|
||||||
subscribeUser,
|
|
||||||
unsubscribeUser,
|
|
||||||
fetchBlocks,
|
|
||||||
fetchOAuthTokens,
|
|
||||||
revokeOAuthToken,
|
|
||||||
fetchPinnedStatuses,
|
|
||||||
pinOwnStatus,
|
|
||||||
unpinOwnStatus,
|
|
||||||
muteConversation,
|
|
||||||
unmuteConversation,
|
|
||||||
tagUser,
|
|
||||||
untagUser,
|
|
||||||
addRight,
|
|
||||||
deleteRight,
|
|
||||||
deleteUser,
|
|
||||||
setActivationStatus,
|
|
||||||
register,
|
|
||||||
getCaptcha,
|
|
||||||
updateAvatar,
|
|
||||||
updateBg,
|
|
||||||
updateBanner,
|
|
||||||
updateProfile,
|
|
||||||
importBlocks,
|
|
||||||
importFollows,
|
|
||||||
deleteAccount,
|
|
||||||
changeEmail,
|
|
||||||
changePassword,
|
|
||||||
fetchSettingsMFA,
|
|
||||||
generateMfaBackupCodes,
|
|
||||||
mfaSetupOTP,
|
|
||||||
mfaConfirmOTP,
|
|
||||||
mfaDisableOTP,
|
|
||||||
approveUser,
|
|
||||||
denyUser,
|
|
||||||
vote,
|
|
||||||
fetchPoll,
|
|
||||||
fetchFavoritedByUsers,
|
|
||||||
fetchRebloggedByUsers,
|
|
||||||
reportUser,
|
|
||||||
favorite,
|
|
||||||
unfavorite,
|
|
||||||
retweet,
|
|
||||||
unretweet,
|
|
||||||
updateNotificationSettings,
|
|
||||||
search2,
|
|
||||||
searchUsers
|
|
||||||
}
|
|
||||||
|
|
||||||
return backendInteractorServiceInstance
|
|
||||||
}
|
|
||||||
|
|
||||||
export default backendInteractorService
|
export default backendInteractorService
|
||||||
|
Loading…
Reference in new issue