diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/api.js | 4 | ||||
| -rw-r--r-- | src/modules/instance.js | 5 | ||||
| -rw-r--r-- | src/modules/shout.js (renamed from src/modules/chat.js) | 7 | ||||
| -rw-r--r-- | src/modules/users.js | 2 |
4 files changed, 8 insertions, 10 deletions
diff --git a/src/modules/api.js b/src/modules/api.js index 8654b90a..54f94356 100644 --- a/src/modules/api.js +++ b/src/modules/api.js @@ -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 }) { diff --git a/src/modules/instance.js b/src/modules/instance.js index 96de73ca..539b9c66 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -19,7 +19,6 @@ const defaultState = { defaultBanner: '/images/banner.png', background: '/static/aurora_borealis.jpg', collapseMessageWithSubject: false, - disableChat: false, greentext: false, hideFilteredStatuses: false, hideMutedPosts: false, @@ -57,7 +56,7 @@ const defaultState = { knownDomains: [], // Feature-set, apparently, not everything here is reported... - chatAvailable: false, + shoutAvailable: false, pleromaChatMessagesAvailable: false, gopherAvailable: false, mediaProxyAvailable: false, @@ -107,7 +106,7 @@ const instance = { case 'name': dispatch('setPageTitle') break - case 'chatAvailable': + case 'shoutAvailable': if (value) { dispatch('initializeSocket') } diff --git a/src/modules/chat.js b/src/modules/shout.js index ffeb272b..507a4d83 100644 --- a/src/modules/chat.js +++ b/src/modules/shout.js @@ -1,4 +1,4 @@ -const chat = { +const shout = { state: { messages: [], channel: { state: '' } @@ -16,9 +16,8 @@ const chat = { } }, actions: { - initializeChat (store, socket) { + initializeShout (store, socket) { const channel = socket.channel('chat:public') - channel.on('new_msg', (msg) => { store.commit('addMessage', msg) }) @@ -31,4 +30,4 @@ const chat = { } } -export default chat +export default shout diff --git a/src/modules/users.js b/src/modules/users.js index 8a764a16..2b416f94 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -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') } |
