Compare commits

...

9 Commits

Author SHA1 Message Date
5994926440 11.0.0-alpha.2 2019-04-08 14:51:36 +09:00
30f2da4215 Fix bug 2019-04-08 14:41:23 +09:00
1a2229f886 Improve instance chart 2019-04-08 14:29:17 +09:00
1e166490d9 [Client] Better pagination
Fix #4628
Close #4629
2019-04-08 14:17:44 +09:00
1c57e6f80a i18n 2019-04-08 13:55:09 +09:00
a6537a8748 Fix: 投稿ウィジットでローカルのみの公開範囲で投稿できない (#4647) 2019-04-08 13:31:42 +09:00
842b75977b Update README.md [AUTOGEN] (#4652) 2019-04-08 04:21:37 +09:00
9b3dccf60c Update README.md [AUTOGEN] (#4649) 2019-04-08 04:20:53 +09:00
2d533e0cd8 Update CHANGELOG.md 2019-04-08 03:52:46 +09:00
36 changed files with 144 additions and 103 deletions

View File

@ -5,6 +5,15 @@ If you encounter any problems with updating, please try the following:
1. `npm run clean` or `npm run cleanall`
2. Retry update (Don't forget `npm i`)
11.0.0
----------
* データベースがMongoDBからPostgreSQLに変更されました
### APIの破壊的変更
* v10時点で deprecated だったパラメータなどを削除
* notes/hybrid-timeline が notes/social-timeline にリネーム
* ストリームの hybridTimeline チャンネルが socialTimeline にリネーム
10.99.0
----------
* manifest.json にインスタンス名を反映させるように

View File

@ -102,7 +102,7 @@ Please see the [Contribution Guide](./CONTRIBUTING.md).
<!-- PATREON_START -->
<table><tr>
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5888816/36da0f7c15954df0ab13f9abdf227f66/1?token-time=2145916800&token-hash=HGkZJ7s4bSaQVoOJ5q30mTWHTxDLiw1LuyaogKPLy24%3D" alt="Hiroshi Seki" width="100"></td>
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12190916/fb7fa7983c14425f890369535b1506a4/1?token-time=2145916800&token-hash=WeuDzzz24cRXJogyIkU-mxARqkdyms-rcZKbO-GpGjw%3D" alt="weep" width="100"></td>
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12190916/fb7fa7983c14425f890369535b1506a4/3?token-time=2145916800&token-hash=gr7DF8BuwflHvNoP24He4aa-5j8_KycrAQe3fHwQIUE%3D" alt="weep" width="100"></td>
<td><img src="https://c8.patreon.com/2/200/12059069" alt="naga_rus" width="100"></td>
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12913507/f7181eacafe8469a93033d85f5969c29/4?token-time=2145916800&token-hash=vZdDTTF-ahiKBjjgppS2ev4rkD8H7TTKkXXoxsucs6Y%3D" alt="Melilot" width="100"></td>
<td><img src="https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/5670915/ee175f0bfb6347ffa4ea101a8c097bff/1?token-time=2145916800&token-hash=ubqJzjhBQUo8Nw6h_8jMDlJ5ocIO46EflpiRkp2jIw4%3D" alt="osapon" width="100"></td>
@ -158,7 +158,7 @@ Please see the [Contribution Guide](./CONTRIBUTING.md).
<td><a href="https://www.patreon.com/user?u=12531784">Takashi Shibuya</a></td>
</tr></table>
**Last updated:** Sat, 06 Apr 2019 03:35:05 UTC
**Last updated:** Sun, 07 Apr 2019 19:21:08 UTC
<!-- PATREON_END -->
:four_leaf_clover: Copyright

View File

@ -73,6 +73,12 @@ common:
followers: "フォロワー"
favorites: "お気に入り"
permissions:
'read:account': "アカウントの情報を見る"
'write:account': "アカウントの情報を変更する"
'read:drive': "ドライブを見る"
'write:drive': "ドライブを操作する"
empty-timeline-info:
follow-users-to-make-your-timeline: "ユーザーをフォローすると投稿がタイムラインに表示されます。"
explore: "ユーザーを探索する"
@ -299,15 +305,6 @@ common:
auth/views/form.vue:
share-access: "<i>{name}</i>があなたのアカウントにアクセスすることを許可しますか?"
permission-ask: "このアプリは次の権限を要求しています:"
account-read: "アカウントの情報を見る。"
account-write: "アカウントの情報を操作する。"
note-write: "投稿する。"
like-write: "いいねしたりいいね解除する。"
following-write: "フォローしたりフォロー解除する。"
drive-read: "ドライブを見る。"
drive-write: "ドライブを操作する。"
notification-read: "通知を見る。"
notification-write: "通知を操作する。"
cancel: "キャンセル"
accept: "アクセスを許可"
@ -1818,12 +1815,3 @@ dev/views/new-app.vue:
authority: "権限"
authority-desc: "ここで要求した機能だけがAPIからアクセスできます。"
authority-warning: "アプリ作成後も変更できますが、新たな権限を付与する場合、その時点で関連付けられているユーザーキーはすべて無効になります。"
account-read: "アカウントの情報を見る。"
account-write: "アカウントの情報を操作する。"
note-write: "投稿する。"
reaction-write: "リアクションしたりリアクションをキャンセルする。"
following-write: "フォローしたりフォロー解除する。"
drive-read: "ドライブを見る。"
drive-write: "ドライブを操作する。"
notification-read: "通知を見る。"
notification-write: "通知を操作する。"

View File

@ -1,7 +1,7 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
"version": "11.0.0-alpha.1",
"version": "11.0.0-alpha.2",
"codename": "daybreak",
"repository": {
"type": "git",

View File

@ -14,15 +14,7 @@
<h2>{{ $t('permission-ask') }}</h2>
<ul>
<template v-for="p in app.permission">
<li v-if="p == 'read:account'">{{ $t('read:account') }}</li>
<li v-if="p == 'write:account'">{{ $t('write:account') }}</li>
<li v-if="p == 'write:notes'">{{ $t('write:notes') }}</li>
<li v-if="p == 'like-write'">{{ $t('like-write') }}</li>
<li v-if="p == 'write:following'">{{ $t('write:following') }}</li>
<li v-if="p == 'read:drive'">{{ $t('read:drive') }}</li>
<li v-if="p == 'write:drive'">{{ $t('write:drive') }}</li>
<li v-if="p == 'read:notifications'">{{ $t('read:notifications') }}</li>
<li v-if="p == 'write:notifications'">{{ $t('write:notifications') }}</li>
<li :key="p">{{ $t(`@.permissions.${p}`) }}</li>
</template>
</ul>
</section>

View File

@ -50,7 +50,7 @@ export default Vue.extend({
fetchingMoreUsers: false,
us: [],
inited: false,
cursor: null
more: false
};
},

View File

@ -28,12 +28,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -37,12 +37,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -41,12 +41,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -41,12 +41,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -27,12 +27,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -26,8 +26,8 @@
</template>
</component>
<footer v-if="cursor != null">
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<footer v-if="more">
<button @click="fetchMore()" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
</button>
@ -61,7 +61,7 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
inited: false,
cursor: null
more: false
};
},
@ -119,7 +119,7 @@ export default Vue.extend({
this.notes = x;
} else {
this.notes = x.notes;
this.cursor = x.cursor;
this.more = x.more;
}
this.inited = true;
this.fetching = false;
@ -129,12 +129,12 @@ export default Vue.extend({
});
},
more() {
if (this.cursor == null || this.moreFetching) return;
fetchMore() {
if (!this.more || this.moreFetching) return;
this.moreFetching = true;
this.makePromise(this.cursor).then(x => {
this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
this.notes = this.notes.concat(x.notes);
this.cursor = x.cursor;
this.more = x.more;
this.moreFetching = false;
}, e => {
this.moreFetching = false;
@ -157,6 +157,7 @@ export default Vue.extend({
// オーバーフローしたら古い投稿は捨てる
if (this.notes.length >= displayLimit) {
this.notes = this.notes.slice(0, displayLimit);
this.more = true;
}
} else {
this.queue.push(note);
@ -179,7 +180,7 @@ export default Vue.extend({
},
onBottom() {
this.more();
this.fetchMore();
}
}
});

View File

@ -39,7 +39,7 @@ export default Vue.extend({
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -85,12 +85,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
});

View File

@ -95,12 +95,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
});

View File

@ -30,7 +30,7 @@ export default Vue.extend({
} else {
return {
users: followings.map(following => following.follower),
cursor: null
more: false
};
}
}),

View File

@ -30,7 +30,7 @@ export default Vue.extend({
} else {
return {
users: followings.map(following => following.followee),
cursor: null
more: false
};
}
}),

View File

@ -176,10 +176,22 @@ export default define({
post() {
this.posting = true;
let visibility = 'public';
let localOnly = false;
const m = this.$store.state.settings.defaultNoteVisibility.match(/^local-(.+)/);
if (m) {
visibility = m[1];
localOnly = true;
} else {
visibility = this.$store.state.settings.defaultNoteVisibility;
}
this.$root.api('notes/create', {
text: this.text == '' ? undefined : this.text,
fileIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined,
visibility: this.$store.state.settings.defaultNoteVisibility
visibility,
localOnly,
}).then(data => {
this.clear();
}).catch(err => {

View File

@ -25,8 +25,8 @@
</template>
</component>
<footer v-if="cursor != null">
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<footer v-if="more">
<button @click="fetchMore()" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
</button>
@ -58,7 +58,7 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
inited: false,
cursor: null
more: false
};
},
@ -112,7 +112,7 @@ export default Vue.extend({
this.notes = x;
} else {
this.notes = x.notes;
this.cursor = x.cursor;
this.more = x.more;
}
this.inited = true;
this.fetching = false;
@ -122,12 +122,12 @@ export default Vue.extend({
});
},
more() {
if (this.cursor == null || this.moreFetching) return;
fetchMore() {
if (!this.more || this.moreFetching) return;
this.moreFetching = true;
this.makePromise(this.cursor).then(x => {
this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
this.notes = this.notes.concat(x.notes);
this.cursor = x.cursor;
this.more = x.more;
this.moreFetching = false;
}, e => {
this.moreFetching = false;
@ -157,6 +157,7 @@ export default Vue.extend({
// オーバーフローしたら古い投稿は捨てる
if (this.notes.length >= displayLimit) {
this.notes = this.notes.slice(0, displayLimit);
this.more = true;
}
} else {
this.queue.push(note);
@ -181,7 +182,7 @@ export default Vue.extend({
if (this.$store.state.settings.fetchOnScroll !== false) {
const current = window.scrollY + window.innerHeight;
if (current > document.body.offsetHeight - 8) this.more();
if (current > document.body.offsetHeight - 8) this.fetchMore();
}
}
}

View File

@ -30,12 +30,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -6,7 +6,7 @@
</template>
</sequential-entrance>
<div class="more" v-if="existMore">
<ui-button inline @click="more">{{ $t('@.load-more') }}</ui-button>
<ui-button inline @click="fetchMore()">{{ $t('@.load-more') }}</ui-button>
</div>
</div>
</template>
@ -48,7 +48,7 @@ export default Vue.extend({
Progress.done();
});
},
more() {
fetchMore() {
this.moreFetching = true;
this.$root.api('i/favorites', {
limit: 11,

View File

@ -35,7 +35,7 @@ export default Vue.extend({
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -35,7 +35,7 @@ export default Vue.extend({
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -113,12 +113,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
});

View File

@ -42,12 +42,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -21,8 +21,8 @@
</template>
</component>
<footer v-if="cursor != null">
<button @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<footer v-if="more">
<button @click="fetchMore()" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">{{ $t('@.load-more') }}</template>
<template v-if="moreFetching"><fa icon="spinner" pulse fixed-width/></template>
</button>
@ -53,7 +53,7 @@ export default Vue.extend({
fetching: true,
moreFetching: false,
inited: false,
cursor: null
more: false
};
},
@ -113,7 +113,7 @@ export default Vue.extend({
this.notes = x;
} else {
this.notes = x.notes;
this.cursor = x.cursor;
this.more = x.more;
}
this.inited = true;
this.fetching = false;
@ -123,12 +123,12 @@ export default Vue.extend({
});
},
more() {
if (this.cursor == null || this.moreFetching) return;
fetchMore() {
if (!this.more || this.moreFetching) return;
this.moreFetching = true;
this.makePromise(this.cursor).then(x => {
this.makePromise(this.notes[this.notes.length - 1].id).then(x => {
this.notes = this.notes.concat(x.notes);
this.cursor = x.cursor;
this.more = x.more;
this.moreFetching = false;
}, e => {
this.moreFetching = false;
@ -151,6 +151,7 @@ export default Vue.extend({
// オーバーフローしたら古い投稿は捨てる
if (this.notes.length >= displayLimit) {
this.notes = this.notes.slice(0, displayLimit);
this.more = true;
}
} else {
this.queue.push(note);
@ -180,7 +181,7 @@ export default Vue.extend({
if (this.$el.offsetHeight == 0) return;
const current = window.scrollY + window.innerHeight;
if (current > document.body.offsetHeight - 8) this.more();
if (current > document.body.offsetHeight - 8) this.fetchMore();
}
}
}

View File

@ -27,12 +27,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -27,12 +27,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -8,7 +8,7 @@
<mk-note-detail class="post" :note="favorite.note" :key="favorite.note.id"/>
</template>
</sequential-entrance>
<ui-button v-if="existMore" @click="more">{{ $t('@.load-more') }}</ui-button>
<ui-button v-if="existMore" @click="fetchMore()">{{ $t('@.load-more') }}</ui-button>
</main>
</mk-ui>
</template>
@ -53,7 +53,7 @@ export default Vue.extend({
Progress.done();
});
},
more() {
fetchMore() {
this.moreFetching = true;
this.$root.api('i/favorites', {
limit: 11,

View File

@ -114,12 +114,12 @@ export default Vue.extend({
notes.pop();
return {
notes: notes,
cursor: notes[notes.length - 1].id
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
});

View File

@ -21,19 +21,19 @@ export default Vue.extend({
return {
makePromise: cursor => this.$root.api('notes/search', {
limit: limit + 1,
offset: cursor ? cursor : undefined,
untilId: cursor ? cursor : undefined,
query: this.q
}).then(notes => {
if (notes.length == limit + 1) {
notes.pop();
return {
notes: notes,
cursor: cursor ? cursor + limit : limit
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -21,19 +21,19 @@ export default Vue.extend({
return {
makePromise: cursor => this.$root.api('notes/search-by-tag', {
limit: limit + 1,
offset: cursor ? cursor : undefined,
untilId: cursor ? cursor : undefined,
tag: this.$route.params.tag
}).then(notes => {
if (notes.length == limit + 1) {
notes.pop();
return {
notes: notes,
cursor: cursor ? cursor + limit : limit
more: true
};
} else {
return {
notes: notes,
cursor: null
more: false
};
}
})

View File

@ -4,6 +4,7 @@ import { SchemaType } from '../../../../misc/schema';
import { DriveFiles, Followings, Users, Notes } from '../../../../models';
import { DriveFile } from '../../../../models/entities/drive-file';
import { name, schema } from '../schemas/instance';
import { Note } from '../../../../models/entities/note';
type InstanceLog = SchemaType<typeof schema>;
@ -107,12 +108,23 @@ export default class InstanceChart extends Chart<InstanceLog> {
}
@autobind
public async updateNote(host: string, isAdditional: boolean) {
public async updateNote(host: string, note: Note, isAdditional: boolean) {
const diffs = {} as any;
if (note.replyId != null) {
diffs.reply = isAdditional ? 1 : -1;
} else if (note.renoteId != null) {
diffs.renote = isAdditional ? 1 : -1;
} else {
diffs.normal = isAdditional ? 1 : -1;
}
await this.inc({
notes: {
total: isAdditional ? 1 : -1,
inc: isAdditional ? 1 : 0,
dec: isAdditional ? 0 : 1,
diffs: diffs
}
}, host);
}

View File

@ -21,6 +21,7 @@ export const schema = {
},
}
},
notes: {
type: 'object' as 'object',
properties: {
@ -36,8 +37,29 @@ export const schema = {
type: 'number' as 'number',
description: '減少した投稿数'
},
diffs: {
type: 'object' as 'object',
properties: {
normal: {
type: 'number' as 'number',
description: '通常の投稿数の差分'
},
reply: {
type: 'number' as 'number',
description: 'リプライの投稿数の差分'
},
renote: {
type: 'number' as 'number',
description: 'Renoteの投稿数の差分'
},
}
},
}
},
users: {
type: 'object' as 'object',
properties: {
@ -55,6 +77,7 @@ export const schema = {
},
}
},
following: {
type: 'object' as 'object',
properties: {
@ -72,6 +95,7 @@ export const schema = {
},
}
},
followers: {
type: 'object' as 'object',
properties: {
@ -89,6 +113,7 @@ export const schema = {
},
}
},
drive: {
type: 'object' as 'object',
properties: {

View File

@ -207,7 +207,7 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
if (Users.isRemoteUser(user)) {
registerOrFetchInstanceDoc(user.host).then(i => {
Instances.increment({ id: i.id }, 'notesCount', 1);
instanceChart.updateNote(i.host, true);
instanceChart.updateNote(i.host, note, true);
});
}

View File

@ -56,7 +56,7 @@ export default async function(user: User, note: Note, quiet = false) {
if (Users.isRemoteUser(user)) {
registerOrFetchInstanceDoc(user.host).then(i => {
Instances.decrement({ id: i.id }, 'notesCount', 1);
instanceChart.updateNote(i.host, false);
instanceChart.updateNote(i.host, note, false);
});
}
}