summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-08-02 10:05:41 +0900
committerGitHub <noreply@github.com>2018-08-02 10:05:41 +0900
commit3fa8433a0e0943a8c6320d3e7cda0f705b2dd25a (patch)
tree1701e9e2627622ab2280ba9acf61247758b3e562 /src
parentNew translations ja.yml (Catalan) (diff)
parent:v: (diff)
downloadmisskey-3fa8433a0e0943a8c6320d3e7cda0f705b2dd25a.tar.gz
misskey-3fa8433a0e0943a8c6320d3e7cda0f705b2dd25a.tar.bz2
misskey-3fa8433a0e0943a8c6320d3e7cda0f705b2dd25a.zip
Merge branch 'master' into l10n_master
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/views/components/games/reversi/reversi.game.vue8
-rw-r--r--src/client/app/common/views/components/games/reversi/reversi.room.vue6
-rw-r--r--src/client/app/common/views/components/games/reversi/reversi.vue8
-rw-r--r--src/client/app/common/views/components/messaging-room.message.vue5
-rw-r--r--src/client/app/common/views/widgets/calendar.vue6
-rw-r--r--src/client/app/desktop/views/pages/search.vue2
-rw-r--r--src/client/app/desktop/views/pages/tag.vue2
-rw-r--r--src/client/app/mobile/views/pages/tag.vue2
-rw-r--r--src/misc/get-user-name.ts2
-rw-r--r--src/models/notification.ts1
-rw-r--r--src/server/api/endpoints/i/notifications.ts13
-rw-r--r--src/services/note/create.ts23
12 files changed, 34 insertions, 44 deletions
diff --git a/src/client/app/common/views/components/games/reversi/reversi.game.vue b/src/client/app/common/views/components/games/reversi/reversi.game.vue
index 0c183b343e..de9c0395c7 100644
--- a/src/client/app/common/views/components/games/reversi/reversi.game.vue
+++ b/src/client/app/common/views/components/games/reversi/reversi.game.vue
@@ -1,14 +1,14 @@
<template>
<div class="root">
- <header><b>{{ blackUser.name }}</b>(%i18n:common.reversi.black%) vs <b>{{ whiteUser.name }}</b>(%i18n:common.reversi.white%)</header>
+ <header><b>{{ blackUser | userName }}</b>(%i18n:common.reversi.black%) vs <b>{{ whiteUser | userName }}</b>(%i18n:common.reversi.white%)</header>
<div style="overflow: hidden">
- <p class="turn" v-if="!iAmPlayer && !game.isEnded">{{ '%i18n:common.reversi.turn-of%'.replace('{}', turnUser.name) }}<mk-ellipsis/></p>
- <p class="turn" v-if="logPos != logs.length">{{ '%i18n:common.reversi.past-turn-of%'.replace('{}', turnUser.name) }}</p>
+ <p class="turn" v-if="!iAmPlayer && !game.isEnded">{{ '%i18n:common.reversi.turn-of%'.replace('{}', turnUser | userName) }}<mk-ellipsis/></p>
+ <p class="turn" v-if="logPos != logs.length">{{ '%i18n:common.reversi.past-turn-of%'.replace('{}', turnUser | userName) }}</p>
<p class="turn1" v-if="iAmPlayer && !game.isEnded && !isMyTurn">%i18n:common.reversi.opponent-turn%<mk-ellipsis/></p>
<p class="turn2" v-if="iAmPlayer && !game.isEnded && isMyTurn" v-animate-css="{ classes: 'tada', iteration: 'infinite' }">%i18n:common.reversi.my-turn%</p>
<p class="result" v-if="game.isEnded && logPos == logs.length">
- <template v-if="game.winner">{{ '%i18n:common.reversi.won%'.replace('{}', game.winner.name) }}{{ game.settings.isLlotheo ? ' (ロセオ)' : '' }}</template>
+ <template v-if="game.winner">{{ '%i18n:common.reversi.won%'.replace('{}', game.winner | userName) }}{{ game.settings.isLlotheo ? ' (ロセオ)' : '' }}</template>
<template v-else>%i18n:common.reversi.drawn%</template>
</p>
</div>
diff --git a/src/client/app/common/views/components/games/reversi/reversi.room.vue b/src/client/app/common/views/components/games/reversi/reversi.room.vue
index 7aec4069c5..94b36d0870 100644
--- a/src/client/app/common/views/components/games/reversi/reversi.room.vue
+++ b/src/client/app/common/views/components/games/reversi/reversi.room.vue
@@ -1,6 +1,6 @@
<template>
<div class="root">
- <header><b>{{ game.user1.name }}</b> vs <b>{{ game.user2.name }}</b></header>
+ <header><b>{{ game.user1 | userName }}</b> vs <b>{{ game.user2 | userName }}</b></header>
<div>
<p>%i18n:@settings-of-the-game%</p>
@@ -33,8 +33,8 @@
<span>%i18n:@black-or-white%</span>
</div>
<el-radio v-model="game.settings.bw" label="random" @change="updateSettings">%i18n:@random%</el-radio>
- <el-radio v-model="game.settings.bw" :label="1" @change="updateSettings">{{ '%i18n:@black-is%'.split('{}')[0] }}{{ game.user1.name }}{{ '%i18n:@black-is%'.split('{}')[1] }}</el-radio>
- <el-radio v-model="game.settings.bw" :label="2" @change="updateSettings">{{ '%i18n:@black-is%'.split('{}')[0] }}{{ game.user2.name }}{{ '%i18n:@black-is%'.split('{}')[1] }}</el-radio>
+ <el-radio v-model="game.settings.bw" :label="1" @change="updateSettings">{{ '%i18n:@black-is%'.split('{}')[0] }}{{ game.user1 | userName }}{{ '%i18n:@black-is%'.split('{}')[1] }}</el-radio>
+ <el-radio v-model="game.settings.bw" :label="2" @change="updateSettings">{{ '%i18n:@black-is%'.split('{}')[0] }}{{ game.user2 | userName }}{{ '%i18n:@black-is%'.split('{}')[1] }}</el-radio>
</el-card>
<el-card class="rules">
diff --git a/src/client/app/common/views/components/games/reversi/reversi.vue b/src/client/app/common/views/components/games/reversi/reversi.vue
index 2ec275e818..43f1c6656a 100644
--- a/src/client/app/common/views/components/games/reversi/reversi.vue
+++ b/src/client/app/common/views/components/games/reversi/reversi.vue
@@ -4,7 +4,7 @@
<x-gameroom :game="game"/>
</div>
<div class="matching" v-else-if="matching">
- <h1>{{ '%i18n:@matching.waiting-for%'.split('{}')[0] }}<b>{{ matching.name }}</b>{{ '%i18n:@matching.waiting-for%'.split('{}')[1] }}<mk-ellipsis/></h1>
+ <h1>{{ '%i18n:@matching.waiting-for%'.split('{}')[0] }}<b>{{ matching | userName }}</b>{{ '%i18n:@matching.waiting-for%'.split('{}')[1] }}<mk-ellipsis/></h1>
<div class="cancel">
<el-button round @click="cancel">%i18n:@matching.cancel%</el-button>
</div>
@@ -30,7 +30,7 @@
<h2>%i18n:@invitations%</h2>
<div class="invitation" v-for="i in invitations" tabindex="-1" @click="accept(i)">
<mk-avatar class="avatar" :user="i.parent"/>
- <span class="name"><b>{{ i.parent.name }}</b></span>
+ <span class="name"><b>{{ i.parent | userName }}</b></span>
<span class="username">@{{ i.parent.username }}</span>
<mk-time :time="i.createdAt"/>
</div>
@@ -40,7 +40,7 @@
<a class="game" v-for="g in myGames" tabindex="-1" @click.prevent="go(g)" :href="`/reversi/${g.id}`">
<mk-avatar class="avatar" :user="g.user1"/>
<mk-avatar class="avatar" :user="g.user2"/>
- <span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
+ <span><b>{{ g.user1 | userName }}</b> vs <b>{{ g.user2 | userName }}</b></span>
<span class="state">{{ g.isEnded ? '%i18n:@game-state.ended%' : '%i18n:@game-state.playing%' }}</span>
</a>
</section>
@@ -49,7 +49,7 @@
<a class="game" v-for="g in games" tabindex="-1" @click.prevent="go(g)" :href="`/reversi/${g.id}`">
<mk-avatar class="avatar" :user="g.user1"/>
<mk-avatar class="avatar" :user="g.user2"/>
- <span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
+ <span><b>{{ g.user1 | userName }}</b> vs <b>{{ g.user2 | userName }}</b></span>
<span class="state">{{ g.isEnded ? '%i18n:@game-state.ended%' : '%i18n:@game-state.playing%' }}</span>
</a>
</section>
diff --git a/src/client/app/common/views/components/messaging-room.message.vue b/src/client/app/common/views/components/messaging-room.message.vue
index 65231aed17..648d0eee18 100644
--- a/src/client/app/common/views/components/messaging-room.message.vue
+++ b/src/client/app/common/views/components/messaging-room.message.vue
@@ -79,7 +79,8 @@ root(isDark)
> .content
> .balloon
- display block
+ display flex
+ align-items center
padding 0
max-width calc(100% - 16px)
min-height 38px
@@ -254,7 +255,7 @@ root(isDark)
font-size 11px
&[data-is-deleted]
- > .baloon
+ > .balloon
opacity 0.5
.message[data-darkmode]
diff --git a/src/client/app/common/views/widgets/calendar.vue b/src/client/app/common/views/widgets/calendar.vue
index 68a58f8936..eb15030370 100644
--- a/src/client/app/common/views/widgets/calendar.vue
+++ b/src/client/app/common/views/widgets/calendar.vue
@@ -4,10 +4,10 @@
<div class="mkw-calendar--body">
<div class="calendar" :data-is-holiday="isHoliday">
<p class="month-and-year">
- <span class="year">%i18n:@year-english%{{ year }}%i18n:@year-japanese%</span>
- <span class="month">%i18n:@month-english%{{ month }}%i18n:@month-japanese%</span>
+ <span class="year">{{ '%i18n:@year%'.split('{}')[0] }}{{ year }}{{ '%i18n:@year%'.split('{}')[1] }}</span>
+ <span class="month">{{ '%i18n:@month%'.split('{}')[0] }}{{ month }}{{ '%i18n:@month%'.split('{}')[1] }}</span>
</p>
- <p class="day">%i18n:@day-english%{{ day }}%i18n:@day-japanese%</p>
+ <p class="day">{{ '%i18n:@day%'.split('{}')[0] }}{{ day }}{{ '%i18n:@day%'.split('{}')[1] }}</p>
<p class="week-day">{{ weekDay }}</p>
</div>
<div class="info">
diff --git a/src/client/app/desktop/views/pages/search.vue b/src/client/app/desktop/views/pages/search.vue
index 2db9617db4..0b6c9a032a 100644
--- a/src/client/app/desktop/views/pages/search.vue
+++ b/src/client/app/desktop/views/pages/search.vue
@@ -7,7 +7,7 @@
<mk-ellipsis-icon/>
</div>
<p :class="$style.notAvailable" v-if="!fetching && notAvailable">%i18n:@not-available%</p>
- <p :class="$style.empty" v-if="!fetching && empty">%fa:search%%i18n:@not-found-text-english%%i18n:@not-found-quotes1%{{ q }}%i18n:@not-found-quotes2%%i18n:@not-found-text-japanese%</p>
+ <p :class="$style.empty" v-if="!fetching && empty">%fa:search% {{ '%i18n:not-found%'.split('{}')[0] }}{{ q }}{{ '%i18n:not-found%'.split('{}')[1] }}</p>
<mk-notes ref="timeline" :class="$style.notes" :more="existMore ? more : null"/>
</mk-ui>
</template>
diff --git a/src/client/app/desktop/views/pages/tag.vue b/src/client/app/desktop/views/pages/tag.vue
index 19f7ad1c1b..04b377e0ab 100644
--- a/src/client/app/desktop/views/pages/tag.vue
+++ b/src/client/app/desktop/views/pages/tag.vue
@@ -6,7 +6,7 @@
<div :class="$style.loading" v-if="fetching">
<mk-ellipsis-icon/>
</div>
- <p :class="$style.empty" v-if="!fetching && empty">%i18n:no-posts-found-english%%fa:search%%i18n:left-quote%{{ q }}%i18n:right-quote%%i18n:no-posts-found-japanese%</p>
+ <p :class="$style.empty" v-if="!fetching && empty">%fa:search% {{ '%i18n:no-posts-found%'.split('{}')[0] }}{{ q }}{{ '%i18n:no-posts-found%'.split('{}')[1] }}</p>
<mk-notes ref="timeline" :class="$style.notes" :more="existMore ? more : null"/>
</mk-ui>
</template>
diff --git a/src/client/app/mobile/views/pages/tag.vue b/src/client/app/mobile/views/pages/tag.vue
index c94fcec7da..a545e2b839 100644
--- a/src/client/app/mobile/views/pages/tag.vue
+++ b/src/client/app/mobile/views/pages/tag.vue
@@ -3,7 +3,7 @@
<span slot="header">%fa:hashtag%{{ $route.params.tag }}</span>
<main>
- <p v-if="!fetching && empty">%fa:search%%i18n:@no-posts-found-english%%i18n:@left-quote%{{ q }}%i18n:@right-quote%%i18n:@no-posts-found-japanese%</p>
+ <p v-if="!fetching && empty">%fa:search% {{ '%i18n:no-posts-found%'.split('{}')[0] }}{{ q }}{{ '%i18n:no-posts-found%'.split('{}')[1] }}</p>
<mk-notes ref="timeline" :more="existMore ? more : null"/>
</main>
</mk-ui>
diff --git a/src/misc/get-user-name.ts b/src/misc/get-user-name.ts
index acd5e6626d..eab9f87ef0 100644
--- a/src/misc/get-user-name.ts
+++ b/src/misc/get-user-name.ts
@@ -1,5 +1,5 @@
import { IUser } from '../models/user';
export default function(user: IUser): string {
- return user.name || '名無し';
+ return user.name || user.username;
}
diff --git a/src/models/notification.ts b/src/models/notification.ts
index 097e3e691f..835c89cd56 100644
--- a/src/models/notification.ts
+++ b/src/models/notification.ts
@@ -5,6 +5,7 @@ import { IUser, pack as packUser } from './user';
import { pack as packNote } from './note';
const Notification = db.get<INotification>('notifications');
+Notification.createIndex('notifieeId');
export default Notification;
export interface INotification {
diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts
index b6865fba52..46242b9d9f 100644
--- a/src/server/api/endpoints/i/notifications.ts
+++ b/src/server/api/endpoints/i/notifications.ts
@@ -19,10 +19,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
const [markAsRead = true, markAsReadErr] = $.bool.optional.get(params.markAsRead);
if (markAsReadErr) return rej('invalid markAsRead param');
- // Get 'type' parameter
- const [type, typeErr] = $.arr($.str).optional.unique().get(params.type);
- if (typeErr) return rej('invalid type param');
-
// Get 'limit' parameter
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
if (limitErr) return rej('invalid limit param');
@@ -41,8 +37,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
}
const mute = await Mute.find({
- muterId: user._id,
- deletedAt: { $exists: false }
+ muterId: user._id
});
const query = {
@@ -69,12 +64,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
});
}
- if (type) {
- query.type = {
- $in: type
- };
- }
-
if (sinceId) {
sort._id = 1;
query._id = {
diff --git a/src/services/note/create.ts b/src/services/note/create.ts
index 6e644ef1d3..20dfc78c04 100644
--- a/src/services/note/create.ts
+++ b/src/services/note/create.ts
@@ -164,14 +164,19 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
}
// 通知
- nm.push(data.reply.userId, 'reply');
+ if (isLocalUser(data.reply._user)) {
+ nm.push(data.reply.userId, 'reply');
+ }
}
// If it is renote
if (data.renote) {
- // Notify
const type = data.text ? 'quote' : 'renote';
- nm.push(data.renote.userId, type);
+
+ // Notify
+ if (isLocalUser(data.renote._user)) {
+ nm.push(data.renote.userId, type);
+ }
// Fetch watchers
nmRelatedPromises.push(notifyToWatchersOfRenotee(data.renote, user, nm, type));
@@ -181,15 +186,9 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
watch(user._id, data.renote);
}
- // If it is quote renote
- if (data.text) {
- // Add mention
- nm.push(data.renote.userId, 'quote');
- } else {
- // Publish event
- if (!user._id.equals(data.renote.userId)) {
- publishUserStream(data.renote.userId, 'renote', noteObj);
- }
+ // Publish event
+ if (!user._id.equals(data.renote.userId)) {
+ publishUserStream(data.renote.userId, 'renote', noteObj);
}
}