aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/App.js9
-rw-r--r--src/App.vue6
-rw-r--r--src/boot/after_store.js2
-rw-r--r--src/boot/routes.js4
-rw-r--r--src/components/account_actions/account_actions.vue25
-rw-r--r--src/components/chat_list/chat_list.vue5
-rw-r--r--src/components/chat_message/chat_message.vue32
-rw-r--r--src/components/domain_mute_card/domain_mute_card.vue4
-rw-r--r--src/components/emoji_input/emoji_input.js60
-rw-r--r--src/components/emoji_input/emoji_input.vue1
-rw-r--r--src/components/extra_buttons/extra_buttons.vue24
-rw-r--r--src/components/features_panel/features_panel.js2
-rw-r--r--src/components/features_panel/features_panel.vue4
-rw-r--r--src/components/moderation_tools/moderation_tools.vue25
-rw-r--r--src/components/notifications/notification_filters.vue8
-rw-r--r--src/components/popover/popover.js2
-rw-r--r--src/components/react_button/react_button.vue28
-rw-r--r--src/components/selectable_list/selectable_list.vue7
-rw-r--r--src/components/settings_modal/helpers/modified_indicator.vue16
-rw-r--r--src/components/settings_modal/settings_modal.vue28
-rw-r--r--src/components/settings_modal/tabs/general_tab.js1
-rw-r--r--src/components/settings_modal/tabs/general_tab.vue5
-rw-r--r--src/components/settings_modal/tabs/mutes_and_blocks_tab.vue73
-rw-r--r--src/components/shout_panel/shout_panel.js (renamed from src/components/chat_panel/chat_panel.js)8
-rw-r--r--src/components/shout_panel/shout_panel.vue (renamed from src/components/chat_panel/chat_panel.vue)44
-rw-r--r--src/components/side_drawer/side_drawer.js1
-rw-r--r--src/components/side_drawer/side_drawer.vue4
-rw-r--r--src/components/status_popover/status_popover.vue8
-rw-r--r--src/components/timeline/timeline_quick_settings.vue109
-rw-r--r--src/components/timeline_menu/timeline_menu.vue40
-rw-r--r--src/components/user_card/user_card.vue6
-rw-r--r--src/components/user_list_popover/user_list_popover.vue59
-rw-r--r--src/components/user_profile/user_profile.vue10
-rw-r--r--src/components/user_reporting_modal/user_reporting_modal.vue5
-rw-r--r--src/i18n/en.json1
-rw-r--r--src/main.js4
-rw-r--r--src/modules/api.js4
-rw-r--r--src/modules/config.js1
-rw-r--r--src/modules/instance.js5
-rw-r--r--src/modules/shout.js (renamed from src/modules/chat.js)7
-rw-r--r--src/modules/users.js2
41 files changed, 326 insertions, 363 deletions
diff --git a/src/App.js b/src/App.js
index 231c6ae1..362ac19d 100644
--- a/src/App.js
+++ b/src/App.js
@@ -4,7 +4,7 @@ import Notifications from './components/notifications/notifications.vue'
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
import FeaturesPanel from './components/features_panel/features_panel.vue'
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
-import ChatPanel from './components/chat_panel/chat_panel.vue'
+import ShoutPanel from './components/shout_panel/shout_panel.vue'
import SettingsModal from './components/settings_modal/settings_modal.vue'
import MediaModal from './components/media_modal/media_modal.vue'
import SideDrawer from './components/side_drawer/side_drawer.vue'
@@ -26,7 +26,7 @@ export default {
InstanceSpecificPanel,
FeaturesPanel,
WhoToFollowPanel,
- ChatPanel,
+ ShoutPanel,
MediaModal,
SideDrawer,
MobilePostStatusButton,
@@ -65,7 +65,7 @@ export default {
}
}
},
- chat () { return this.$store.state.chat.channel.state === 'joined' },
+ shout () { return this.$store.state.shout.channel.state === 'joined' },
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
showInstanceSpecificPanel () {
return this.$store.state.instance.showInstanceSpecificPanel &&
@@ -73,6 +73,9 @@ export default {
this.$store.state.instance.instanceSpecificPanelContent
},
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
+ hideShoutbox () {
+ return this.$store.getters.mergedConfig.hideShoutbox
+ },
isMobileLayout () { return this.$store.state.interface.mobileLayout },
privateMode () { return this.$store.state.instance.private },
sidebarAlign () {
diff --git a/src/App.vue b/src/App.vue
index 1a166778..c30f5e98 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -49,10 +49,10 @@
</div>
<media-modal />
</div>
- <chat-panel
- v-if="currentUser && chat"
+ <shout-panel
+ v-if="currentUser && shout && !hideShoutbox"
:floating="true"
- class="floating-chat mobile-hidden"
+ class="floating-shout mobile-hidden"
/>
<MobilePostStatusButton />
<UserReportingModal />
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 45090e5d..cc0c7c5e 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -240,7 +240,7 @@ const getNodeInfo = async ({ store }) => {
store.dispatch('setInstanceOption', { name: 'registrationOpen', value: data.openRegistrations })
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') })
store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') })
- store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') })
+ store.dispatch('setInstanceOption', { name: 'shoutAvailable', value: features.includes('chat') })
store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') })
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') })
diff --git a/src/boot/routes.js b/src/boot/routes.js
index b5d3c631..1bc1f9f7 100644
--- a/src/boot/routes.js
+++ b/src/boot/routes.js
@@ -16,7 +16,7 @@ import FollowRequests from 'components/follow_requests/follow_requests.vue'
import OAuthCallback from 'components/oauth_callback/oauth_callback.vue'
import Notifications from 'components/notifications/notifications.vue'
import AuthForm from 'components/auth_form/auth_form.js'
-import ChatPanel from 'components/chat_panel/chat_panel.vue'
+import ShoutPanel from 'components/shout_panel/shout_panel.vue'
import WhoToFollow from 'components/who_to_follow/who_to_follow.vue'
import About from 'components/about/about.vue'
import RemoteUserResolver from 'components/remote_user_resolver/remote_user_resolver.vue'
@@ -64,7 +64,7 @@ export default (store) => {
{ name: 'friend-requests', path: '/friend-requests', component: FollowRequests, beforeEnter: validateAuthenticatedRoute },
{ name: 'notifications', path: '/:username/notifications', component: Notifications, beforeEnter: validateAuthenticatedRoute },
{ name: 'login', path: '/login', component: AuthForm },
- { name: 'chat-panel', path: '/chat-panel', component: ChatPanel, props: () => ({ floating: false }) },
+ { name: 'shout-panel', path: '/shout-panel', component: ShoutPanel, props: () => ({ floating: false }) },
{ name: 'oauth-callback', path: '/oauth-callback', component: OAuthCallback, props: (route) => ({ code: route.query.code }) },
{ name: 'search', path: '/search', component: Search, props: (route) => ({ query: route.query.query }) },
{ name: 'who-to-follow', path: '/who-to-follow', component: WhoToFollow, beforeEnter: validateAuthenticatedRoute },
diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue
index ab5d1d29..1e31151c 100644
--- a/src/components/account_actions/account_actions.vue
+++ b/src/components/account_actions/account_actions.vue
@@ -6,10 +6,7 @@
:bound-to="{ x: 'container' }"
remove-padding
>
- <div
- slot="content"
- class="account-tools-popover"
- >
+ <template v-slot:content>
<div class="dropdown-menu">
<template v-if="relationship.following">
<button
@@ -59,16 +56,15 @@
{{ $t('user_card.message') }}
</button>
</div>
- </div>
- <div
- slot="trigger"
- class="ellipsis-button"
- >
- <FAIcon
- class="icon"
- icon="ellipsis-v"
- />
- </div>
+ </template>
+ <template v-slot:trigger>
+ <button class="button-unstyled ellipsis-button">
+ <FAIcon
+ class="icon"
+ icon="ellipsis-v"
+ />
+ </button>
+ </template>
</Popover>
</div>
</template>
@@ -83,7 +79,6 @@
}
.ellipsis-button {
- cursor: pointer;
width: 2.5em;
margin: -0.5em 0;
padding: 0.5em 0;
diff --git a/src/components/chat_list/chat_list.vue b/src/components/chat_list/chat_list.vue
index e23eec13..f98b7ed2 100644
--- a/src/components/chat_list/chat_list.vue
+++ b/src/components/chat_list/chat_list.vue
@@ -23,10 +23,7 @@
class="timeline"
>
<List :items="sortedChatList">
- <template
- slot="item"
- slot-scope="{item}"
- >
+ <template v-slot:item="{item}">
<ChatListItem
:key="item.id"
:compact="false"
diff --git a/src/components/chat_message/chat_message.vue b/src/components/chat_message/chat_message.vue
index 0777f880..0f3fc97d 100644
--- a/src/components/chat_message/chat_message.vue
+++ b/src/components/chat_message/chat_message.vue
@@ -50,7 +50,7 @@
@show="menuOpened = true"
@close="menuOpened = false"
>
- <div slot="content">
+ <template v-slot:content>
<div class="dropdown-menu">
<button
class="button-default dropdown-item dropdown-item-icon"
@@ -59,26 +59,28 @@
<FAIcon icon="times" /> {{ $t("chats.delete") }}
</button>
</div>
- </div>
- <button
- slot="trigger"
- class="button-default menu-icon"
- :title="$t('chats.more')"
- >
- <FAIcon icon="ellipsis-h" />
- </button>
+ </template>
+ <template v-slot:trigger>
+ <button
+ class="button-default menu-icon"
+ :title="$t('chats.more')"
+ >
+ <FAIcon icon="ellipsis-h" />
+ </button>
+ </template>
</Popover>
</div>
<StatusContent
:status="messageForStatusContent"
:full-content="true"
>
- <span
- slot="footer"
- class="created-at"
- >
- {{ createdAt }}
- </span>
+ <template v-slot:footer>
+ <span
+ class="created-at"
+ >
+ {{ createdAt }}
+ </span>
+ </template>
</StatusContent>
</div>
</div>
diff --git a/src/components/domain_mute_card/domain_mute_card.vue b/src/components/domain_mute_card/domain_mute_card.vue
index 3b5aec14..836688aa 100644
--- a/src/components/domain_mute_card/domain_mute_card.vue
+++ b/src/components/domain_mute_card/domain_mute_card.vue
@@ -9,7 +9,7 @@
class="btn button-default"
>
{{ $t('domain_mute_card.unmute') }}
- <template slot="progress">
+ <template v-slot:progress>
{{ $t('domain_mute_card.unmute_progress') }}
</template>
</ProgressButton>
@@ -19,7 +19,7 @@
class="btn button-default"
>
{{ $t('domain_mute_card.mute') }}
- <template slot="progress">
+ <template v-slot:progress>
{{ $t('domain_mute_card.mute_progress') }}
</template>
</ProgressButton>
diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js
index dc03bc9f..902ec384 100644
--- a/src/components/emoji_input/emoji_input.js
+++ b/src/components/emoji_input/emoji_input.js
@@ -57,6 +57,7 @@ const EmojiInput = {
required: true,
type: Function
},
+ // TODO VUE3: change to modelValue, change 'input' event to 'input'
value: {
/**
* Used for v-model
@@ -143,32 +144,31 @@ const EmojiInput = {
}
},
mounted () {
- const slots = this.$slots.default
- if (!slots || slots.length === 0) return
- const input = slots.find(slot => ['input', 'textarea'].includes(slot.tag))
+ const { root } = this.$refs
+ const input = root.querySelector('.emoji-input > input') || root.querySelector('.emoji-input > textarea')
if (!input) return
this.input = input
this.resize()
- input.elm.addEventListener('blur', this.onBlur)
- input.elm.addEventListener('focus', this.onFocus)
- input.elm.addEventListener('paste', this.onPaste)
- input.elm.addEventListener('keyup', this.onKeyUp)
- input.elm.addEventListener('keydown', this.onKeyDown)
- input.elm.addEventListener('click', this.onClickInput)
- input.elm.addEventListener('transitionend', this.onTransition)
- input.elm.addEventListener('input', this.onInput)
+ input.addEventListener('blur', this.onBlur)
+ input.addEventListener('focus', this.onFocus)
+ input.addEventListener('paste', this.onPaste)
+ input.addEventListener('keyup', this.onKeyUp)
+ input.addEventListener('keydown', this.onKeyDown)
+ input.addEventListener('click', this.onClickInput)
+ input.addEventListener('transitionend', this.onTransition)
+ input.addEventListener('input', this.onInput)
},
unmounted () {
const { input } = this
if (input) {
- input.elm.removeEventListener('blur', this.onBlur)
- input.elm.removeEventListener('focus', this.onFocus)
- input.elm.removeEventListener('paste', this.onPaste)
- input.elm.removeEventListener('keyup', this.onKeyUp)
- input.elm.removeEventListener('keydown', this.onKeyDown)
- input.elm.removeEventListener('click', this.onClickInput)
- input.elm.removeEventListener('transitionend', this.onTransition)
- input.elm.removeEventListener('input', this.onInput)
+ input.removeEventListener('blur', this.onBlur)
+ input.removeEventListener('focus', this.onFocus)
+ input.removeEventListener('paste', this.onPaste)
+ input.removeEventListener('keyup', this.onKeyUp)
+ input.removeEventListener('keydown', this.onKeyDown)
+ input.removeEventListener('click', this.onClickInput)
+ input.removeEventListener('transitionend', this.onTransition)
+ input.removeEventListener('input', this.onInput)
}
},
watch: {
@@ -216,7 +216,7 @@ const EmojiInput = {
}, 0)
},
togglePicker () {
- this.input.elm.focus()
+ this.input.focus()
this.showPicker = !this.showPicker
if (this.showPicker) {
this.scrollIntoView()
@@ -262,13 +262,13 @@ const EmojiInput = {
this.$emit('input', newValue)
const position = this.caret + (insertion + spaceAfter + spaceBefore).length
if (!keepOpen) {
- this.input.elm.focus()
+ this.input.focus()
}
this.$nextTick(function () {
// Re-focus inputbox after clicking suggestion
// Set selection right after the replacement instead of the very end
- this.input.elm.setSelectionRange(position, position)
+ this.input.setSelectionRange(position, position)
this.caret = position
})
},
@@ -285,9 +285,9 @@ const EmojiInput = {
this.$nextTick(function () {
// Re-focus inputbox after clicking suggestion
- this.input.elm.focus()
+ this.input.focus()
// Set selection right after the replacement instead of the very end
- this.input.elm.setSelectionRange(position, position)
+ this.input.setSelectionRange(position, position)
this.caret = position
})
e.preventDefault()
@@ -349,7 +349,7 @@ const EmojiInput = {
}
this.$nextTick(() => {
- const { offsetHeight } = this.input.elm
+ const { offsetHeight } = this.input
const { picker } = this.$refs
const pickerBottom = picker.$el.getBoundingClientRect().bottom
if (pickerBottom > window.innerHeight) {
@@ -414,8 +414,8 @@ const EmojiInput = {
// Scroll the input element to the position of the cursor
this.$nextTick(() => {
- this.input.elm.blur()
- this.input.elm.focus()
+ this.input.blur()
+ this.input.focus()
})
}
// Disable suggestions hotkeys if suggestions are hidden
@@ -444,7 +444,7 @@ const EmojiInput = {
// de-focuses the element (i.e. default browser behavior)
if (key === 'Escape') {
if (!this.temporarilyHideSuggestions) {
- this.input.elm.focus()
+ this.input.focus()
}
}
@@ -480,7 +480,7 @@ const EmojiInput = {
if (!panel) return
const picker = this.$refs.picker.$el
const panelBody = this.$refs['panel-body']
- const { offsetHeight, offsetTop } = this.input.elm
+ const { offsetHeight, offsetTop } = this.input
const offsetBottom = offsetTop + offsetHeight
this.setPlacement(panelBody, panel, offsetBottom)
@@ -494,7 +494,7 @@ const EmojiInput = {
if (this.placement === 'top' || (this.placement === 'auto' && this.overflowsBottom(container))) {
target.style.top = 'auto'
- target.style.bottom = this.input.elm.offsetHeight + 'px'
+ target.style.bottom = this.input.offsetHeight + 'px'
}
},
overflowsBottom (el) {
diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue
index ad62484d..e6f9a9d3 100644
--- a/src/components/emoji_input/emoji_input.vue
+++ b/src/components/emoji_input/emoji_input.vue
@@ -3,6 +3,7 @@
v-click-outside="onClickOutside"
class="emoji-input"
:class="{ 'with-picker': !hideEmojiButton }"
+ ref='root'
>
<slot />
<template v-if="enableEmojiPicker">
diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue
index c6cb9fbe..a3c3c767 100644
--- a/src/components/extra_buttons/extra_buttons.vue
+++ b/src/components/extra_buttons/extra_buttons.vue
@@ -7,10 +7,7 @@
:bound-to="{ x: 'container' }"
remove-padding
>
- <div
- slot="content"
- slot-scope="{close}"
- >
+ <template v-slot:content="{close}">
<div class="dropdown-menu">
<button
v-if="canMute && !status.thread_muted"
@@ -120,16 +117,15 @@
/><span>{{ $t("user_card.report") }}</span>
</button>
</div>
- </div>
- <span
- slot="trigger"
- class="popover-trigger"
- >
- <FAIcon
- class="fa-scale-110 fa-old-padding"
- icon="ellipsis-h"
- />
- </span>
+ </template>
+ <template v-slot:trigger>
+ <button class="button-unstyled popover-trigger">
+ <FAIcon
+ class="fa-scale-110 fa-old-padding"
+ icon="ellipsis-h"
+ />
+ </button>
+ </template>
</Popover>
</template>
diff --git a/src/components/features_panel/features_panel.js b/src/components/features_panel/features_panel.js
index 8b142d08..d177efeb 100644
--- a/src/components/features_panel/features_panel.js
+++ b/src/components/features_panel/features_panel.js
@@ -2,7 +2,7 @@ import fileSizeFormatService from '../../services/file_size_format/file_size_for
const FeaturesPanel = {
computed: {
- chat: function () { return this.$store.state.instance.chatAvailable },
+ shout: function () { return this.$store.state.instance.shoutAvailable },
pleromaChatMessages: function () { return this.$store.state.instance.pleromaChatMessagesAvailable },
gopher: function () { return this.$store.state.instance.gopherAvailable },
whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled },
diff --git a/src/components/features_panel/features_panel.vue b/src/components/features_panel/features_panel.vue
index 9605d09d..a58a99af 100644
--- a/src/components/features_panel/features_panel.vue
+++ b/src/components/features_panel/features_panel.vue
@@ -8,8 +8,8 @@
</div>
<div class="panel-body features-panel">
<ul>
- <li v-if="chat">
- {{ $t('features_panel.chat') }}
+ <li v-if="shout">
+ {{ $t('features_panel.shout') }}
</li>
<li v-if="pleromaChatMessages">
{{ $t('features_panel.pleroma_chat_messages') }}
diff --git a/src/components/moderation_tools/moderation_tools.vue b/src/components/moderation_tools/moderation_tools.vue
index c4c6ee46..96476abe 100644
--- a/src/components/moderation_tools/moderation_tools.vue
+++ b/src/components/moderation_tools/moderation_tools.vue
@@ -8,7 +8,7 @@
@show="setToggled(true)"
@close="setToggled(false)"
>
- <div slot="content">
+ <template v-slot:content>
<div class="dropdown-menu">
<span v-if="user.is_local">
<button
@@ -121,26 +121,27 @@
</button>
</span>
</div>
- </div>
- <button
- slot="trigger"
- class="btn button-default btn-block moderation-tools-button"
- :class="{ toggled }"
- >
- {{ $t('user_card.admin_menu.moderation') }}
- <FAIcon icon="chevron-down" />
- </button>
+ </template>
+ <template v-slot:trigger>
+ <button
+ class="btn button-default btn-block moderation-tools-button"
+ :class="{ toggled }"
+ >
+ {{ $t('user_card.admin_menu.moderation') }}
+ <FAIcon icon="chevron-down" />
+ </button>
+ </template>
</Popover>
<portal to="modal">
<DialogModal
v-if="showDeleteUserDialog"
:on-cancel="deleteUserDialog.bind(this, false)"
>
- <template slot="header">
+ <template v-slot:header>
{{ $t('user_card.admin_menu.delete_user') }}
</template>
<p>{{ $t('user_card.admin_menu.delete_user_confirmation') }}</p>
- <template slot="footer">
+ <template v-slot:footer>
<button
class="btn button-default"
@click="deleteUserDialog(false)"
diff --git a/src/components/notifications/notification_filters.vue b/src/components/notifications/notification_filters.vue
index e86a0fcc..ba0e90a0 100644
--- a/src/components/notifications/notification_filters.vue
+++ b/src/components/notifications/notification_filters.vue
@@ -5,9 +5,7 @@
placement="bottom"
:bound-to="{ x: 'container' }"
>
- <template
- v-slot:content
- >
+ <template v-slot:content>
<div class="dropdown-menu">
<button
class="button-default dropdown-item"
@@ -66,7 +64,9 @@
</div>
</template>
<template v-slot:trigger>
- <FAIcon icon="filter" />
+ <button class="button-unstyled">
+ <FAIcon icon="filter" />
+ </button>
</template>
</Popover>
</template>
diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js
index bc6cd8e7..6ccf32f0 100644
--- a/src/components/popover/popover.js
+++ b/src/components/popover/popover.js
@@ -54,7 +54,7 @@ const Popover = {
}
// Popover will be anchored around this element, trigger ref is the container, so
- // its children are what are inside the slot. Expect only one slot="trigger".
+ // its children are what are inside the slot. Expect only one v-slot:trigger.
const anchorEl = (this.$refs.trigger && this.$refs.trigger.children[0]) || this.$el
// SVGs don't have offsetWidth/Height, use fallback
const anchorWidth = anchorEl.offsetWidth || anchorEl.clientWidth
diff --git a/src/components/react_button/react_button.vue b/src/components/react_button/react_button.vue
index 4839024c..c69c315b 100644
--- a/src/components/react_button/react_button.vue
+++ b/src/components/react_button/react_button.vue
@@ -8,10 +8,7 @@
remove-padding
@show="focusInput"
>
- <div
- slot="content"
- slot-scope="{close}"
- >
+ <template v-slot:content="{close}">
<div class="reaction-picker-filter">
<input
v-model="filterWord"
@@ -41,17 +38,18 @@
</span>
<div class="reaction-bottom-fader" />
</div>
- </div>
- <span
- slot="trigger"
- class="popover-trigger"
- :title="$t('tool_tip.add_reaction')"
- >
- <FAIcon
- class="fa-scale-110 fa-old-padding"
- :icon="['far', 'smile-beam']"
- />
- </span>
+ </template>
+ <template v-slot:trigger>
+ <button
+ class="button-unstyled popover-trigger"
+ :title="$t('tool_tip.add_reaction')"
+ >
+ <FAIcon
+ class="fa-scale-110 fa-old-padding"
+ :icon="['far', 'smile-beam']"
+ />
+ </button>
+ </template>
</Popover>
</template>
diff --git a/src/components/selectable_list/selectable_list.vue b/src/components/selectable_list/selectable_list.vue
index a9bb12a1..3f885881 100644
--- a/src/components/selectable_list/selectable_list.vue
+++ b/src/components/selectable_list/selectable_list.vue
@@ -24,10 +24,7 @@
:items="items"
:get-key="getKey"
>
- <template
- slot="item"
- slot-scope="{item}"
- >
+ <template v-slot:item="{item}">
<div
class="selectable-list-item-inner"
:class="{ 'selectable-list-item-selected-inner': isSelected(item) }"
@@ -44,7 +41,7 @@
/>
</div>
</template>
- <template slot="empty">
+ <template v-slot:empty>
<slot name="empty" />
</template>
</List>
diff --git a/src/components/settings_modal/helpers/modified_indicator.vue b/src/components/settings_modal/helpers/modified_indicator.vue
index 9f4e81fe..ad212db9 100644
--- a/src/components/settings_modal/helpers/modified_indicator.vue
+++ b/src/components/settings_modal/helpers/modified_indicator.vue
@@ -6,18 +6,18 @@
<Popover
trigger="hover"
>
- <span slot="trigger">
+ <template v-slot:trigger>
&nbsp;
<FAIcon
icon="wrench"
+ :aria-label="$t('settings.setting_changed')"
/>
- </span>
- <div
- slot="content"
- class="modified-tooltip"
- >
- {{ $t('settings.setting_changed') }}
- </div>
+ </template>
+ <template v-slot:content>
+ <div class="modified-tooltip">
+ {{ $t('settings.setting_changed') }}
+ </div>
+ </template>
</Popover>
</span>
</template>
diff --git a/src/components/settings_modal/settings_modal.vue b/src/components/settings_modal/settings_modal.vue
index c7da5433..583c2ecc 100644
--- a/src/components/settings_modal/settings_modal.vue
+++ b/src/components/settings_modal/settings_modal.vue
@@ -62,20 +62,18 @@
:bound-to="{ x: 'container' }"
remove-padding
>
- <button
- slot="trigger"
- class="btn button-default"
- :title="$t('general.close')"
- >
- <span>{{ $t("settings.file_export_import.backup_restore") }}</span>
- <FAIcon
- icon="chevron-down"
- />
- </button>
- <div
- slot="content"
- slot-scope="{close}"
- >
+ <template v-slot:trigger>
+ <button
+ class="btn button-default"
+ :title="$t('general.close')"
+ >
+ <span>{{ $t("settings.file_export_import.backup_restore") }}</span>
+ <FAIcon
+ icon="chevron-down"
+ />
+ </button>
+ </template>
+ <template v-slot:content="{close}">
<div class="dropdown-menu">
<button
class="button-default dropdown-item dropdown-item-icon"
@@ -108,7 +106,7 @@
/><span>{{ $t("settings.file_export_import.restore_settings") }}</span>
</button>
</div>
- </div>
+ </template>
</Popover>
</div>
</div>
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js
index 07fccf57..eeda61bf 100644
--- a/src/components/settings_modal/tabs/general_tab.js
+++ b/src/components/settings_modal/tabs/general_tab.js
@@ -50,6 +50,7 @@ const GeneralTab = {
return this.$store.state.instance.background &&
!this.$store.state.users.currentUser.background_image
},
+ instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
...SharedComputedObject()
}
}
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index bdb29edf..d3e71b31 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -21,6 +21,11 @@
{{ $t('settings.hide_wallpaper') }}
</BooleanSetting>
</li>
+ <li v-if="instanceShoutboxPresent">
+ <BooleanSetting path="hideShoutbox">
+ {{ $t('settings.hide_shoutbox') }}
+ </BooleanSetting>
+ </li>
</ul>
</div>
<div class="setting-item">
diff --git a/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue b/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
index 63d36bf9..32a21415 100644
--- a/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
+++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
@@ -10,20 +10,18 @@
:query="queryUserIds"
:placeholder="$t('settings.search_user_to_block')"
>
- <BlockCard
- slot-scope="row"
- :user-id="row.item"
- />
+ <template v-slot="row">
+ <BlockCard
+ :user-id="row.item"
+ />
+ </template>
</Autosuggest>
</div>
<BlockList
:refresh="true"
:get-key="i => i"
>
- <template
- slot="header"
- slot-scope="{selected}"
- >
+ <template v-slot:header="{selected}">
<div class="bulk-actions">
<ProgressButton
v-if="selected.length > 0"
@@ -31,7 +29,7 @@
:click="() => blockUsers(selected)"
>
{{ $t('user_card.block') }}
- <template slot="progress">
+ <template v-slot:progress>
{{ $t('user_card.block_progress') }}
</template>
</ProgressButton>
@@ -41,19 +39,16 @@
:click="() => unblockUsers(selected)"
>
{{ $t('user_card.unblock') }}
- <template slot="progress">
+ <template v-slot:progress>
{{ $t('user_card.unblock_progress') }}
</template>
</ProgressButton>
</div>
</template>
- <template
- slot="item"
- slot-scope="{item}"
- >
+ <template v-slot:item="{item}">
<BlockCard :user-id="item" />
</template>
- <template slot="empty">
+ <template v-slot:empty>
{{ $t('settings.no_blocks') }}
</template>
</BlockList>
@@ -68,20 +63,18 @@
:query="queryUserIds"
:placeholder="$t('settings.search_user_to_mute')"
>
- <MuteCard
- slot-scope="row"
- :user-id="row.item"
- />
+ <template v-slot="row">
+ <MuteCard
+ :user-id="row.item"
+ />
+ </template>
</Autosuggest>
</div>
<MuteList
:refresh="true"
:get-key="i => i"
>
- <template
- slot="header"
- slot-scope="{selected}"
- >
+ <template v-slot:header="{selected}">
<div class="bulk-actions">
<ProgressButton
v-if="selected.length > 0"
@@ -89,7 +82,7 @@
:click="() => muteUsers(selected)"
>
{{ $t('user_card.mute') }}
- <template slot="progress">
+ <template v-slot:progress>
{{ $t('user_card.mute_progress') }}
</template>
</ProgressButton>
@@ -99,19 +92,16 @@
:click="() => unmuteUsers(selected)"
>
{{ $t('user_card.unmute') }}
- <template slot="progress">
+ <template v-slot:progress>
{{ $t('user_card.unmute_progress') }}
</template>
</ProgressButton>
</div>
</template>
- <template
- slot="item"
- slot-scope="{item}"
- >
+ <template v-slot:item="{item}">
<MuteCard :user-id="item" />
</template>
- <template slot="empty">
+ <template v-slot:empty>
{{ $t('settings.no_mutes') }}
</template>
</MuteList>
@@ -124,20 +114,18 @@
:query="queryKnownDomains"
:placeholder="$t('settings.type_domains_to_mute')"
>
- <DomainMuteCard
- slot-scope="row"
- :domain="row.item"
- />
+ <template v-slot="row">
+ <DomainMuteCard
+ :domain="row.item"
+ />
+ </template>
</Autosuggest>
</div>
<DomainMuteList
:refresh="true"
:get-key="i => i"
>
- <template
- slot="header"
- slot-scope="{selected}"
- >
+ <template v-slot:header="{selected}">
<div class="bulk-actions">
<ProgressButton
v-if="selected.length > 0"
@@ -145,19 +133,16 @@
:click="() => unmuteDomains(selected)"
>
{{ $t('domain_mute_card.unmute') }}
- <template slot="progress">
+ <template v-slot:progress>
{{ $t('domain_mute_card.unmute_progress') }}
</template>
</ProgressButton>
</div>
</template>
- <template
- slot="item"
- slot-scope="{item}"
- >
+ <template v-slot:item="{item}">
<DomainMuteCard :domain="item" />
</template>
- <template slot="empty">
+ <template v-slot:empty>
{{ $t('settings.no_mutes') }}
</template>
</DomainMuteList>
diff --git a/src/components/chat_panel/chat_panel.js b/src/components/shout_panel/shout_panel.js
index 556694ae..a6168971 100644
--- a/src/components/chat_panel/chat_panel.js
+++ b/src/components/shout_panel/shout_panel.js
@@ -10,7 +10,7 @@ library.add(
faTimes
)
-const chatPanel = {
+const shoutPanel = {
props: [ 'floating' ],
data () {
return {
@@ -21,12 +21,12 @@ const chatPanel = {
},
computed: {
messages () {
- return this.$store.state.chat.messages
+ return this.$store.state.shout.messages
}
},
methods: {
submit (message) {
- this.$store.state.chat.channel.push('new_msg', { text: message }, 10000)
+ this.$store.state.shout.channel.push('new_msg', { text: message }, 10000)
this.currentMessage = ''
},
togglePanel () {
@@ -50,4 +50,4 @@ const chatPanel = {
}
}
-export default chatPanel
+export default shoutPanel
diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/shout_panel/shout_panel.vue
index 8a829115..f90baf80 100644
--- a/src/components/chat_panel/chat_panel.vue
+++ b/src/components/shout_panel/shout_panel.vue
@@ -1,12 +1,12 @@
<template>
<div
v-if="!collapsed || !floating"
- class="chat-panel"
+ class="shout-panel"
>
<div class="panel panel-default">
<div
class="panel-heading timeline-heading"
- :class="{ 'chat-heading': floating }"
+ :class="{ 'shout-heading': floating }"
@click.stop.prevent="togglePanel"
>
<div class="title">
@@ -18,33 +18,33 @@
/>
</div>
</div>
- <div class="chat-window">
+ <div class="shout-window">
<div
v-for="message in messages"
:key="message.id"
- class="chat-message"
+ class="shout-message"
>
- <span class="chat-avatar">
+ <span class="shout-avatar">
<img :src="message.author.avatar">
</span>
- <div class="chat-content">
+ <div class="shout-content">
<router-link
- class="chat-name"
+ class="shout-name"
:to="userProfileLink(message.author)"
>
{{ message.author.username }}
</router-link>
<br>
- <span class="chat-text">
+ <span class="shout-text">
{{ message.text }}
</span>
</div>
</div>
</div>
- <div class="chat-input">
+ <div class="shout-input">
<textarea
v-model="currentMessage"
- class="chat-input-textarea"
+ class="shout-input-textarea"
rows="1"
@keyup.enter="submit(currentMessage)"
/>
@@ -53,11 +53,11 @@
</div>
<div
v-else
- class="chat-panel"
+ class="shout-panel"
>
<div class="panel panel-default">
<div
- class="panel-heading stub timeline-heading chat-heading"
+ class="panel-heading stub timeline-heading shout-heading"
@click.stop.prevent="togglePanel"
>
<div class="title">
@@ -72,12 +72,12 @@
</div>
</template>
-<script src="./chat_panel.js"></script>
+<script src="./shout_panel.js"></script>
<style lang="scss">
@import '../../_variables.scss';
-.floating-chat {
+.floating-shout {
position: fixed;
right: 0px;
bottom: 0px;
@@ -85,8 +85,8 @@
max-width: 25em;
}
-.chat-panel {
- .chat-heading {
+.shout-panel {
+ .shout-heading {
cursor: pointer;
.icon {
@@ -102,22 +102,22 @@
}
}
- .chat-window {
+ .shout-window {
overflow-y: auto;
overflow-x: hidden;
max-height: 20em;
}
- .chat-window-container {
+ .shout-window-container {
height: 100%;
}
- .chat-message {
+ .shout-message {
display: flex;
padding: 0.2em 0.5em
}
- .chat-avatar {
+ .shout-avatar {
img {
height: 24px;
width: 24px;
@@ -128,7 +128,7 @@
}
}
- .chat-input {
+ .shout-input {
display: flex;
textarea {
flex: 1;
@@ -138,7 +138,7 @@
}
}
- .chat-panel {
+ .shout-panel {
.title {
display: flex;
justify-content: space-between;
diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js
index fe736168..0faf3b9e 100644
--- a/src/components/side_drawer/side_drawer.js
+++ b/src/components/side_drawer/side_drawer.js
@@ -49,7 +49,6 @@ const SideDrawer = {
currentUser () {
return this.$store.state.users.currentUser
},
- chat () { return this.$store.state.chat.channel.state === 'joined' },
unseenNotifications () {
return unseenNotificationsFromStore(this.$store)
},
diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue
index 223b1632..575052be 100644
--- a/src/components/side_drawer/side_drawer.vue
+++ b/src/components/side_drawer/side_drawer.vue
@@ -273,9 +273,7 @@
--icon: var(--popoverIcon, $fallback--icon);
.badge {
- position: absolute;
- right: 0.7rem;
- top: 1em;
+ margin-left: 10px;
}
}
diff --git a/src/components/status_popover/status_popover.vue b/src/components/status_popover/status_popover.vue
index 8237ce00..fdca8c9c 100644
--- a/src/components/status_popover/status_popover.vue
+++ b/src/components/status_popover/status_popover.vue
@@ -5,12 +5,10 @@
:bound-to="{ x: 'container' }"
@show="enter"
>
- <template slot="trigger">
+ <template v-slot:trigger>
<slot />
</template>
- <div
- slot="content"
- >
+ <template v-slot:content>
<Status
v-if="status"
:is-preview="true"
@@ -33,7 +31,7 @@
size="2x"
/>
</div>
- </div>
+ </template>
</Popover>
</template>
diff --git a/src/components/timeline/timeline_quick_settings.vue b/src/components/timeline/timeline_quick_settings.vue
index 94997c0d..98996ebd 100644
--- a/src/components/timeline/timeline_quick_settings.vue
+++ b/src/components/timeline/timeline_quick_settings.vue
@@ -4,77 +4,78 @@
class="TimelineQuickSettings"
:bound-to="{ x: 'container' }"
>
- <div
- slot="content"
- class="dropdown-menu"
- >
- <div v-if="loggedIn">
+ <template v-slot:content>
+ <div class="dropdown-menu">
+ <div v-if="loggedIn">
+ <button
+ class="button-default dropdown-item"
+ @click="replyVisibilityAll = true"
+ >
+ <span
+ class="menu-checkbox"
+ :class="{ 'menu-checkbox-radio': replyVisibilityAll }"
+ />{{ $t('settings.reply_visibility_all') }}
+ </button>
+ <button
+ class="button-default dropdown-item"
+ @click="replyVisibilityFollowing = true"
+ >
+ <span
+ class="menu-checkbox"
+ :class="{ 'menu-checkbox-radio': replyVisibilityFollowing }"
+ />{{ $t('settings.reply_visibility_following_short') }}
+ </button>
+ <button
+ class="button-default dropdown-item"
+ @click="replyVisibilitySelf = true"
+ >
+ <span
+ class="menu-checkbox"
+ :class="{ 'menu-checkbox-radio': replyVisibilitySelf }"
+ />{{ $t('settings.reply_visibility_self_short') }}
+ </button>
+ <div
+ role="separator"
+ class="dropdown-divider"
+ />
+ </div>
<button
class="button-default dropdown-item"
- @click="replyVisibilityAll = true"
+ @click="hideMedia = !hideMedia"
>
<span
class="menu-checkbox"
- :class="{ 'menu-checkbox-radio': replyVisibilityAll }"
- />{{ $t('settings.reply_visibility_all') }}
+ :class="{ 'menu-checkbox-checked': hideMedia }"
+ />{{ $t('settings.hide_media_previews') }}
</button>
<button
class="button-default dropdown-item"
- @click="replyVisibilityFollowing = true"
+ @click="hideMutedPosts = !hideMutedPosts"
>
<span
class="menu-checkbox"
- :class="{ 'menu-checkbox-radio': replyVisibilityFollowing }"
- />{{ $t('settings.reply_visibility_following_short') }}
+ :class="{ 'menu-checkbox-checked': hideMutedPosts }"
+ />{{ $t('settings.hide_all_muted_posts') }}
</button>
<button
- class="button-default dropdown-item"
- @click="replyVisibilitySelf = true"
+ class="button-default dropdown-item dropdown-item-icon"
+ @click="openTab('filtering')"
>
- <span
- class="menu-checkbox"
- :class="{ 'menu-checkbox-radio': replyVisibilitySelf }"
- />{{ $t('settings.reply_visibility_self_short') }}
+ <FAIcon icon="font" />{{ $t('settings.word_filter') }}
+ </button>
+ <button
+ class="button-default dropdown-item dropdown-item-icon"
+ @click="openTab('general')"
+ >
+ <FAIcon icon="wrench" />{{ $t('settings.more_settings') }}
</button>
- <div
- role="separator"
- class="dropdown-divider"
- />
</div>
- <button
- class="button-default dropdown-item"
- @click="hideMedia = !hideMedia"
- >
- <span
- class="menu-checkbox"
- :class="{ 'menu-checkbox-checked': hideMedia }"
- />{{ $t('settings.hide_media_previews') }}
- </button>
- <button
- class="button-default dropdown-item"
- @click="hideMutedPosts = !hideMutedPosts"
- >
- <span
- class="menu-checkbox"
- :class="{ 'menu-checkbox-checked': hideMutedPosts }"
- />{{ $t('settings.hide_all_muted_posts') }}
- </button>
- <button
- class="button-default dropdown-item dropdown-item-icon"
- @click="openTab('filtering')"
- >
- <FAIcon icon="font" />{{ $t('settings.word_filter') }}
- </button>
- <button
- class="button-default dropdown-item dropdown-item-icon"
- @click="openTab('general')"
- >
- <FAIcon icon="wrench" />{{ $t('settings.more_settings') }}
+ </template>
+ <template v-slot:trigger>
+ <button class="button-unstyled">
+ <FAIcon icon="filter" />
</button>
- </div>
- <div slot="trigger">
- <FAIcon icon="filter" />
- </div>
+ </template>
</Popover>
</template>
diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue
index 22dc3432..8f14093f 100644
--- a/src/components/timeline_menu/timeline_menu.vue
+++ b/src/components/timeline_menu/timeline_menu.vue
@@ -9,28 +9,26 @@
@show="openMenu"
@close="() => isOpen = false"
>
- <div
- slot="content"
- class="timeline-menu-popover panel panel-default"
- >
- <TimelineMenuContent />
- </div>
- <div
- slot="trigger"
- class="title timeline-menu-title"
- >
- <span class="timeline-title">{{ timelineName() }}</span>
- <span>
- <FAIcon
- size="sm"
- icon="chevron-down"
+ <template v-slot:content>
+ <div class="timeline-menu-popover popover-default">
+ <TimelineMenuContent />
+ </div>
+ </template>
+ <template v-slot:trigger>
+ <button class="button-unstyled title timeline-menu-title">
+ <span class="timeline-title">{{ timelineName() }}</span>
+ <span>
+ <FAIcon
+ size="sm"
+ icon="chevron-down"
+ />
+ </span>
+ <span
+ class="click-blocker"
+ @click="blockOpen"
/>
- </span>
- <span
- class="click-blocker"
- @click="blockOpen"
- />
- </div>
+ </button>
+ </template>
</Popover>
</template>
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 53b55c01..a16f7873 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -53,17 +53,17 @@
>
{{ user.name }}
</div>
- <a
+ <button
v-if="isOtherUser && !user.is_local"
:href="user.statusnet_profile_url"
target="_blank"
- class="external-link-button"
+ class="button-unstyled external-link-button"
>
<FAIcon
class="icon"
icon="external-link-alt"
/>
- </a>
+ </button>
<AccountActions
v-if="isOtherUser && loggedIn"
:user="user"
diff --git a/src/components/user_list_popover/user_list_popover.vue b/src/components/user_list_popover/user_list_popover.vue
index d0aa315e..f4b93c9a 100644
--- a/src/components/user_list_popover/user_list_popover.vue
+++ b/src/components/user_list_popover/user_list_popover.vue
@@ -4,40 +4,39 @@
placement="top"
:offset="{ y: 5 }"
>
- <template slot="trigger">
+ <template v-slot:trigger>
<slot />
</template>
- <div
- slot="content"
- class="user-list-popover"
- >
- <div v-if="users.length">
- <div
- v-for="(user) in usersCapped"
- :key="user.id"
- class="user-list-row"
- >
- <UserAvatar
- :user="user"
- class="avatar-small"
- :compact="true"
- />
- <div class="user-list-names">
- <!-- eslint-disable vue/no-v-html -->
- <span v-html="user.name_html" />
- <!-- eslint-enable vue/no-v-html -->
- <span class="user-list-screen-name">{{ user.screen_name_ui }}</span>
+ <template v-slot:content>
+ <div class="user-list-popover">
+ <template v-if="users.length">
+ <div
+ v-for="(user) in usersCapped"
+ :key="user.id"
+ class="user-list-row"
+ >
+ <UserAvatar
+ :user="user"
+ class="avatar-small"
+ :compact="true"
+ />
+ <div class="user-list-names">
+ <!-- eslint-disable vue/no-v-html -->
+ <span v-html="user.name_html" />
+ <!-- eslint-enable vue/no-v-html -->
+ <span class="user-list-screen-name">{{ user.screen_name_ui }}</span>
+ </div>
</div>
- </div>
- </div>
- <div v-else>
- <FAIcon
- icon="circle-notch"
- spin
- size="3x"
- />
+ </template>
+ <template v-else>
+ <FAIcon
+ icon="circle-notch"
+ spin
+ size="3x"
+ />
+ </template>
</div>
- </div>
+ </template>
</Popover>
</template>
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index 745e795d..aef897ae 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -60,10 +60,7 @@
:disabled="!user.friends_count"
>
<FriendList :user-id="userId">
- <template
- slot="item"
- slot-scope="{item}"
- >
+ <template v-slot:item="{item}">
<FollowCard :user="item" />
</template>
</FriendList>
@@ -75,10 +72,7 @@
:disabled="!user.followers_count"
>
<FollowerList :user-id="userId">
- <template
- slot="item"
- slot-scope="{item}"
- >
+ <template v-slot:item="{item}">
<FollowCard
:user="item"
:no-follows-you="isUs"
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index a71c02c1..1f67a5cc 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -45,10 +45,7 @@
</div>
<div class="user-reporting-panel-right">
<List :items="statuses">
- <template
- slot="item"
- slot-scope="{item}"
- >
+ <template v-slot:item="{item}">
<div class="status-fadein user-reporting-panel-sitem">
<Status
:in-conversation="false"
diff --git a/src/i18n/en.json b/src/i18n/en.json
index aa440ac1..6511019c 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -348,6 +348,7 @@
"hide_all_muted_posts": "Hide muted posts",
"max_thumbnails": "Maximum amount of thumbnails per post",
"hide_isp": "Hide instance-specific panel",
+ "hide_shoutbox": "Hide instance shoutbox",
"right_sidebar": "Show sidebar on the right side",
"hide_wallpaper": "Hide instance wallpaper",
"preload_images": "Preload images",
diff --git a/src/main.js b/src/main.js
index e1cac748..3895da89 100644
--- a/src/main.js
+++ b/src/main.js
@@ -11,7 +11,7 @@ import statusesModule from './modules/statuses.js'
import usersModule from './modules/users.js'
import apiModule from './modules/api.js'
import configModule from './modules/config.js'
-import chatModule from './modules/chat.js'
+import shoutModule from './modules/shout.js'
import oauthModule from './modules/oauth.js'
import authFlowModule from './modules/auth_flow.js'
import mediaViewerModule from './modules/media_viewer.js'
@@ -88,7 +88,7 @@ const persistedStateOptions = {
users: usersModule,
api: apiModule,
config: configModule,
- chat: chatModule,
+ shout: shoutModule,
oauth: oauthModule,
authFlow: authFlowModule,
mediaViewer: mediaViewerModule,
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/config.js b/src/modules/config.js
index 0f596750..bdab3f4d 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -21,6 +21,7 @@ export const defaultState = {
customThemeSource: undefined,
hideISP: false,
hideInstanceWallpaper: false,
+ hideShoutbox: false,
// bad name: actually hides posts of muted USERS
hideMutedPosts: undefined, // instance default
collapseMessageWithSubject: undefined, // instance default
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')
}