aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2018-11-13 20:34:56 +0100
committerRoger Braun <roger@rogerbraun.net>2018-11-13 20:34:56 +0100
commitb37a0f4f23fcb81353a98d45f55cc760b84c5d0f (patch)
tree6aa295b1c4b7310a650e6e048524c078a34b4dec
parent7f13cbc493862cfe3f93f7e33e14cf73de92de66 (diff)
Add direct message tab.
-rw-r--r--src/boot/after_store.js2
-rw-r--r--src/components/dm_timeline/dm_timeline.js14
-rw-r--r--src/components/dm_timeline/dm_timeline.vue5
-rw-r--r--src/components/nav_panel/nav_panel.js3
-rw-r--r--src/components/nav_panel/nav_panel.vue5
-rw-r--r--src/i18n/en.json1
-rw-r--r--src/modules/statuses.js3
7 files changed, 32 insertions, 1 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 6b8aef7f..90f25302 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -8,6 +8,7 @@ import FriendsTimeline from '../components/friends_timeline/friends_timeline.vue
import TagTimeline from '../components/tag_timeline/tag_timeline.vue'
import ConversationPage from '../components/conversation-page/conversation-page.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 Settings from '../components/settings/settings.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: 'user-profile', path: '/users/:id', component: UserProfile },
{ name: 'mentions', path: '/:username/mentions', component: Mentions },
+ { name: 'dms', path: '/:username/dms', component: DMs },
{ name: 'settings', path: '/settings', component: Settings },
{ name: 'registration', path: '/registration', component: Registration },
{ name: 'registration', path: '/registration/:token', component: Registration },
diff --git a/src/components/dm_timeline/dm_timeline.js b/src/components/dm_timeline/dm_timeline.js
new file mode 100644
index 00000000..8b5393a9
--- /dev/null
+++ b/src/components/dm_timeline/dm_timeline.js
@@ -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
diff --git a/src/components/dm_timeline/dm_timeline.vue b/src/components/dm_timeline/dm_timeline.vue
new file mode 100644
index 00000000..f03da4d3
--- /dev/null
+++ b/src/components/dm_timeline/dm_timeline.vue
@@ -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>
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
index ea5d7ea4..caab8102 100644
--- a/src/components/nav_panel/nav_panel.js
+++ b/src/components/nav_panel/nav_panel.js
@@ -5,6 +5,9 @@ const NavPanel = {
},
chat () {
return this.$store.state.chat.channel
+ },
+ showDMs () {
+ return this.$store.state.instance.scopeOptionsEnabled
}
}
}
diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue
index 0b188f9a..950825b7 100644
--- a/src/components/nav_panel/nav_panel.vue
+++ b/src/components/nav_panel/nav_panel.vue
@@ -12,6 +12,11 @@
{{ $t("nav.mentions") }}
</router-link>
</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'>
<router-link to='/friend-requests'>
{{ $t("nav.friend_requests") }}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 036231bf..cadbaf95 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -32,6 +32,7 @@
"chat": "Local Chat",
"friend_requests": "Follow Requests",
"mentions": "Mentions",
+ "dms": "Direct Messages",
"public_tl": "Public Timeline",
"timeline": "Timeline",
"twkn": "The Whole Known Network"
diff --git a/src/modules/statuses.js b/src/modules/statuses.js
index f980f53d..89e00119 100644
--- a/src/modules/statuses.js
+++ b/src/modules/statuses.js
@@ -41,7 +41,8 @@ export const defaultState = {
own: emptyTl(),
publicAndExternal: emptyTl(),
friends: emptyTl(),
- tag: emptyTl()
+ tag: emptyTl(),
+ dms: emptyTl()
}
}