Add direct message tab.

This commit is contained in:
Roger Braun 2018-11-13 20:34:56 +01:00
parent 7f13cbc493
commit b37a0f4f23
7 changed files with 32 additions and 1 deletions

View file

@ -8,6 +8,7 @@ import FriendsTimeline from '../components/friends_timeline/friends_timeline.vue
import TagTimeline from '../components/tag_timeline/tag_timeline.vue' import TagTimeline from '../components/tag_timeline/tag_timeline.vue'
import ConversationPage from '../components/conversation-page/conversation-page.vue' import ConversationPage from '../components/conversation-page/conversation-page.vue'
import Mentions from '../components/mentions/mentions.vue' import Mentions from '../components/mentions/mentions.vue'
import DMs from '../components/dm_timeline/dm_timeline.vue'
import UserProfile from '../components/user_profile/user_profile.vue' import UserProfile from '../components/user_profile/user_profile.vue'
import Settings from '../components/settings/settings.vue' import Settings from '../components/settings/settings.vue'
import Registration from '../components/registration/registration.vue' import Registration from '../components/registration/registration.vue'
@ -88,6 +89,7 @@ const afterStoreSetup = ({store, i18n}) => {
{ name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } }, { name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
{ name: 'user-profile', path: '/users/:id', component: UserProfile }, { name: 'user-profile', path: '/users/:id', component: UserProfile },
{ name: 'mentions', path: '/:username/mentions', component: Mentions }, { name: 'mentions', path: '/:username/mentions', component: Mentions },
{ name: 'dms', path: '/:username/dms', component: DMs },
{ name: 'settings', path: '/settings', component: Settings }, { name: 'settings', path: '/settings', component: Settings },
{ name: 'registration', path: '/registration', component: Registration }, { name: 'registration', path: '/registration', component: Registration },
{ name: 'registration', path: '/registration/:token', component: Registration }, { name: 'registration', path: '/registration/:token', component: Registration },

View file

@ -0,0 +1,14 @@
import Timeline from '../timeline/timeline.vue'
const DMs = {
computed: {
timeline () {
return this.$store.state.statuses.timelines.dms
}
},
components: {
Timeline
}
}
export default DMs

View file

@ -0,0 +1,5 @@
<template>
<Timeline :title="$t('nav.dms')" v-bind:timeline="timeline" v-bind:timeline-name="'dms'"/>
</template>
<script src="./dm_timeline.js"></script>

View file

@ -5,6 +5,9 @@ const NavPanel = {
}, },
chat () { chat () {
return this.$store.state.chat.channel return this.$store.state.chat.channel
},
showDMs () {
return this.$store.state.instance.scopeOptionsEnabled
} }
} }
} }

View file

@ -12,6 +12,11 @@
{{ $t("nav.mentions") }} {{ $t("nav.mentions") }}
</router-link> </router-link>
</li> </li>
<li v-if='currentUser && showDMs'>
<router-link :to="{ name: 'dms', params: { username: currentUser.screen_name } }">
{{ $t("nav.dms") }}
</router-link>
</li>
<li v-if='currentUser && currentUser.locked'> <li v-if='currentUser && currentUser.locked'>
<router-link to='/friend-requests'> <router-link to='/friend-requests'>
{{ $t("nav.friend_requests") }} {{ $t("nav.friend_requests") }}

View file

@ -32,6 +32,7 @@
"chat": "Local Chat", "chat": "Local Chat",
"friend_requests": "Follow Requests", "friend_requests": "Follow Requests",
"mentions": "Mentions", "mentions": "Mentions",
"dms": "Direct Messages",
"public_tl": "Public Timeline", "public_tl": "Public Timeline",
"timeline": "Timeline", "timeline": "Timeline",
"twkn": "The Whole Known Network" "twkn": "The Whole Known Network"

View file

@ -41,7 +41,8 @@ export const defaultState = {
own: emptyTl(), own: emptyTl(),
publicAndExternal: emptyTl(), publicAndExternal: emptyTl(),
friends: emptyTl(), friends: emptyTl(),
tag: emptyTl() tag: emptyTl(),
dms: emptyTl()
} }
} }