Rename legacy PleromaFE Chat functionality to "Shout"

This commit is contained in:
Mark Felder 2020-08-03 18:44:35 -05:00 committed by Mark Felder
parent 7bd18cda64
commit 0604b1d5b7
15 changed files with 52 additions and 53 deletions

View file

@ -255,12 +255,12 @@ const api = {
initializeSocket ({ dispatch, commit, state, rootState }) {
// Set up websocket connection
const token = state.wsToken
if (rootState.instance.chatAvailable && typeof token !== 'undefined' && state.socket === null) {
if (rootState.instance.shoutAvailable && typeof token !== 'undefined' && state.socket === null) {
const socket = new Socket('/socket', { params: { token } })
socket.connect()
commit('setSocket', socket)
dispatch('initializeChat', socket)
dispatch('initializeShout', socket)
}
},
disconnectFromSocket ({ commit, state }) {

View file

@ -19,7 +19,7 @@ const defaultState = {
defaultBanner: '/images/banner.png',
background: '/static/aurora_borealis.jpg',
collapseMessageWithSubject: false,
disableChat: false,
disableShout: false,
greentext: false,
hideFilteredStatuses: false,
hideMutedPosts: false,
@ -57,7 +57,7 @@ const defaultState = {
knownDomains: [],
// Feature-set, apparently, not everything here is reported...
chatAvailable: false,
shoutAvailable: false,
pleromaChatMessagesAvailable: false,
gopherAvailable: false,
mediaProxyAvailable: false,
@ -107,7 +107,7 @@ const instance = {
case 'name':
dispatch('setPageTitle')
break
case 'chatAvailable':
case 'shoutAvailable':
if (value) {
dispatch('initializeSocket')
}

View file

@ -1,4 +1,4 @@
const chat = {
const shout = {
state: {
messages: [],
channel: { state: '' }
@ -16,9 +16,8 @@ const chat = {
}
},
actions: {
initializeChat (store, socket) {
const channel = socket.channel('chat:public')
initializeShout (store, socket) {
const channel = socket.channel('shout:public')
channel.on('new_msg', (msg) => {
store.commit('addMessage', msg)
})
@ -31,4 +30,4 @@ const chat = {
}
}
export default chat
export default shout

View file

@ -531,7 +531,7 @@ const users = {
if (user.token) {
store.dispatch('setWsToken', user.token)
// Initialize the chat socket.
// Initialize the shout socket.
store.dispatch('initializeSocket')
}