This commit is contained in:
syuilo
2017-12-22 06:56:37 +09:00
parent 26b40d8886
commit 34923888c7
6 changed files with 58 additions and 3 deletions

View File

@ -226,7 +226,9 @@
<mk-user-profile>
<div class="friend-form" if={ SIGNIN && I.id != user.id }>
<mk-big-follow-button user={ user }/>
<p class="followed" if={ user.is_followed }>フォローされています</p>
<p class="followed" if={ user.is_followed }>%i18n:desktop.tags.mk-user.follows-you%</p>
<p if={ user.is_muted }>%i18n:desktop.tags.mk-user.muted% <a onclick={ unmute }>%i18n:desktop.tags.mk-user.unmute%</a></p>
<p if={ !user.is_muted }><a onclick={ mute }>%i18n:desktop.tags.mk-user.mute%</a></p>
</div>
<div class="description" if={ user.description }>{ user.description }</div>
<div class="birthday" if={ user.profile.birthday }>
@ -311,6 +313,7 @@
this.age = require('s-age');
this.mixin('i');
this.mixin('api');
this.user = this.opts.user;
@ -325,6 +328,28 @@
user: this.user
});
};
this.mute = () => {
this.api('mute/create', {
user_id: this.user.id
}).then(() => {
this.user.is_muted = true;
this.update();
}, e => {
alert('error');
});
};
this.unmute = () => {
this.api('mute/delete', {
user_id: this.user.id
}).then(() => {
this.user.is_muted = false;
this.update();
}, e => {
alert('error');
});
};
</script>
</mk-user-profile>

View File

@ -75,6 +75,12 @@ props:
optional: true
desc:
ja: "自分がこのユーザーにフォローされているか"
- name: "is_muted"
type: "boolean"
optional: true
desc:
ja: "自分がこのユーザーをミュートしているか"
en: "Whether you muted this user"
- name: "last_used_at"
type: "date"
optional: false

3
src/web/docs/mute.ja.pug Normal file
View File

@ -0,0 +1,3 @@
h1 ミュート
p ユーザーをミュートすると、タイムラインや検索結果に対象のユーザーの投稿(およびそれらの投稿に対する返信やRepost)が表示されなくなります。