This commit is contained in:
syuilo 2018-06-02 16:13:32 +09:00
parent 4feff8835c
commit 897f7a031d
11 changed files with 100 additions and 13 deletions

View file

@ -618,9 +618,9 @@ desktop/views/components/ui.header.post.vue:
desktop/views/components/ui.header.search.vue: desktop/views/components/ui.header.search.vue:
placeholder: "検索" placeholder: "検索"
desktop/views/components/follow-requests-window.vue: desktop/views/components/received-follow-requests-window.vue:
title: "フォロー申請" title: "フォロー申請"
accept: "許可" accept: "承認"
reject: "拒否" reject: "拒否"
desktop/views/components/user-lists-window.vue: desktop/views/components/user-lists-window.vue:
@ -852,6 +852,7 @@ mobile/views/components/ui.nav.vue:
timeline: "タイムライン" timeline: "タイムライン"
notifications: "通知" notifications: "通知"
messaging: "メッセージ" messaging: "メッセージ"
follow-requests: "フォロー申請"
search: "検索" search: "検索"
drive: "ドライブ" drive: "ドライブ"
favorites: "お気に入り" favorites: "お気に入り"
@ -900,6 +901,11 @@ mobile/views/pages/messaging.vue:
mobile/views/pages/messaging-room.vue: mobile/views/pages/messaging-room.vue:
messaging: "メッセージ" messaging: "メッセージ"
mobile/views/pages/received-follow-requests.vue:
title: "フォロー申請"
accept: "承認"
reject: "拒否"
mobile/views/pages/note.vue: mobile/views/pages/note.vue:
title: "投稿" title: "投稿"
prev: "前の投稿" prev: "前の投稿"

View file

@ -50,7 +50,7 @@
</div> </div>
</template> </template>
<template v-if="notification.type == 'reciveFollowRequest'"> <template v-if="notification.type == 'receiveFollowRequest'">
<mk-avatar class="avatar" :user="notification.user"/> <mk-avatar class="avatar" :user="notification.user"/>
<div class="text"> <div class="text">
<p>%fa:user-clock% <p>%fa:user-clock%
@ -268,7 +268,7 @@ root(isDark)
.text p i .text p i
color #53c7ce color #53c7ce
&.reciveFollowRequest &.receiveFollowRequest
.text p i .text p i
color #888 color #888

View file

@ -49,7 +49,7 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import MkUserListsWindow from './user-lists-window.vue'; import MkUserListsWindow from './user-lists-window.vue';
import MkFollowRequestsWindow from './follow-requests-window.vue'; import MkFollowRequestsWindow from './received-follow-requests-window.vue';
import MkSettingsWindow from './settings-window.vue'; import MkSettingsWindow from './settings-window.vue';
import MkDriveWindow from './drive-window.vue'; import MkDriveWindow from './drive-window.vue';
import contains from '../../../common/scripts/contains'; import contains from '../../../common/scripts/contains';

View file

@ -32,6 +32,7 @@ import MkNotifications from './views/pages/notifications.vue';
import MkWidgets from './views/pages/widgets.vue'; import MkWidgets from './views/pages/widgets.vue';
import MkMessaging from './views/pages/messaging.vue'; import MkMessaging from './views/pages/messaging.vue';
import MkMessagingRoom from './views/pages/messaging-room.vue'; import MkMessagingRoom from './views/pages/messaging-room.vue';
import MkReceivedFollowRequests from './views/pages/received-follow-requests.vue';
import MkNote from './views/pages/note.vue'; import MkNote from './views/pages/note.vue';
import MkSearch from './views/pages/search.vue'; import MkSearch from './views/pages/search.vue';
import MkFollowers from './views/pages/followers.vue'; import MkFollowers from './views/pages/followers.vue';
@ -78,6 +79,7 @@ init((launch) => {
{ path: '/i/favorites', name: 'favorites', component: MkFavorites }, { path: '/i/favorites', name: 'favorites', component: MkFavorites },
{ path: '/i/lists', name: 'user-lists', component: MkUserLists }, { path: '/i/lists', name: 'user-lists', component: MkUserLists },
{ path: '/i/lists/:list', name: 'user-list', component: MkUserList }, { path: '/i/lists/:list', name: 'user-list', component: MkUserList },
{ path: '/i/received-follow-requests', name: 'received-follow-requests', component: MkReceivedFollowRequests },
{ path: '/i/widgets', name: 'widgets', component: MkWidgets }, { path: '/i/widgets', name: 'widgets', component: MkWidgets },
{ path: '/i/messaging', name: 'messaging', component: MkMessaging }, { path: '/i/messaging', name: 'messaging', component: MkMessaging },
{ path: '/i/messaging/:user', component: MkMessagingRoom }, { path: '/i/messaging/:user', component: MkMessagingRoom },

View file

@ -31,7 +31,7 @@
</div> </div>
</template> </template>
<template v-if="notification.type == 'reciveFollowRequest'"> <template v-if="notification.type == 'receiveFollowRequest'">
<mk-avatar class="avatar" :user="notification.user"/> <mk-avatar class="avatar" :user="notification.user"/>
<div class="text"> <div class="text">
<p>%fa:user-clock%{{ notification.user | userName }}</p> <p>%fa:user-clock%{{ notification.user | userName }}</p>
@ -125,7 +125,7 @@ export default Vue.extend({
.text p i .text p i
color #53c7ce color #53c7ce
&.reciveFollowRequest &.receiveFollowRequest
.text p i .text p i
color #888 color #888

View file

@ -40,7 +40,7 @@
</div> </div>
</div> </div>
<div class="notification followRequest" v-if="notification.type == 'reciveFollowRequest'"> <div class="notification followRequest" v-if="notification.type == 'receiveFollowRequest'">
<mk-avatar class="avatar" :user="notification.user"/> <mk-avatar class="avatar" :user="notification.user"/>
<div> <div>
<header> <header>
@ -167,7 +167,7 @@ root(isDark)
> div > header i > div > header i
color #53c7ce color #53c7ce
&.reciveFollowRequest &.receiveFollowRequest
> div > header i > div > header i
color #888 color #888

View file

@ -18,6 +18,7 @@
<li><router-link to="/" :data-active="$route.name == 'index'">%fa:home%%i18n:@timeline%%fa:angle-right%</router-link></li> <li><router-link to="/" :data-active="$route.name == 'index'">%fa:home%%i18n:@timeline%%fa:angle-right%</router-link></li>
<li><router-link to="/i/notifications" :data-active="$route.name == 'notifications'">%fa:R bell%%i18n:@notifications%<template v-if="hasUnreadNotification">%fa:circle%</template>%fa:angle-right%</router-link></li> <li><router-link to="/i/notifications" :data-active="$route.name == 'notifications'">%fa:R bell%%i18n:@notifications%<template v-if="hasUnreadNotification">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/i/messaging" :data-active="$route.name == 'messaging'">%fa:R comments%%i18n:@messaging%<template v-if="hasUnreadMessagingMessage">%fa:circle%</template>%fa:angle-right%</router-link></li> <li><router-link to="/i/messaging" :data-active="$route.name == 'messaging'">%fa:R comments%%i18n:@messaging%<template v-if="hasUnreadMessagingMessage">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li v-if="$store.getters.isSignedIn && $store.state.i.isLocked"><router-link to="/i/received-follow-requests" :data-active="$route.name == 'received-follow-requests'">%fa:R envelope%%i18n:@follow-requests%<template v-if="$store.getters.isSignedIn && $store.state.i.pendingReceivedFollowRequestsCount">%fa:circle%</template>%fa:angle-right%</router-link></li>
<li><router-link to="/othello" :data-active="$route.name == 'othello'">%fa:gamepad%%i18n:@game%<template v-if="hasGameInvitation">%fa:circle%</template>%fa:angle-right%</router-link></li> <li><router-link to="/othello" :data-active="$route.name == 'othello'">%fa:gamepad%%i18n:@game%<template v-if="hasGameInvitation">%fa:circle%</template>%fa:angle-right%</router-link></li>
</ul> </ul>
<ul> <ul>

View file

@ -0,0 +1,78 @@
<template>
<mk-ui>
<span slot="header">%fa:envelope R%%i18n:@title%</span>
<main>
<div v-for="req in requests">
<router-link :key="req.id" :to="req.follower | userPage">{{ req.follower | userName }}</router-link>
<span>
<a @click="accept(req.follower)">%i18n:@accept%</a>|<a @click="reject(req.follower)">%i18n:@reject%</a>
</span>
</div>
</main>
</mk-ui>
</template>
<script lang="ts">
import Vue from 'vue';
import Progress from '../../../common/scripts/loading';
export default Vue.extend({
data() {
return {
fetching: true,
requests: []
};
},
mounted() {
document.title = 'Misskey | %i18n:@title%';
Progress.start();
(this as any).api('following/requests/list').then(requests => {
this.fetching = false;
this.requests = requests;
Progress.done();
});
},
methods: {
accept(user) {
(this as any).api('following/requests/accept', { userId: user.id }).then(() => {
this.requests = this.requests.filter(r => r.follower.id != user.id);
});
},
reject(user) {
(this as any).api('following/requests/reject', { userId: user.id }).then(() => {
this.requests = this.requests.filter(r => r.follower.id != user.id);
});
}
}
});
</script>
<style lang="stylus" scoped>
@import '~const.styl'
main
width 100%
max-width 680px
margin 0 auto
padding 8px
@media (min-width 500px)
padding 16px
@media (min-width 600px)
padding 32px
> div
display flex
padding 16px
border solid 1px isDark ? #1c2023 : #eee
border-radius 4px
> span
margin 0 0 0 auto
</style>

View file

@ -111,7 +111,7 @@ export const pack = (notification: any) => new Promise<any>(async (resolve, reje
switch (_notification.type) { switch (_notification.type) {
case 'follow': case 'follow':
case 'reciveFollowRequest': case 'receiveFollowRequest':
// nope // nope
break; break;
case 'mention': case 'mention':

View file

@ -31,16 +31,16 @@ export default async function(follower: IUser, followee: IUser) {
} }
}); });
// Publish reciveRequest event // Publish receiveRequest event
if (isLocalUser(followee)) { if (isLocalUser(followee)) {
packUser(follower, followee).then(packed => event(followee._id, 'reciveFollowRequest', packed)); packUser(follower, followee).then(packed => event(followee._id, 'receiveFollowRequest', packed));
packUser(followee, followee, { packUser(followee, followee, {
detail: true detail: true
}).then(packed => event(followee._id, 'meUpdated', packed)); }).then(packed => event(followee._id, 'meUpdated', packed));
// 通知を作成 // 通知を作成
notify(followee._id, follower._id, 'reciveFollowRequest'); notify(followee._id, follower._id, 'receiveFollowRequest');
} }
if (isLocalUser(follower) && isRemoteUser(followee)) { if (isLocalUser(follower) && isRemoteUser(followee)) {