Merge remote-tracking branch 'upstream/develop' into feature/theming2
* upstream/develop: (60 commits) whoops whoops DM timeline: stream new statuses update-japanese-translation Add actual user search. incorporate most translation changes from MR 368 update french translation Always show dm panel. Add direct message tab. api service url remove deploy stage remove deploy stage updated and completed German translation On logout switch to public timeline. minor modification of Chinese translation update Chinese translation Add Chinese language Fix posting. Put oauth text into description. Display OAuth login on login form button. ...
This commit is contained in:
commit
a806d43f05
56 changed files with 2963 additions and 383 deletions
|
@ -5,7 +5,7 @@ const browserLocale = (window.navigator.language || 'en').split('-')[0]
|
|||
|
||||
const defaultState = {
|
||||
colors: {},
|
||||
collapseMessageWithSubject: false,
|
||||
collapseMessageWithSubject: undefined, // instance default
|
||||
hideAttachments: false,
|
||||
hideAttachmentsInConv: false,
|
||||
hideNsfw: true,
|
||||
|
@ -25,7 +25,9 @@ const defaultState = {
|
|||
},
|
||||
muteWords: [],
|
||||
highlight: {},
|
||||
interfaceLanguage: browserLocale
|
||||
interfaceLanguage: browserLocale,
|
||||
scopeCopy: undefined, // instance default
|
||||
subjectLineBehavior: undefined // instance default
|
||||
}
|
||||
|
||||
const config = {
|
||||
|
|
|
@ -18,7 +18,12 @@ const defaultState = {
|
|||
scopeOptionsEnabled: true,
|
||||
formattingOptionsEnabled: false,
|
||||
collapseMessageWithSubject: false,
|
||||
hidePostStats: false,
|
||||
hideUserStats: false,
|
||||
disableChat: false,
|
||||
scopeCopy: true,
|
||||
subjectLineBehavior: 'email',
|
||||
loginMethod: 'password',
|
||||
|
||||
// Nasty stuff
|
||||
pleromaBackend: true,
|
||||
|
|
18
src/modules/oauth.js
Normal file
18
src/modules/oauth.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
const oauth = {
|
||||
state: {
|
||||
client_id: false,
|
||||
client_secret: false,
|
||||
token: false
|
||||
},
|
||||
mutations: {
|
||||
setClientData (state, data) {
|
||||
state.client_id = data.client_id
|
||||
state.client_secret = data.client_secret
|
||||
},
|
||||
setToken (state, token) {
|
||||
state.token = token
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default oauth
|
|
@ -41,7 +41,8 @@ export const defaultState = {
|
|||
own: emptyTl(),
|
||||
publicAndExternal: emptyTl(),
|
||||
friends: emptyTl(),
|
||||
tag: emptyTl()
|
||||
tag: emptyTl(),
|
||||
dms: emptyTl()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,6 +172,14 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
|
|||
sortTimeline(mentions)
|
||||
}
|
||||
}
|
||||
if (status.visibility === 'direct') {
|
||||
const dms = state.timelines.dms
|
||||
|
||||
mergeOrAdd(dms.statuses, dms.statusesObject, status)
|
||||
dms.newStatusCount += 1
|
||||
|
||||
sortTimeline(dms)
|
||||
}
|
||||
}
|
||||
|
||||
// Decide if we should treat the status as new for this timeline.
|
||||
|
|
|
@ -82,24 +82,26 @@ const users = {
|
|||
},
|
||||
logout (store) {
|
||||
store.commit('clearCurrentUser')
|
||||
store.commit('setToken', false)
|
||||
store.dispatch('stopFetching', 'friends')
|
||||
store.commit('setBackendInteractor', backendInteractorService())
|
||||
},
|
||||
loginUser (store, userCredentials) {
|
||||
loginUser (store, accessToken) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const commit = store.commit
|
||||
commit('beginLogin')
|
||||
store.rootState.api.backendInteractor.verifyCredentials(userCredentials)
|
||||
store.rootState.api.backendInteractor.verifyCredentials(accessToken)
|
||||
.then((response) => {
|
||||
if (response.ok) {
|
||||
response.json()
|
||||
.then((user) => {
|
||||
user.credentials = userCredentials
|
||||
// user.credentials = userCredentials
|
||||
user.credentials = accessToken
|
||||
commit('setCurrentUser', user)
|
||||
commit('addNewUsers', [user])
|
||||
|
||||
// Set our new backend interactor
|
||||
commit('setBackendInteractor', backendInteractorService(userCredentials))
|
||||
commit('setBackendInteractor', backendInteractorService(accessToken))
|
||||
|
||||
if (user.token) {
|
||||
store.dispatch('initializeSocket', user.token)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue