From 6ed4fb0d65ffd7c540ea3b2fad3f7c46d230390e Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 4 Nov 2018 01:12:36 +0900 Subject: [PATCH 1/4] refs #662 Add background streaming for direct message --- src/main/index.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/main/index.js b/src/main/index.js index 8c7c2b4c..61527049 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -421,6 +421,43 @@ ipcMain.on('stop-user-streaming', (event, _) => { } }) +let directMessageStreaming = null + +ipcMain.on('start-directmessage-streaming', (event, ac) => { + accountManager.getAccount(ac._id) + .catch((err) => { + log.error(err) + event.sender.send('error-start-directmessage-streaming', err) + }) + .then((account) => { + // Stop old directmessage streaming + if (directMessageStreaming !== null) { + directMessageStreaming.stop() + directMessageStreaming = null + } + + directMessageStreaming = new StreamingManager(account) + directMessageStreaming.start( + 'direct', + null, + (update) => { + event.sender.send('update-start-directmessage-streaming', update) + }, + (err) => { + log.error(err) + event.sender.send('error-start-directmessage-streaming', err) + } + ) + }) +}) + +ipcMain.on('stop-directmessage-streaming', (event, _) => { + if (directMessageStreaming !== null) { + directMessageStreaming.stop() + directMessageStreaming = null + } +}) + let localStreaming = null ipcMain.on('start-local-streaming', (event, ac) => { From 968039b5aef55602fcd977d83e6f7a301aad8e9b Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 4 Nov 2018 01:37:30 +0900 Subject: [PATCH 2/4] refs #662 Update direct messages with streaming --- src/main/index.js | 30 +++++++++++------------ src/renderer/components/TimelineSpace.vue | 4 +++ src/renderer/store/TimelineSpace.js | 24 ++++++++++++++++++ 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 61527049..d4f584fc 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -421,40 +421,40 @@ ipcMain.on('stop-user-streaming', (event, _) => { } }) -let directMessageStreaming = null +let directMessagesStreaming = null -ipcMain.on('start-directmessage-streaming', (event, ac) => { +ipcMain.on('start-directmessages-streaming', (event, ac) => { accountManager.getAccount(ac._id) .catch((err) => { log.error(err) - event.sender.send('error-start-directmessage-streaming', err) + event.sender.send('error-start-directmessages-streaming', err) }) .then((account) => { - // Stop old directmessage streaming - if (directMessageStreaming !== null) { - directMessageStreaming.stop() - directMessageStreaming = null + // Stop old directmessages streaming + if (directMessagesStreaming !== null) { + directMessagesStreaming.stop() + directMessagesStreaming = null } - directMessageStreaming = new StreamingManager(account) - directMessageStreaming.start( + directMessagesStreaming = new StreamingManager(account) + directMessagesStreaming.start( 'direct', null, (update) => { - event.sender.send('update-start-directmessage-streaming', update) + event.sender.send('update-start-directmessages-streaming', update) }, (err) => { log.error(err) - event.sender.send('error-start-directmessage-streaming', err) + event.sender.send('error-start-directmessages-streaming', err) } ) }) }) -ipcMain.on('stop-directmessage-streaming', (event, _) => { - if (directMessageStreaming !== null) { - directMessageStreaming.stop() - directMessageStreaming = null +ipcMain.on('stop-directmessages-streaming', (event, _) => { + if (directMessagesStreaming !== null) { + directMessagesStreaming.stop() + directMessagesStreaming = null } }) diff --git a/src/renderer/components/TimelineSpace.vue b/src/renderer/components/TimelineSpace.vue index b59df5cb..03e42da9 100644 --- a/src/renderer/components/TimelineSpace.vue +++ b/src/renderer/components/TimelineSpace.vue @@ -74,6 +74,8 @@ export default { window.removeEventListener('drop', this.handleDrop) this.$store.dispatch('TimelineSpace/stopUserStreaming') this.$store.dispatch('TimelineSpace/unbindUserStreaming') + this.$store.dispatch('TimelineSpace/stopDirectMessagesStreaming') + this.$store.dispatch('TimelineSpace/unbindDirectMessagesStreaming') this.$store.dispatch('TimelineSpace/stopLocalStreaming') this.$store.dispatch('TimelineSpace/unbindLocalStreaming') }, @@ -134,6 +136,8 @@ export default { }) this.$store.dispatch('TimelineSpace/bindLocalStreaming', account) this.$store.dispatch('TimelineSpace/startLocalStreaming', account) + this.$store.dispatch('TimelineSpace/bindDirectMessagesStreaming', account) + this.$store.dispatch('TimelineSpace/startDirectMessagesStreaming', account) this.$store.dispatch('TimelineSpace/fetchEmojis', account) this.$store.dispatch('TimelineSpace/fetchInstance', account) }, diff --git a/src/renderer/store/TimelineSpace.js b/src/renderer/store/TimelineSpace.js index 6e63e45a..387b5173 100644 --- a/src/renderer/store/TimelineSpace.js +++ b/src/renderer/store/TimelineSpace.js @@ -135,6 +135,23 @@ const TimelineSpace = { }) }) }, + bindDirectMessagesStreaming ({ commit, rootState }) { + ipcRenderer.on('update-start-directmessages-streaming', (event, update) => { + commit('TimelineSpace/Contents/DirectMessages/appendTimeline', update, { root: true }) + if (rootState.TimelineSpace.Contents.DirectMessages.heading && Math.random() > 0.8) { + commit('TimelineSpace/Contents/DirectMessages/archiveTimeline', {}, { root: true }) + } + commit('TimelineSpace/SideMenu/changeUnreadDirectMessagesTimeline', true, { root: true }) + }) + }, + startDirectMessagesStreaming (_, account) { + return new Promise((resolve, reject) => { + ipcRenderer.send('start-directmessages-streaming', account) + ipcRenderer.once('error-start-directmessages-streaming', (event, err) => { + reject(err) + }) + }) + }, unbindUserStreaming () { ipcRenderer.removeAllListeners('update-start-user-streaming') ipcRenderer.removeAllListeners('notification-start-user-streaming') @@ -150,6 +167,13 @@ const TimelineSpace = { stopLocalStreaming () { ipcRenderer.send('stop-local-streaming') }, + unbindDirectMessagesStreaming () { + ipcRenderer.removeAllListeners('error-start-directmessages-streaming') + ipcRenderer.removeAllListeners('update-start-directmessages-streaming') + }, + stopDirectMessagesStreaming () { + ipcRenderer.send('stop-drectmessages-streaming') + }, watchShortcutEvents ({ commit, dispatch }) { ipcRenderer.on('CmdOrCtrl+N', () => { dispatch('TimelineSpace/Modals/NewToot/openModal', {}, { root: true }) From 68d5346585e0d9868baf55146178620ff4c58adb Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 4 Nov 2018 14:33:47 +0900 Subject: [PATCH 3/4] refs #662 Add mixin to reload timeline --- .../TimelineSpace/Contents/DirectMessages.vue | 30 ++----------------- .../TimelineSpace/Contents/Favourites.vue | 19 ++---------- .../TimelineSpace/Contents/Hashtag/Tag.vue | 21 +++---------- .../TimelineSpace/Contents/Home.vue | 30 ++----------------- .../TimelineSpace/Contents/Lists/Show.vue | 19 ++---------- .../TimelineSpace/Contents/Local.vue | 30 ++----------------- .../TimelineSpace/Contents/Notifications.vue | 17 ++--------- .../TimelineSpace/Contents/Public.vue | 18 ++--------- src/renderer/components/mixins/reloadable.vue | 25 ++++++++++++++++ 9 files changed, 50 insertions(+), 159 deletions(-) create mode 100644 src/renderer/components/mixins/reloadable.vue diff --git a/src/renderer/components/TimelineSpace/Contents/DirectMessages.vue b/src/renderer/components/TimelineSpace/Contents/DirectMessages.vue index 2caf701f..43df7ef3 100644 --- a/src/renderer/components/TimelineSpace/Contents/DirectMessages.vue +++ b/src/renderer/components/TimelineSpace/Contents/DirectMessages.vue @@ -32,10 +32,12 @@ import { mapState, mapGetters } from 'vuex' import Toot from './Cards/Toot' import scrollTop from '../../utils/scroll' +import reloadable from '~/src/renderer/components/mixins/reloadable' export default { name: 'directmessages', components: { Toot }, + mixins: [reloadable], data () { return { focusedId: null @@ -132,33 +134,7 @@ export default { async reload () { this.$store.commit('TimelineSpace/changeLoading', true) try { - const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { - this.$message({ - message: this.$t('message.account_load_error'), - type: 'error' - }) - throw err - }) - await this.$store.dispatch('TimelineSpace/stopUserStreaming') - await this.$store.dispatch('TimelineSpace/stopLocalStreaming') - - await this.$store.dispatch('TimelineSpace/Contents/DirectMessages/fetchTimeline', account) - .catch(() => { - this.$message({ - message: this.$t('message.timeline_fetch_error'), - type: 'error' - }) - }) - await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) - - this.$store.dispatch('TimelineSpace/startUserStreaming', account) - .catch(() => { - this.$message({ - message: this.$t('message.start_streaming_error'), - type: 'error' - }) - }) - this.$store.dispatch('TimelineSpace/startLocalStreaming', account) + await this.reloadable() } finally { this.$store.commit('TimelineSpace/changeLoading', false) } diff --git a/src/renderer/components/TimelineSpace/Contents/Favourites.vue b/src/renderer/components/TimelineSpace/Contents/Favourites.vue index 9e75b9d7..ab0f0c8e 100644 --- a/src/renderer/components/TimelineSpace/Contents/Favourites.vue +++ b/src/renderer/components/TimelineSpace/Contents/Favourites.vue @@ -29,10 +29,12 @@ import { mapState, mapGetters } from 'vuex' import Toot from './Cards/Toot' import scrollTop from '../../utils/scroll' +import reloadable from '~/src/renderer/components/mixins/reloadable' export default { name: 'favourites', components: { Toot }, + mixins: [reloadable], data () { return { heading: true, @@ -123,19 +125,7 @@ export default { async reload () { this.$store.commit('TimelineSpace/changeLoading', true) try { - const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { - this.$message({ - message: this.$t('message.account_load_error'), - type: 'error' - }) - throw err - }) - - await this.$store.dispatch('TimelineSpace/stopUserStreaming') - await this.$store.dispatch('TimelineSpace/stopLocalStreaming') - - await this.$store.dispatch('TimelineSpace/Contents/Home/fetchTimeline', account) - await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) + const account = await this.reloadable() await this.$store.dispatch('TimelineSpace/Contents/Favourites/fetchFavourites', account) .catch(() => { this.$message({ @@ -143,9 +133,6 @@ export default { type: 'error' }) }) - - this.$store.dispatch('TimelineSpace/startUserStreaming', account) - this.$store.dispatch('TimelineSpace/startLocalStreaming', account) } finally { this.$store.commit('TimelineSpace/changeLoading', false) } diff --git a/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue b/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue index c9e79c61..f1a3a077 100644 --- a/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue +++ b/src/renderer/components/TimelineSpace/Contents/Hashtag/Tag.vue @@ -14,7 +14,7 @@ v-on:delete="deleteToot" @focusNext="focusNext" @focusPrev="focusPrev" - @selectToot="focusToot(index)" + @selectToot="focusToot(message)" > @@ -31,10 +31,12 @@ import { mapState, mapGetters } from 'vuex' import Toot from '../Cards/Toot' import scrollTop from '../../../utils/scroll' +import reloadable from '~/src/renderer/components/mixins/reloadable' export default { name: 'tag', components: { Toot }, + mixins: [reloadable], props: ['tag'], data () { return { @@ -158,20 +160,8 @@ export default { const tag = this.tag this.$store.commit('TimelineSpace/changeLoading', true) try { - const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { - this.$message({ - message: this.$t('message.account_load_error'), - type: 'error' - }) - throw err - }) - - await this.$store.dispatch('TimelineSpace/stopUserStreaming') - await this.$store.dispatch('TimelineSpace/stopLocalStreaming') + await this.reloadable() await this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/stopStreaming') - - await this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/fetchTimeline', account) - await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) await this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/fetch', tag) .catch(() => { this.$message({ @@ -179,9 +169,6 @@ export default { type: 'error' }) }) - - this.$store.dispatch('TimelineSpace/startUserStreaming', account) - this.$store.dispatch('TimelineSpace/startLocalStreaming', account) this.$store.dispatch('TimelineSpace/Contents/Hashtag/Tag/startStreaming', tag) .catch(() => { this.$message({ diff --git a/src/renderer/components/TimelineSpace/Contents/Home.vue b/src/renderer/components/TimelineSpace/Contents/Home.vue index feb0ddda..027d1514 100644 --- a/src/renderer/components/TimelineSpace/Contents/Home.vue +++ b/src/renderer/components/TimelineSpace/Contents/Home.vue @@ -32,10 +32,12 @@ import { mapState, mapGetters } from 'vuex' import Toot from './Cards/Toot' import scrollTop from '../../utils/scroll' +import reloadable from '~/src/renderer/components/mixins/reloadable' export default { name: 'home', components: { Toot }, + mixins: [reloadable], data () { return { focusedId: null @@ -132,33 +134,7 @@ export default { async reload () { this.$store.commit('TimelineSpace/changeLoading', true) try { - const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { - this.$message({ - message: this.$t('message.account_load_error'), - type: 'error' - }) - throw err - }) - await this.$store.dispatch('TimelineSpace/stopUserStreaming') - await this.$store.dispatch('TimelineSpace/stopLocalStreaming') - - await this.$store.dispatch('TimelineSpace/Contents/Home/fetchTimeline', account) - .catch(() => { - this.$message({ - message: this.$t('message.timeline_fetch_error'), - type: 'error' - }) - }) - await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) - - this.$store.dispatch('TimelineSpace/startUserStreaming', account) - .catch(() => { - this.$message({ - message: this.$t('message.start_streaming_error'), - type: 'error' - }) - }) - this.$store.dispatch('TimelineSpace/startLocalStreaming', account) + await this.reloadable() } finally { this.$store.commit('TimelineSpace/changeLoading', false) } diff --git a/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue b/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue index f97cfd8b..80d0a203 100644 --- a/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue +++ b/src/renderer/components/TimelineSpace/Contents/Lists/Show.vue @@ -31,11 +31,13 @@ import { mapState, mapGetters } from 'vuex' import Toot from '../Cards/Toot' import scrollTop from '../../../utils/scroll' +import reloadable from '~/src/renderer/components/mixins/reloadable' export default { name: 'list', props: ['list_id'], components: { Toot }, + mixins: [reloadable], data () { return { focusedId: null @@ -157,20 +159,8 @@ export default { async reload () { this.$store.commit('TimelineSpace/changeLoading', true) try { - const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { - this.$message({ - message: this.$t('message.account_load_error'), - type: 'error' - }) - throw err - }) - - await this.$store.dispatch('TimelineSpace/stopUserStreaming') - await this.$store.dispatch('TimelineSpace/stopLocalStreaming') + await this.reloadable() await this.$store.dispatch('TimelineSpace/Contents/Lists/Show/stopStreaming') - - await this.$store.dispatch('TimelineSpace/Contents/Lists/Show/fetchTimeline', account) - await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) await this.$store.dispatch('TimelineSpace/Contents/Lists/Show/fetchTimeline', this.list_id) .catch(() => { this.$message({ @@ -178,9 +168,6 @@ export default { type: 'error' }) }) - - this.$store.dispatch('TimelineSpace/startUserStreaming', account) - this.$store.dispatch('TimelineSpace/startLocalStreaming', account) this.$store.dispatch('TimelineSpace/Contents/Lists/Show/startStreaming', this.list_id) .catch(() => { this.$message({ diff --git a/src/renderer/components/TimelineSpace/Contents/Local.vue b/src/renderer/components/TimelineSpace/Contents/Local.vue index 00dac823..a1064d4c 100644 --- a/src/renderer/components/TimelineSpace/Contents/Local.vue +++ b/src/renderer/components/TimelineSpace/Contents/Local.vue @@ -32,10 +32,12 @@ import { mapState, mapGetters } from 'vuex' import Toot from './Cards/Toot' import scrollTop from '../../utils/scroll' +import reloadable from '~/src/renderer/components/mixins/reloadable' export default { name: 'local', components: { Toot }, + mixins: [reloadable], data () { return { focusedId: null @@ -131,33 +133,7 @@ export default { async reload () { this.$store.commit('TimelineSpace/changeLoading', true) try { - const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { - this.$message({ - message: this.$t('message.account_load_error'), - type: 'error' - }) - throw err - }) - await this.$store.dispatch('TimelineSpace/stopUserStreaming') - await this.$store.dispatch('TimelineSpace/stopLocalStreaming') - - await this.$store.dispatch('TimelineSpace/Contents/Home/fetchTimeline', account) - await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) - .catch(() => { - this.$message({ - message: this.$t('message.timeline_fetch_error'), - type: 'error' - }) - }) - - this.$store.dispatch('TimelineSpace/startUserStreaming', account) - this.$store.dispatch('TimelineSpace/startLocalStreaming', account) - .catch(() => { - this.$message({ - message: this.$t('message.start_streaming_error'), - type: 'error' - }) - }) + await this.reloadable() } finally { this.$store.commit('TimelineSpace/changeLoading', false) } diff --git a/src/renderer/components/TimelineSpace/Contents/Notifications.vue b/src/renderer/components/TimelineSpace/Contents/Notifications.vue index 7fe28d49..b0bc0066 100644 --- a/src/renderer/components/TimelineSpace/Contents/Notifications.vue +++ b/src/renderer/components/TimelineSpace/Contents/Notifications.vue @@ -30,10 +30,12 @@ import { mapState, mapGetters } from 'vuex' import Notification from './Cards/Notification' import scrollTop from '../../utils/scroll' +import reloadable from '~/src/renderer/components/mixins/reloadable' export default { name: 'notifications', components: { Notification }, + mixins: [reloadable], data () { return { focusedId: null @@ -126,18 +128,7 @@ export default { async reload () { this.$store.commit('TimelineSpace/changeLoading', true) try { - const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { - this.$message({ - message: this.$t('message.account_load_error'), - type: 'error' - }) - throw err - }) - await this.$store.dispatch('TimelineSpace/stopUserStreaming') - await this.$store.dispatch('TimelineSpace/stopLocalStreaming') - - await this.$store.dispatch('TimelineSpace/Contents/Home/fetchTimeline', account) - await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) + const account = await this.reloadable() await this.$store.dispatch('TimelineSpace/Contents/Notifications/fetchNotifications', account) .catch(() => { this.$message({ @@ -147,8 +138,6 @@ export default { }) this.$store.dispatch('TimelineSpace/Contents/Notifications/resetBadge') - this.$store.dispatch('TimelineSpace/startUserStreaming', account) - this.$store.dispatch('TimelineSpace/startLocalStreaming', account) } finally { this.$store.commit('TimelineSpace/changeLoading', false) } diff --git a/src/renderer/components/TimelineSpace/Contents/Public.vue b/src/renderer/components/TimelineSpace/Contents/Public.vue index 721ce5df..d26f8aae 100644 --- a/src/renderer/components/TimelineSpace/Contents/Public.vue +++ b/src/renderer/components/TimelineSpace/Contents/Public.vue @@ -32,10 +32,12 @@ import { mapState, mapGetters } from 'vuex' import Toot from './Cards/Toot' import scrollTop from '../../utils/scroll' +import reloadable from '~/src/renderer/components/mixins/reloadable' export default { name: 'public', components: { Toot }, + mixins: [reloadable], data () { return { focusedId: null @@ -151,19 +153,8 @@ export default { async reload () { this.$store.commit('TimelineSpace/changeLoading', true) try { - const account = await this.$store.dispatch('TimelineSpace/localAccount', this.$route.params.id).catch((err) => { - this.$message({ - message: this.$t('message.account_load_error'), - type: 'error' - }) - throw err - }) - await this.$store.dispatch('TimelineSpace/stopUserStreaming') - await this.$store.dispatch('TimelineSpace/stopLocalStreaming') + await this.reloadable() await this.$store.dispatch('TimelineSpace/Contents/Public/stopPublicStreaming') - - await this.$store.dispatch('TimelineSpace/Contents/Home/fetchTimeline', account) - await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) await this.$store.dispatch('TimelineSpace/Contents/Public/fetchPublicTimeline') .catch(() => { this.$message({ @@ -171,9 +162,6 @@ export default { type: 'error' }) }) - - this.$store.dispatch('TimelineSpace/startUserStreaming', account) - this.$store.dispatch('TimelineSpace/startLocalStreaming', account) this.$store.dispatch('TimelineSpace/Contents/Public/startPublicStreaming') .catch(() => { this.$message({ diff --git a/src/renderer/components/mixins/reloadable.vue b/src/renderer/components/mixins/reloadable.vue new file mode 100644 index 00000000..2ebe155b --- /dev/null +++ b/src/renderer/components/mixins/reloadable.vue @@ -0,0 +1,25 @@ + From 78a6fbdf0b4f28db78290c2450a432d2e4171197 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 4 Nov 2018 14:36:48 +0900 Subject: [PATCH 4/4] refs #662 Reload direct messages in reloadable --- src/renderer/components/mixins/reloadable.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/renderer/components/mixins/reloadable.vue b/src/renderer/components/mixins/reloadable.vue index 2ebe155b..b24ce284 100644 --- a/src/renderer/components/mixins/reloadable.vue +++ b/src/renderer/components/mixins/reloadable.vue @@ -12,12 +12,15 @@ export default { }) await this.$store.dispatch('TimelineSpace/stopUserStreaming') await this.$store.dispatch('TimelineSpace/stopLocalStreaming') + await this.$store.dispatch('TimelineSpace/stopDirectMessagesStreaming') await this.$store.dispatch('TimelineSpace/Contents/Home/fetchTimeline', account) await this.$store.dispatch('TimelineSpace/Contents/Local/fetchLocalTimeline', account) + await this.$store.dispatch('TimelineSpace/Contents/DirectMessages/fetchTimeline', account) this.$store.dispatch('TimelineSpace/startUserStreaming', account) this.$store.dispatch('TimelineSpace/startLocalStreaming', account) + this.$store.dispatch('TimelineSpace/startDirectMessagesStreaming', account) return account } }