From ffb9d4faf5c6cebb89947a0a9a085fa07e295d42 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 13 Nov 2018 20:20:46 +0100 Subject: [PATCH 1/3] api service url --- src/services/api/api.service.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index ab746918..3ac7e4b1 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -15,6 +15,7 @@ const STATUS_URL = '/api/statuses/show' const MEDIA_UPLOAD_URL = '/api/statusnet/media/upload' const CONVERSATION_URL = '/api/statusnet/conversation' const MENTIONS_URL = '/api/statuses/mentions.json' +const DM_TIMELINE_URL = '/api/statuses/dm_timeline.json' const FOLLOWERS_URL = '/api/statuses/followers.json' const FRIENDS_URL = '/api/statuses/friends.json' const FOLLOWING_URL = '/api/friendships/create.json' @@ -302,6 +303,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use public: PUBLIC_TIMELINE_URL, friends: FRIENDS_TIMELINE_URL, mentions: MENTIONS_URL, + dms: DM_TIMELINE_URL, notifications: QVITTER_USER_NOTIFICATIONS_URL, 'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL, user: QVITTER_USER_TIMELINE_URL, From b37a0f4f23fcb81353a98d45f55cc760b84c5d0f Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 13 Nov 2018 20:34:56 +0100 Subject: [PATCH 2/3] Add direct message tab. --- src/boot/after_store.js | 2 ++ src/components/dm_timeline/dm_timeline.js | 14 ++++++++++++++ src/components/dm_timeline/dm_timeline.vue | 5 +++++ src/components/nav_panel/nav_panel.js | 3 +++ src/components/nav_panel/nav_panel.vue | 5 +++++ src/i18n/en.json | 1 + src/modules/statuses.js | 3 ++- 7 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/components/dm_timeline/dm_timeline.js create mode 100644 src/components/dm_timeline/dm_timeline.vue 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 @@ + + + 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") }} +
  • + + {{ $t("nav.dms") }} + +
  • {{ $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() } } From c7d469249ec9ce8cc28317a621f2b53360103cf9 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 13 Nov 2018 22:30:00 +0100 Subject: [PATCH 3/3] Always show dm panel. --- src/components/nav_panel/nav_panel.js | 3 --- src/components/nav_panel/nav_panel.vue | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js index caab8102..ea5d7ea4 100644 --- a/src/components/nav_panel/nav_panel.js +++ b/src/components/nav_panel/nav_panel.js @@ -5,9 +5,6 @@ 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 950825b7..93deaf97 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -12,7 +12,7 @@ {{ $t("nav.mentions") }}
  • -
  • +
  • {{ $t("nav.dms") }}