summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/mios.ts4
-rw-r--r--src/client/app/desktop/views/components/settings.vue14
-rw-r--r--src/client/app/desktop/views/components/timeline.core.vue23
-rw-r--r--src/client/app/mobile/views/components/timeline.vue33
4 files changed, 68 insertions, 6 deletions
diff --git a/src/client/app/common/mios.ts b/src/client/app/common/mios.ts
index 6fed267d6e..463f763888 100644
--- a/src/client/app/common/mios.ts
+++ b/src/client/app/common/mios.ts
@@ -21,7 +21,9 @@ const defaultSettings = {
showMaps: true,
showPostFormOnTopOfTl: false,
gradientWindowHeader: false,
- showReplyTarget: true
+ showReplyTarget: true,
+ showMyRenotes: true,
+ showRenotedMyNotes: true
};
//#region api requests
diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue
index adfe43bb64..b5111dabc9 100644
--- a/src/client/app/desktop/views/components/settings.vue
+++ b/src/client/app/desktop/views/components/settings.vue
@@ -45,6 +45,8 @@
</div>
<mk-switch v-model="os.i.clientSettings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="タイムライン上部に投稿フォームを表示する"/>
<mk-switch v-model="os.i.clientSettings.showReplyTarget" @change="onChangeShowReplyTarget" text="リプライ先を表示する"/>
+ <mk-switch v-model="os.i.clientSettings.showMyRenotes" @change="onChangeShowMyRenotes" text="自分の行ったRenoteをタイムラインに表示する"/>
+ <mk-switch v-model="os.i.clientSettings.showRenotedMyNotes" @change="onChangeShowRenotedMyNotes" text="Renoteされた自分の投稿をタイムラインに表示する"/>
<mk-switch v-model="os.i.clientSettings.showMaps" @change="onChangeShowMaps" text="マップの自動展開">
<span>位置情報が添付された投稿のマップを自動的に展開します。</span>
</mk-switch>
@@ -319,6 +321,18 @@ export default Vue.extend({
value: v
});
},
+ onChangeShowMyRenotes(v) {
+ (this as any).api('i/update_client_setting', {
+ name: 'showMyRenotes',
+ value: v
+ });
+ },
+ onChangeShowRenotedMyNotes(v) {
+ (this as any).api('i/update_client_setting', {
+ name: 'showRenotedMyNotes',
+ value: v
+ });
+ },
onChangeShowMaps(v) {
(this as any).api('i/update_client_setting', {
name: 'showMaps',
diff --git a/src/client/app/desktop/views/components/timeline.core.vue b/src/client/app/desktop/views/components/timeline.core.vue
index 1e98f087e1..f66ae57885 100644
--- a/src/client/app/desktop/views/components/timeline.core.vue
+++ b/src/client/app/desktop/views/components/timeline.core.vue
@@ -90,7 +90,9 @@ export default Vue.extend({
(this as any).api(this.endpoint, {
limit: 11,
- untilDate: this.date ? this.date.getTime() : undefined
+ untilDate: this.date ? this.date.getTime() : undefined,
+ includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
+ includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
}).then(notes => {
if (notes.length == 11) {
notes.pop();
@@ -108,7 +110,9 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api(this.endpoint, {
limit: 11,
- untilId: this.notes[this.notes.length - 1].id
+ untilId: this.notes[this.notes.length - 1].id,
+ includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
+ includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
}).then(notes => {
if (notes.length == 11) {
notes.pop();
@@ -121,6 +125,21 @@ export default Vue.extend({
},
onNote(note) {
+ const isMyNote = note.userId == (this as any).os.i.id;
+ const isPureRenote = note.renoteId != null && note.text == null && note.mediaIds.length == 0 && note.poll == null;
+
+ if ((this as any).os.i.clientSettings.showMyRenotes === false) {
+ if (isMyNote && isPureRenote) {
+ return;
+ }
+ }
+
+ if ((this as any).os.i.clientSettings.showRenotedMyNotes === false) {
+ if (isPureRenote && (note.renote.userId == (this as any).os.i.id)) {
+ return;
+ }
+ }
+
// サウンドを再生する
if ((this as any).os.isEnableSounds) {
const sound = new Audio(`${url}/assets/post.mp3`);
diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue
index 11b82aa456..a6227996b8 100644
--- a/src/client/app/mobile/views/components/timeline.vue
+++ b/src/client/app/mobile/views/components/timeline.vue
@@ -30,6 +30,7 @@ export default Vue.extend({
default: null
}
},
+
data() {
return {
fetching: true,
@@ -40,11 +41,13 @@ export default Vue.extend({
connectionId: null
};
},
+
computed: {
alone(): boolean {
return (this as any).os.i.followingCount == 0;
}
},
+
mounted() {
this.connection = (this as any).os.stream.getConnection();
this.connectionId = (this as any).os.stream.use();
@@ -53,20 +56,24 @@ export default Vue.extend({
this.connection.on('follow', this.onChangeFollowing);
this.connection.on('unfollow', this.onChangeFollowing);
-this.fetch();
+ this.fetch();
},
+
beforeDestroy() {
this.connection.off('note', this.onNote);
this.connection.off('follow', this.onChangeFollowing);
this.connection.off('unfollow', this.onChangeFollowing);
(this as any).os.stream.dispose(this.connectionId);
},
+
methods: {
fetch(cb?) {
this.fetching = true;
(this as any).api('notes/timeline', {
limit: limit + 1,
- untilDate: this.date ? (this.date as any).getTime() : undefined
+ untilDate: this.date ? (this.date as any).getTime() : undefined,
+ includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
+ includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
}).then(notes => {
if (notes.length == limit + 1) {
notes.pop();
@@ -78,11 +85,14 @@ this.fetch();
if (cb) cb();
});
},
+
more() {
this.moreFetching = true;
(this as any).api('notes/timeline', {
limit: limit + 1,
- untilId: this.notes[this.notes.length - 1].id
+ untilId: this.notes[this.notes.length - 1].id,
+ includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
+ includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
}).then(notes => {
if (notes.length == limit + 1) {
notes.pop();
@@ -94,12 +104,29 @@ this.fetch();
this.moreFetching = false;
});
},
+
onNote(note) {
+ const isMyNote = note.userId == (this as any).os.i.id;
+ const isPureRenote = note.renoteId != null && note.text == null && note.mediaIds.length == 0 && note.poll == null;
+
+ if ((this as any).os.i.clientSettings.showMyRenotes === false) {
+ if (isMyNote && isPureRenote) {
+ return;
+ }
+ }
+
+ if ((this as any).os.i.clientSettings.showRenotedMyNotes === false) {
+ if (isPureRenote && (note.renote.userId == (this as any).os.i.id)) {
+ return;
+ }
+ }
+
this.notes.unshift(note);
const isTop = window.scrollY > 8;
if (isTop) this.notes.pop();
},
+
onChangeFollowing() {
this.fetch();
}