summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorAkihiko Odaki <nekomanma@pixiv.co.jp>2018-03-26 00:19:07 +0900
committerAkihiko Odaki <nekomanma@pixiv.co.jp>2018-03-26 14:07:16 +0900
commit19b9cb105d49e2a00ae19e3dc1f2d36dc394f148 (patch)
tree5faa9ad213bbf2efdcb4d06cf4fc941a501ab7f8 /src/web
parentAllow to use domain whose prefix is not misskey (diff)
downloadsharkey-19b9cb105d49e2a00ae19e3dc1f2d36dc394f148.tar.gz
sharkey-19b9cb105d49e2a00ae19e3dc1f2d36dc394f148.tar.bz2
sharkey-19b9cb105d49e2a00ae19e3dc1f2d36dc394f148.zip
Introduce account document to user document
An account document is attached to a user document if an account of the user is on the server. It may be missing if the user is on a remote server.
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/define-widget.ts4
-rw-r--r--src/web/app/common/mios.ts10
-rw-r--r--src/web/app/common/scripts/streaming/drive.ts2
-rw-r--r--src/web/app/common/scripts/streaming/home.ts4
-rw-r--r--src/web/app/common/scripts/streaming/messaging-index.ts2
-rw-r--r--src/web/app/common/scripts/streaming/messaging.ts4
-rw-r--r--src/web/app/common/scripts/streaming/othello-game.ts2
-rw-r--r--src/web/app/common/scripts/streaming/othello.ts2
-rw-r--r--src/web/app/common/views/components/signin.vue4
-rw-r--r--src/web/app/common/views/components/twitter-setting.vue12
-rw-r--r--src/web/app/common/views/components/uploader.vue2
-rw-r--r--src/web/app/desktop/api/update-avatar.ts2
-rw-r--r--src/web/app/desktop/api/update-banner.ts2
-rw-r--r--src/web/app/desktop/views/components/home.vue20
-rw-r--r--src/web/app/desktop/views/components/post-detail.vue2
-rw-r--r--src/web/app/desktop/views/components/posts.post.vue4
-rw-r--r--src/web/app/desktop/views/components/settings.2fa.vue8
-rw-r--r--src/web/app/desktop/views/components/settings.api.vue2
-rw-r--r--src/web/app/desktop/views/components/settings.profile.vue8
-rw-r--r--src/web/app/desktop/views/components/settings.vue12
-rw-r--r--src/web/app/desktop/views/components/timeline.vue2
-rw-r--r--src/web/app/desktop/views/components/ui.header.vue4
-rw-r--r--src/web/app/desktop/views/components/widget-container.vue4
-rw-r--r--src/web/app/desktop/views/components/window.vue4
-rw-r--r--src/web/app/desktop/views/pages/user/user.header.vue2
-rw-r--r--src/web/app/desktop/views/pages/user/user.home.vue2
-rw-r--r--src/web/app/desktop/views/pages/user/user.profile.vue10
-rw-r--r--src/web/app/mobile/views/components/post-detail.vue2
-rw-r--r--src/web/app/mobile/views/components/post-form.vue2
-rw-r--r--src/web/app/mobile/views/components/post.vue4
-rw-r--r--src/web/app/mobile/views/components/ui.header.vue4
-rw-r--r--src/web/app/mobile/views/pages/home.vue20
-rw-r--r--src/web/app/mobile/views/pages/profile-setting.vue4
-rw-r--r--src/web/app/mobile/views/pages/user.vue10
-rw-r--r--src/web/app/mobile/views/pages/user/home.vue2
-rw-r--r--src/web/app/mobile/views/pages/welcome.vue4
-rw-r--r--src/web/docs/api/entities/user.yaml94
37 files changed, 145 insertions, 137 deletions
diff --git a/src/web/app/common/define-widget.ts b/src/web/app/common/define-widget.ts
index efce7e813c..d8d29873a4 100644
--- a/src/web/app/common/define-widget.ts
+++ b/src/web/app/common/define-widget.ts
@@ -56,14 +56,14 @@ export default function<T extends object>(data: {
id: this.id,
data: newProps
}).then(() => {
- (this as any).os.i.client_settings.mobile_home.find(w => w.id == this.id).data = newProps;
+ (this as any).os.i.account.client_settings.mobile_home.find(w => w.id == this.id).data = newProps;
});
} else {
(this as any).api('i/update_home', {
id: this.id,
data: newProps
}).then(() => {
- (this as any).os.i.client_settings.home.find(w => w.id == this.id).data = newProps;
+ (this as any).os.i.account.client_settings.home.find(w => w.id == this.id).data = newProps;
});
}
}, {
diff --git a/src/web/app/common/mios.ts b/src/web/app/common/mios.ts
index 986630da20..1c950c3e79 100644
--- a/src/web/app/common/mios.ts
+++ b/src/web/app/common/mios.ts
@@ -270,7 +270,7 @@ export default class MiOS extends EventEmitter {
// Parse response
res.json().then(i => {
me = i;
- me.token = token;
+ me.account.token = token;
done();
});
})
@@ -294,12 +294,12 @@ export default class MiOS extends EventEmitter {
const fetched = me => {
if (me) {
// デフォルトの設定をマージ
- me.client_settings = Object.assign({
+ me.account.client_settings = Object.assign({
fetchOnScroll: true,
showMaps: true,
showPostFormOnTopOfTl: false,
gradientWindowHeader: false
- }, me.client_settings);
+ }, me.account.client_settings);
// ローカルストレージにキャッシュ
localStorage.setItem('me', JSON.stringify(me));
@@ -329,7 +329,7 @@ export default class MiOS extends EventEmitter {
fetched(cachedMe);
// 後から新鮮なデータをフェッチ
- fetchme(cachedMe.token, freshData => {
+ fetchme(cachedMe.account.token, freshData => {
merge(cachedMe, freshData);
});
} else {
@@ -437,7 +437,7 @@ export default class MiOS extends EventEmitter {
}
// Append a credential
- if (this.isSignedIn) (data as any).i = this.i.token;
+ if (this.isSignedIn) (data as any).i = this.i.account.token;
// TODO
//const viaStream = localStorage.getItem('enableExperimental') == 'true';
diff --git a/src/web/app/common/scripts/streaming/drive.ts b/src/web/app/common/scripts/streaming/drive.ts
index 7ff85b5946..f11573685e 100644
--- a/src/web/app/common/scripts/streaming/drive.ts
+++ b/src/web/app/common/scripts/streaming/drive.ts
@@ -8,7 +8,7 @@ import MiOS from '../../mios';
export class DriveStream extends Stream {
constructor(os: MiOS, me) {
super(os, 'drive', {
- i: me.token
+ i: me.account.token
});
}
}
diff --git a/src/web/app/common/scripts/streaming/home.ts b/src/web/app/common/scripts/streaming/home.ts
index 533c232449..ffcf6e5360 100644
--- a/src/web/app/common/scripts/streaming/home.ts
+++ b/src/web/app/common/scripts/streaming/home.ts
@@ -10,13 +10,13 @@ import MiOS from '../../mios';
export class HomeStream extends Stream {
constructor(os: MiOS, me) {
super(os, '', {
- i: me.token
+ i: me.account.token
});
// 最終利用日時を更新するため定期的にaliveメッセージを送信
setInterval(() => {
this.send({ type: 'alive' });
- me.last_used_at = new Date();
+ me.account.last_used_at = new Date();
}, 1000 * 60);
// 自分の情報が更新されたとき
diff --git a/src/web/app/common/scripts/streaming/messaging-index.ts b/src/web/app/common/scripts/streaming/messaging-index.ts
index 84e2174ec4..24f0ce0c9f 100644
--- a/src/web/app/common/scripts/streaming/messaging-index.ts
+++ b/src/web/app/common/scripts/streaming/messaging-index.ts
@@ -8,7 +8,7 @@ import MiOS from '../../mios';
export class MessagingIndexStream extends Stream {
constructor(os: MiOS, me) {
super(os, 'messaging-index', {
- i: me.token
+ i: me.account.token
});
}
}
diff --git a/src/web/app/common/scripts/streaming/messaging.ts b/src/web/app/common/scripts/streaming/messaging.ts
index c1b5875cfb..4c593deb31 100644
--- a/src/web/app/common/scripts/streaming/messaging.ts
+++ b/src/web/app/common/scripts/streaming/messaging.ts
@@ -7,13 +7,13 @@ import MiOS from '../../mios';
export class MessagingStream extends Stream {
constructor(os: MiOS, me, otherparty) {
super(os, 'messaging', {
- i: me.token,
+ i: me.account.token,
otherparty
});
(this as any).on('_connected_', () => {
this.send({
- i: me.token
+ i: me.account.token
});
});
}
diff --git a/src/web/app/common/scripts/streaming/othello-game.ts b/src/web/app/common/scripts/streaming/othello-game.ts
index b85af8f72b..f34ef35147 100644
--- a/src/web/app/common/scripts/streaming/othello-game.ts
+++ b/src/web/app/common/scripts/streaming/othello-game.ts
@@ -4,7 +4,7 @@ import MiOS from '../../mios';
export class OthelloGameStream extends Stream {
constructor(os: MiOS, me, game) {
super(os, 'othello-game', {
- i: me ? me.token : null,
+ i: me ? me.account.token : null,
game: game.id
});
}
diff --git a/src/web/app/common/scripts/streaming/othello.ts b/src/web/app/common/scripts/streaming/othello.ts
index f5d47431cd..8c6f4b9c3c 100644
--- a/src/web/app/common/scripts/streaming/othello.ts
+++ b/src/web/app/common/scripts/streaming/othello.ts
@@ -5,7 +5,7 @@ import MiOS from '../../mios';
export class OthelloStream extends Stream {
constructor(os: MiOS, me) {
super(os, 'othello', {
- i: me.token
+ i: me.account.token
});
}
}
diff --git a/src/web/app/common/views/components/signin.vue b/src/web/app/common/views/components/signin.vue
index 1738d0df7d..d8b1357764 100644
--- a/src/web/app/common/views/components/signin.vue
+++ b/src/web/app/common/views/components/signin.vue
@@ -6,7 +6,7 @@
<label class="password">
<input v-model="password" type="password" placeholder="%i18n:common.tags.mk-signin.password%" required/>%fa:lock%
</label>
- <label class="token" v-if="user && user.two_factor_enabled">
+ <label class="token" v-if="user && user.account.two_factor_enabled">
<input v-model="token" type="number" placeholder="%i18n:common.tags.mk-signin.token%" required/>%fa:lock%
</label>
<button type="submit" :disabled="signing">{{ signing ? '%i18n:common.tags.mk-signin.signing-in%' : '%i18n:common.tags.mk-signin.signin%' }}</button>
@@ -40,7 +40,7 @@ export default Vue.extend({
(this as any).api('signin', {
username: this.username,
password: this.password,
- token: this.user && this.user.two_factor_enabled ? this.token : undefined
+ token: this.user && this.user.account.two_factor_enabled ? this.token : undefined
}).then(() => {
location.reload();
}).catch(() => {
diff --git a/src/web/app/common/views/components/twitter-setting.vue b/src/web/app/common/views/components/twitter-setting.vue
index a0de27085f..15968d20a6 100644
--- a/src/web/app/common/views/components/twitter-setting.vue
+++ b/src/web/app/common/views/components/twitter-setting.vue
@@ -1,13 +1,13 @@
<template>
<div class="mk-twitter-setting">
<p>%i18n:common.tags.mk-twitter-setting.description%<a :href="`${docsUrl}/link-to-twitter`" target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p>
- <p class="account" v-if="os.i.twitter" :title="`Twitter ID: ${os.i.twitter.user_id}`">%i18n:common.tags.mk-twitter-setting.connected-to%: <a :href="`https://twitter.com/${os.i.twitter.screen_name}`" target="_blank">@{{ os.i.twitter.screen_name }}</a></p>
+ <p class="account" v-if="os.i.account.twitter" :title="`Twitter ID: ${os.i.account.twitter.user_id}`">%i18n:common.tags.mk-twitter-setting.connected-to%: <a :href="`https://twitter.com/${os.i.account.twitter.screen_name}`" target="_blank">@{{ os.i.account.twitter.screen_name }}</a></p>
<p>
- <a :href="`${apiUrl}/connect/twitter`" target="_blank" @click.prevent="connect">{{ os.i.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }}</a>
- <span v-if="os.i.twitter"> or </span>
- <a :href="`${apiUrl}/disconnect/twitter`" target="_blank" v-if="os.i.twitter" @click.prevent="disconnect">%i18n:common.tags.mk-twitter-setting.disconnect%</a>
+ <a :href="`${apiUrl}/connect/twitter`" target="_blank" @click.prevent="connect">{{ os.i.account.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }}</a>
+ <span v-if="os.i.account.twitter"> or </span>
+ <a :href="`${apiUrl}/disconnect/twitter`" target="_blank" v-if="os.i.account.twitter" @click.prevent="disconnect">%i18n:common.tags.mk-twitter-setting.disconnect%</a>
</p>
- <p class="id" v-if="os.i.twitter">Twitter ID: {{ os.i.twitter.user_id }}</p>
+ <p class="id" v-if="os.i.account.twitter">Twitter ID: {{ os.i.account.twitter.user_id }}</p>
</div>
</template>
@@ -25,7 +25,7 @@ export default Vue.extend({
},
mounted() {
this.$watch('os.i', () => {
- if ((this as any).os.i.twitter) {
+ if ((this as any).os.i.account.twitter) {
if (this.form) this.form.close();
}
}, {
diff --git a/src/web/app/common/views/components/uploader.vue b/src/web/app/common/views/components/uploader.vue
index 6465ad35e9..73006b16e9 100644
--- a/src/web/app/common/views/components/uploader.vue
+++ b/src/web/app/common/views/components/uploader.vue
@@ -50,7 +50,7 @@ export default Vue.extend({
reader.readAsDataURL(file);
const data = new FormData();
- data.append('i', (this as any).os.i.token);
+ data.append('i', (this as any).os.i.account.token);
data.append('file', file);
if (folder) data.append('folder_id', folder);
diff --git a/src/web/app/desktop/api/update-avatar.ts b/src/web/app/desktop/api/update-avatar.ts
index c3e0ce14c7..8f748d853c 100644
--- a/src/web/app/desktop/api/update-avatar.ts
+++ b/src/web/app/desktop/api/update-avatar.ts
@@ -16,7 +16,7 @@ export default (os: OS) => (cb, file = null) => {
w.$once('cropped', blob => {
const data = new FormData();
- data.append('i', os.i.token);
+ data.append('i', os.i.account.token);
data.append('file', blob, file.name + '.cropped.png');
os.api('drive/folders/find', {
diff --git a/src/web/app/desktop/api/update-banner.ts b/src/web/app/desktop/api/update-banner.ts
index 9e94dc423b..9ed48b2670 100644
--- a/src/web/app/desktop/api/update-banner.ts
+++ b/src/web/app/desktop/api/update-banner.ts
@@ -16,7 +16,7 @@ export default (os: OS) => (cb, file = null) => {
w.$once('cropped', blob => {
const data = new FormData();
- data.append('i', os.i.token);
+ data.append('i', os.i.account.token);
data.append('file', blob, file.name + '.cropped.png');
os.api('drive/folders/find', {
diff --git a/src/web/app/desktop/views/components/home.vue b/src/web/app/desktop/views/components/home.vue
index 562b22d11d..a4ce1ef94b 100644
--- a/src/web/app/desktop/views/components/home.vue
+++ b/src/web/app/desktop/views/components/home.vue
@@ -53,7 +53,7 @@
<div class="main">
<a @click="hint">カスタマイズのヒント</a>
<div>
- <mk-post-form v-if="os.i.client_settings.showPostFormOnTopOfTl"/>
+ <mk-post-form v-if="os.i.account.client_settings.showPostFormOnTopOfTl"/>
<mk-timeline ref="tl" @loaded="onTlLoaded"/>
</div>
</div>
@@ -63,7 +63,7 @@
<component v-for="widget in widgets[place]" :is="`mkw-${widget.name}`" :key="widget.id" :ref="widget.id" :widget="widget" @chosen="warp"/>
</div>
<div class="main">
- <mk-post-form v-if="os.i.client_settings.showPostFormOnTopOfTl"/>
+ <mk-post-form v-if="os.i.account.client_settings.showPostFormOnTopOfTl"/>
<mk-timeline ref="tl" @loaded="onTlLoaded" v-if="mode == 'timeline'"/>
<mk-mentions @loaded="onTlLoaded" v-if="mode == 'mentions'"/>
</div>
@@ -104,16 +104,16 @@ export default Vue.extend({
home: {
get(): any[] {
//#region 互換性のため
- (this as any).os.i.client_settings.home.forEach(w => {
+ (this as any).os.i.account.client_settings.home.forEach(w => {
if (w.name == 'rss-reader') w.name = 'rss';
if (w.name == 'user-recommendation') w.name = 'users';
if (w.name == 'recommended-polls') w.name = 'polls';
});
//#endregion
- return (this as any).os.i.client_settings.home;
+ return (this as any).os.i.account.client_settings.home;
},
set(value) {
- (this as any).os.i.client_settings.home = value;
+ (this as any).os.i.account.client_settings.home = value;
}
},
left(): any[] {
@@ -126,7 +126,7 @@ export default Vue.extend({
created() {
this.widgets.left = this.left;
this.widgets.right = this.right;
- this.$watch('os.i.client_settings', i => {
+ this.$watch('os.i.account.client_settings', i => {
this.widgets.left = this.left;
this.widgets.right = this.right;
}, {
@@ -161,17 +161,17 @@ export default Vue.extend({
},
onHomeUpdated(data) {
if (data.home) {
- (this as any).os.i.client_settings.home = data.home;
+ (this as any).os.i.account.client_settings.home = data.home;
this.widgets.left = data.home.filter(w => w.place == 'left');
this.widgets.right = data.home.filter(w => w.place == 'right');
} else {
- const w = (this as any).os.i.client_settings.home.find(w => w.id == data.id);
+ const w = (this as any).os.i.account.client_settings.home.find(w => w.id == data.id);
if (w != null) {
w.data = data.data;
this.$refs[w.id][0].preventSave = true;
this.$refs[w.id][0].props = w.data;
- this.widgets.left = (this as any).os.i.client_settings.home.filter(w => w.place == 'left');
- this.widgets.right = (this as any).os.i.client_settings.home.filter(w => w.place == 'right');
+ this.widgets.left = (this as any).os.i.account.client_settings.home.filter(w => w.place == 'left');
+ this.widgets.right = (this as any).os.i.account.client_settings.home.filter(w => w.place == 'right');
}
}
},
diff --git a/src/web/app/desktop/views/components/post-detail.vue b/src/web/app/desktop/views/components/post-detail.vue
index e454c28702..98777e224d 100644
--- a/src/web/app/desktop/views/components/post-detail.vue
+++ b/src/web/app/desktop/views/components/post-detail.vue
@@ -148,7 +148,7 @@ export default Vue.extend({
// Draw map
if (this.p.geo) {
- const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.client_settings.showMaps : true;
+ const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.client_settings.showMaps : true;
if (shouldShowMap) {
(this as any).os.getGoogleMaps().then(maps => {
const uluru = new maps.LatLng(this.p.geo.latitude, this.p.geo.longitude);
diff --git a/src/web/app/desktop/views/components/posts.post.vue b/src/web/app/desktop/views/components/posts.post.vue
index ddc338e372..073b89957a 100644
--- a/src/web/app/desktop/views/components/posts.post.vue
+++ b/src/web/app/desktop/views/components/posts.post.vue
@@ -22,7 +22,7 @@
<div class="main">
<header>
<router-link class="name" :to="`/${p.user.username}`" v-user-preview="p.user.id">{{ p.user.name }}</router-link>
- <span class="is-bot" v-if="p.user.is_bot">bot</span>
+ <span class="is-bot" v-if="p.user.account.is_bot">bot</span>
<span class="username">@{{ p.user.username }}</span>
<div class="info">
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
@@ -162,7 +162,7 @@ export default Vue.extend({
// Draw map
if (this.p.geo) {
- const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.client_settings.showMaps : true;
+ const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.client_settings.showMaps : true;
if (shouldShowMap) {
(this as any).os.getGoogleMaps().then(maps => {
const uluru = new maps.LatLng(this.p.geo.latitude, this.p.geo.longitude);
diff --git a/src/web/app/desktop/views/components/settings.2fa.vue b/src/web/app/desktop/views/components/settings.2fa.vue
index 87783e799d..85f2d6ba5e 100644
--- a/src/web/app/desktop/views/components/settings.2fa.vue
+++ b/src/web/app/desktop/views/components/settings.2fa.vue
@@ -2,8 +2,8 @@
<div class="2fa">
<p>%i18n:desktop.tags.mk-2fa-setting.intro%<a href="%i18n:desktop.tags.mk-2fa-setting.url%" target="_blank">%i18n:desktop.tags.mk-2fa-setting.detail%</a></p>
<div class="ui info warn"><p>%fa:exclamation-triangle%%i18n:desktop.tags.mk-2fa-setting.caution%</p></div>
- <p v-if="!data && !os.i.two_factor_enabled"><button @click="register" class="ui primary">%i18n:desktop.tags.mk-2fa-setting.register%</button></p>
- <template v-if="os.i.two_factor_enabled">
+ <p v-if="!data && !os.i.account.two_factor_enabled"><button @click="register" class="ui primary">%i18n:desktop.tags.mk-2fa-setting.register%</button></p>
+ <template v-if="os.i.account.two_factor_enabled">
<p>%i18n:desktop.tags.mk-2fa-setting.already-registered%</p>
<button @click="unregister" class="ui">%i18n:desktop.tags.mk-2fa-setting.unregister%</button>
</template>
@@ -54,7 +54,7 @@ export default Vue.extend({
password: password
}).then(() => {
(this as any).apis.notify('%i18n:desktop.tags.mk-2fa-setting.unregistered%');
- (this as any).os.i.two_factor_enabled = false;
+ (this as any).os.i.account.two_factor_enabled = false;
});
});
},
@@ -64,7 +64,7 @@ export default Vue.extend({
token: this.token
}).then(() => {
(this as any).apis.notify('%i18n:desktop.tags.mk-2fa-setting.success%');
- (this as any).os.i.two_factor_enabled = true;
+ (this as any).os.i.account.two_factor_enabled = true;
}).catch(() => {
(this as any).apis.notify('%i18n:desktop.tags.mk-2fa-setting.failed%');
});
diff --git a/src/web/app/desktop/views/components/settings.api.vue b/src/web/app/desktop/views/components/settings.api.vue
index 5831f82075..0d5921ab7f 100644
--- a/src/web/app/desktop/views/components/settings.api.vue
+++ b/src/web/app/desktop/views/components/settings.api.vue
@@ -1,6 +1,6 @@
<template>
<div class="root api">
- <p>Token: <code>{{ os.i.token }}</code></p>
+ <p>Token: <code>{{ os.i.account.token }}</code></p>
<p>%i18n:desktop.tags.mk-api-info.intro%</p>
<div class="ui info warn"><p>%fa:exclamation-triangle%%i18n:desktop.tags.mk-api-info.caution%</p></div>
<p>%i18n:desktop.tags.mk-api-info.regeneration-of-token%</p>
diff --git a/src/web/app/desktop/views/components/settings.profile.vue b/src/web/app/desktop/views/components/settings.profile.vue
index 23a1663768..67a211c792 100644
--- a/src/web/app/desktop/views/components/settings.profile.vue
+++ b/src/web/app/desktop/views/components/settings.profile.vue
@@ -24,7 +24,7 @@
<button class="ui primary" @click="save">%i18n:desktop.tags.mk-profile-setting.save%</button>
<section>
<h2>その他</h2>
- <mk-switch v-model="os.i.is_bot" @change="onChangeIsBot" text="このアカウントはbotです"/>
+ <mk-switch v-model="os.i.account.is_bot" @change="onChangeIsBot" text="このアカウントはbotです"/>
</section>
</div>
</template>
@@ -43,9 +43,9 @@ export default Vue.extend({
},
created() {
this.name = (this as any).os.i.name;
- this.location = (this as any).os.i.profile.location;
+ this.location = (this as any).os.i.account.profile.location;
this.description = (this as any).os.i.description;
- this.birthday = (this as any).os.i.profile.birthday;
+ this.birthday = (this as any).os.i.account.profile.birthday;
},
methods: {
updateAvatar() {
@@ -63,7 +63,7 @@ export default Vue.extend({
},
onChangeIsBot() {
(this as any).api('i/update', {
- is_bot: (this as any).os.i.is_bot
+ is_bot: (this as any).os.i.account.is_bot
});
}
}
diff --git a/src/web/app/desktop/views/components/settings.vue b/src/web/app/desktop/views/components/settings.vue
index 950e60fb3b..3e6a477ced 100644
--- a/src/web/app/desktop/views/components/settings.vue
+++ b/src/web/app/desktop/views/components/settings.vue
@@ -20,7 +20,7 @@
<section class="web" v-show="page == 'web'">
<h1>動作</h1>
- <mk-switch v-model="os.i.client_settings.fetchOnScroll" @change="onChangeFetchOnScroll" text="スクロールで自動読み込み">
+ <mk-switch v-model="os.i.account.client_settings.fetchOnScroll" @change="onChangeFetchOnScroll" text="スクロールで自動読み込み">
<span>ページを下までスクロールしたときに自動で追加のコンテンツを読み込みます。</span>
</mk-switch>
<mk-switch v-model="autoPopout" text="ウィンドウの自動ポップアウト">
@@ -33,11 +33,11 @@
<div class="div">
<button class="ui button" @click="customizeHome">ホームをカスタマイズ</button>
</div>
- <mk-switch v-model="os.i.client_settings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="タイムライン上部に投稿フォームを表示する"/>
- <mk-switch v-model="os.i.client_settings.showMaps" @change="onChangeShowMaps" text="マップの自動展開">
+ <mk-switch v-model="os.i.account.client_settings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="タイムライン上部に投稿フォームを表示する"/>
+ <mk-switch v-model="os.i.account.client_settings.showMaps" @change="onChangeShowMaps" text="マップの自動展開">
<span>位置情報が添付された投稿のマップを自動的に展開します。</span>
</mk-switch>
- <mk-switch v-model="os.i.client_settings.gradientWindowHeader" @change="onChangeGradientWindowHeader" text="ウィンドウのタイトルバーにグラデーションを使用"/>
+ <mk-switch v-model="os.i.account.client_settings.gradientWindowHeader" @change="onChangeGradientWindowHeader" text="ウィンドウのタイトルバーにグラデーションを使用"/>
</section>
<section class="web" v-show="page == 'web'">
@@ -57,7 +57,7 @@
<section class="web" v-show="page == 'web'">
<h1>モバイル</h1>
- <mk-switch v-model="os.i.client_settings.disableViaMobile" @change="onChangeDisableViaMobile" text="「モバイルからの投稿」フラグを付けない"/>
+ <mk-switch v-model="os.i.account.client_settings.disableViaMobile" @change="onChangeDisableViaMobile" text="「モバイルからの投稿」フラグを付けない"/>
</section>
<section class="web" v-show="page == 'web'">
@@ -86,7 +86,7 @@
<section class="notification" v-show="page == 'notification'">
<h1>通知</h1>
- <mk-switch v-model="os.i.settings.auto_watch" @change="onChangeAutoWatch" text="投稿の自動ウォッチ">
+ <mk-switch v-model="os.i.account.settings.auto_watch" @change="onChangeAutoWatch" text="投稿の自動ウォッチ">
<span>リアクションしたり返信したりした投稿に関する通知を自動的に受け取るようにします。</span>
</mk-switch>
</section>
diff --git a/src/web/app/desktop/views/components/timeline.vue b/src/web/app/desktop/views/components/timeline.vue
index b6b28c3529..47a9688b6d 100644
--- a/src/web/app/desktop/views/components/timeline.vue
+++ b/src/web/app/desktop/views/components/timeline.vue
@@ -107,7 +107,7 @@ export default Vue.extend({
this.fetch();
},
onScroll() {
- if ((this as any).os.i.client_settings.fetchOnScroll !== false) {
+ if ((this as any).os.i.account.client_settings.fetchOnScroll !== false) {
const current = window.scrollY + window.innerHeight;
if (current > document.body.offsetHeight - 8) this.more();
}
diff --git a/src/web/app/desktop/views/components/ui.header.vue b/src/web/app/desktop/views/components/ui.header.vue
index 5425ec876f..8af0e2fbed 100644
--- a/src/web/app/desktop/views/components/ui.header.vue
+++ b/src/web/app/desktop/views/components/ui.header.vue
@@ -44,9 +44,9 @@ export default Vue.extend({
},
mounted() {
if ((this as any).os.isSignedIn) {
- const ago = (new Date().getTime() - new Date((this as any).os.i.last_used_at).getTime()) / 1000
+ const ago = (new Date().getTime() - new Date((this as any).os.i.account.last_used_at).getTime()) / 1000
const isHisasiburi = ago >= 3600;
- (this as any).os.i.last_used_at = new Date();
+ (this as any).os.i.account.last_used_at = new Date();
if (isHisasiburi) {
(this.$refs.welcomeback as any).style.display = 'block';
(this.$refs.main as any).style.overflow = 'hidden';
diff --git a/src/web/app/desktop/views/components/widget-container.vue b/src/web/app/desktop/views/components/widget-container.vue
index c08e58e218..dd42be63bb 100644
--- a/src/web/app/desktop/views/components/widget-container.vue
+++ b/src/web/app/desktop/views/components/widget-container.vue
@@ -24,8 +24,8 @@ export default Vue.extend({
computed: {
withGradient(): boolean {
return (this as any).os.isSignedIn
- ? (this as any).os.i.client_settings.gradientWindowHeader != null
- ? (this as any).os.i.client_settings.gradientWindowHeader
+ ? (this as any).os.i.account.client_settings.gradientWindowHeader != null
+ ? (this as any).os.i.account.client_settings.gradientWindowHeader
: false
: false;
}
diff --git a/src/web/app/desktop/views/components/window.vue b/src/web/app/desktop/views/components/window.vue
index 0f89aa3e4b..75f725d4b0 100644
--- a/src/web/app/desktop/views/components/window.vue
+++ b/src/web/app/desktop/views/components/window.vue
@@ -92,8 +92,8 @@ export default Vue.extend({
},
withGradient(): boolean {
return (this as any).os.isSignedIn
- ? (this as any).os.i.client_settings.gradientWindowHeader != null
- ? (this as any).os.i.client_settings.gradientWindowHeader
+ ? (this as any).os.i.account.client_settings.gradientWindowHeader != null
+ ? (this as any).os.i.account.client_settings.gradientWindowHeader
: false
: false;
}
diff --git a/src/web/app/desktop/views/pages/user/user.header.vue b/src/web/app/desktop/views/pages/user/user.header.vue
index b2119e52e2..63542055d9 100644
--- a/src/web/app/desktop/views/pages/user/user.header.vue
+++ b/src/web/app/desktop/views/pages/user/user.header.vue
@@ -9,7 +9,7 @@
<div class="title">
<p class="name">{{ user.name }}</p>
<p class="username">@{{ user.username }}</p>
- <p class="location" v-if="user.profile.location">%fa:map-marker%{{ user.profile.location }}</p>
+ <p class="location" v-if="user.account.profile.location">%fa:map-marker%{{ user.account.profile.location }}</p>
</div>
<footer>
<router-link :to="`/${user.username}`" :data-active="$parent.page == 'home'">%fa:home%概要</router-link>
diff --git a/src/web/app/desktop/views/pages/user/user.home.vue b/src/web/app/desktop/views/pages/user/user.home.vue
index 17aa832015..592d5cca62 100644
--- a/src/web/app/desktop/views/pages/user/user.home.vue
+++ b/src/web/app/desktop/views/pages/user/user.home.vue
@@ -5,7 +5,7 @@
<x-profile :user="user"/>
<x-photos :user="user"/>
<x-followers-you-know v-if="os.isSignedIn && os.i.id != user.id" :user="user"/>
- <p>%i18n:desktop.tags.mk-user.last-used-at%: <b><mk-time :time="user.last_used_at"/></b></p>
+ <p>%i18n:desktop.tags.mk-user.last-used-at%: <b><mk-time :time="user.account.last_used_at"/></b></p>
</div>
</div>
<main>
diff --git a/src/web/app/desktop/views/pages/user/user.profile.vue b/src/web/app/desktop/views/pages/user/user.profile.vue
index ceca829ace..1e7cb455b0 100644
--- a/src/web/app/desktop/views/pages/user/user.profile.vue
+++ b/src/web/app/desktop/views/pages/user/user.profile.vue
@@ -7,11 +7,11 @@
<p v-if="!user.is_muted"><a @click="mute">%i18n:desktop.tags.mk-user.mute%</a></p>
</div>
<div class="description" v-if="user.description">{{ user.description }}</div>
- <div class="birthday" v-if="user.profile.birthday">
- <p>%fa:birthday-cake%{{ user.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳)</p>
+ <div class="birthday" v-if="user.account.profile.birthday">
+ <p>%fa:birthday-cake%{{ user.account.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳)</p>
</div>
- <div class="twitter" v-if="user.twitter">
- <p>%fa:B twitter%<a :href="`https://twitter.com/${user.twitter.screen_name}`" target="_blank">@{{ user.twitter.screen_name }}</a></p>
+ <div class="twitter" v-if="user.account.twitter">
+ <p>%fa:B twitter%<a :href="`https://twitter.com/${user.account.twitter.screen_name}`" target="_blank">@{{ user.account.twitter.screen_name }}</a></p>
</div>
<div class="status">
<p class="posts-count">%fa:angle-right%<a>{{ user.posts_count }}</a><b>投稿</b></p>
@@ -31,7 +31,7 @@ export default Vue.extend({
props: ['user'],
computed: {
age(): number {
- return age(this.user.profile.birthday);
+ return age(this.user.account.profile.birthday);
}
},
methods: {
diff --git a/src/web/app/mobile/views/components/post-detail.vue b/src/web/app/mobile/views/components/post-detail.vue
index d51bfbc0e6..4b0b59eff4 100644
--- a/src/web/app/mobile/views/components/post-detail.vue
+++ b/src/web/app/mobile/views/components/post-detail.vue
@@ -144,7 +144,7 @@ export default Vue.extend({
// Draw map
if (this.p.geo) {
- const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.client_settings.showMaps : true;
+ const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.client_settings.showMaps : true;
if (shouldShowMap) {
(this as any).os.getGoogleMaps().then(maps => {
const uluru = new maps.LatLng(this.p.geo.latitude, this.p.geo.longitude);
diff --git a/src/web/app/mobile/views/components/post-form.vue b/src/web/app/mobile/views/components/post-form.vue
index 5b47caebc7..2aa3c6f6c0 100644
--- a/src/web/app/mobile/views/components/post-form.vue
+++ b/src/web/app/mobile/views/components/post-form.vue
@@ -111,7 +111,7 @@ export default Vue.extend({
},
post() {
this.posting = true;
- const viaMobile = (this as any).os.i.client_settings.disableViaMobile !== true;
+ const viaMobile = (this as any).os.i.account.client_settings.disableViaMobile !== true;
(this as any).api('posts/create', {
text: this.text == '' ? undefined : this.text,
media_ids: this.files.length > 0 ? this.files.map(f => f.id) : undefined,
diff --git a/src/web/app/mobile/views/components/post.vue b/src/web/app/mobile/views/components/post.vue
index d464f6460f..8df4dbf22e 100644
--- a/src/web/app/mobile/views/components/post.vue
+++ b/src/web/app/mobile/views/components/post.vue
@@ -22,7 +22,7 @@
<div class="main">
<header>
<router-link class="name" :to="`/${p.user.username}`">{{ p.user.name }}</router-link>
- <span class="is-bot" v-if="p.user.is_bot">bot</span>
+ <span class="is-bot" v-if="p.user.account.is_bot">bot</span>
<span class="username">@{{ p.user.username }}</span>
<div class="info">
<span class="mobile" v-if="p.via_mobile">%fa:mobile-alt%</span>
@@ -137,7 +137,7 @@ export default Vue.extend({
// Draw map
if (this.p.geo) {
- const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.client_settings.showMaps : true;
+ const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.client_settings.showMaps : true;
if (shouldShowMap) {
(this as any).os.getGoogleMaps().then(maps => {
const uluru = new maps.LatLng(this.p.geo.latitude, this.p.geo.longitude);
diff --git a/src/web/app/mobile/views/components/ui.header.vue b/src/web/app/mobile/views/components/ui.header.vue
index 1ccbd5c951..66e10a0f8a 100644
--- a/src/web/app/mobile/views/components/ui.header.vue
+++ b/src/web/app/mobile/views/components/ui.header.vue
@@ -57,9 +57,9 @@ export default Vue.extend({
}
});
- const ago = (new Date().getTime() - new Date((this as any).os.i.last_used_at).getTime()) / 1000
+ const ago = (new Date().getTime() - new Date((this as any).os.i.account.last_used_at).getTime()) / 1000
const isHisasiburi = ago >= 3600;
- (this as any).os.i.last_used_at = new Date();
+ (this as any).os.i.account.last_used_at = new Date();
if (isHisasiburi) {
(this.$refs.welcomeback as any).style.display = 'block';
(this.$refs.main as any).style.overflow = 'hidden';
diff --git a/src/web/app/mobile/views/pages/home.vue b/src/web/app/mobile/views/pages/home.vue
index 44b0724915..b110fc4091 100644
--- a/src/web/app/mobile/views/pages/home.vue
+++ b/src/web/app/mobile/views/pages/home.vue
@@ -82,8 +82,8 @@ export default Vue.extend({
};
},
created() {
- if ((this as any).os.i.client_settings.mobile_home == null) {
- Vue.set((this as any).os.i.client_settings, 'mobile_home', [{
+ if ((this as any).os.i.account.client_settings.mobile_home == null) {
+ Vue.set((this as any).os.i.account.client_settings, 'mobile_home', [{
name: 'calendar',
id: 'a', data: {}
}, {
@@ -105,14 +105,14 @@ export default Vue.extend({
name: 'version',
id: 'g', data: {}
}]);
- this.widgets = (this as any).os.i.client_settings.mobile_home;
+ this.widgets = (this as any).os.i.account.client_settings.mobile_home;
this.saveHome();
} else {
- this.widgets = (this as any).os.i.client_settings.mobile_home;
+ this.widgets = (this as any).os.i.account.client_settings.mobile_home;
}
- this.$watch('os.i.client_settings', i => {
- this.widgets = (this as any).os.i.client_settings.mobile_home;
+ this.$watch('os.i.account.client_settings', i => {
+ this.widgets = (this as any).os.i.account.client_settings.mobile_home;
}, {
deep: true
});
@@ -157,15 +157,15 @@ export default Vue.extend({
},
onHomeUpdated(data) {
if (data.home) {
- (this as any).os.i.client_settings.mobile_home = data.home;
+ (this as any).os.i.account.client_settings.mobile_home = data.home;
this.widgets = data.home;
} else {
- const w = (this as any).os.i.client_settings.mobile_home.find(w => w.id == data.id);
+ const w = (this as any).os.i.account.client_settings.mobile_home.find(w => w.id == data.id);
if (w != null) {
w.data = data.data;
this.$refs[w.id][0].preventSave = true;
this.$refs[w.id][0].props = w.data;
- this.widgets = (this as any).os.i.client_settings.mobile_home;
+ this.widgets = (this as any).os.i.account.client_settings.mobile_home;
}
}
},
@@ -194,7 +194,7 @@ export default Vue.extend({
this.saveHome();
},
saveHome() {
- (this as any).os.i.client_settings.mobile_home = this.widgets;
+ (this as any).os.i.account.client_settings.mobile_home = this.widgets;
(this as any).api('i/update_mobile_home', {
home: this.widgets
});
diff --git a/src/web/app/mobile/views/pages/profile-setting.vue b/src/web/app/mobile/views/pages/profile-setting.vue
index f25d4bbe8d..941165c99e 100644
--- a/src/web/app/mobile/views/pages/profile-setting.vue
+++ b/src/web/app/mobile/views/pages/profile-setting.vue
@@ -53,9 +53,9 @@ export default Vue.extend({
},
created() {
this.name = (this as any).os.i.name;
- this.location = (this as any).os.i.profile.location;
+ this.location = (this as any).os.i.account.profile.location;
this.description = (this as any).os.i.description;
- this.birthday = (this as any).os.i.profile.birthday;
+ this.birthday = (this as any).os.i.account.profile.birthday;
},
mounted() {
document.title = 'Misskey | %i18n:mobile.tags.mk-profile-setting-page.title%';
diff --git a/src/web/app/mobile/views/pages/user.vue b/src/web/app/mobile/views/pages/user.vue
index 90f49a99a4..9f677f6cae 100644
--- a/src/web/app/mobile/views/pages/user.vue
+++ b/src/web/app/mobile/views/pages/user.vue
@@ -18,11 +18,11 @@
</div>
<div class="description">{{ user.description }}</div>
<div class="info">
- <p class="location" v-if="user.profile.location">
- %fa:map-marker%{{ user.profile.location }}
+ <p class="location" v-if="user.account.profile.location">
+ %fa:map-marker%{{ user.account.profile.location }}
</p>
- <p class="birthday" v-if="user.profile.birthday">
- %fa:birthday-cake%{{ user.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳)
+ <p class="birthday" v-if="user.account.profile.birthday">
+ %fa:birthday-cake%{{ user.account.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳)
</p>
</div>
<div class="status">
@@ -74,7 +74,7 @@ export default Vue.extend({
},
computed: {
age(): number {
- return age(this.user.profile.birthday);
+ return age(this.user.account.profile.birthday);
}
},
watch: {
diff --git a/src/web/app/mobile/views/pages/user/home.vue b/src/web/app/mobile/views/pages/user/home.vue
index fdbfd1bf55..dabb3f60b8 100644
--- a/src/web/app/mobile/views/pages/user/home.vue
+++ b/src/web/app/mobile/views/pages/user/home.vue
@@ -31,7 +31,7 @@
<x-followers-you-know :user="user"/>
</div>
</section>
- <p>%i18n:mobile.tags.mk-user-overview.last-used-at%: <b><mk-time :time="user.last_used_at"/></b></p>
+ <p>%i18n:mobile.tags.mk-user-overview.last-used-at%: <b><mk-time :time="user.account.last_used_at"/></b></p>
</div>
</template>
diff --git a/src/web/app/mobile/views/pages/welcome.vue b/src/web/app/mobile/views/pages/welcome.vue
index aa50b572ea..563d2b28c9 100644
--- a/src/web/app/mobile/views/pages/welcome.vue
+++ b/src/web/app/mobile/views/pages/welcome.vue
@@ -8,7 +8,7 @@
<form @submit.prevent="onSubmit">
<input v-model="username" type="text" pattern="^[a-zA-Z0-9-]+$" placeholder="ユーザー名" autofocus required @change="onUsernameChange"/>
<input v-model="password" type="password" placeholder="パスワード" required/>
- <input v-if="user && user.two_factor_enabled" v-model="token" type="number" placeholder="トークン" required/>
+ <input v-if="user && user.account.two_factor_enabled" v-model="token" type="number" placeholder="トークン" required/>
<button type="submit" :disabled="signing">{{ signing ? 'ログインしています' : 'ログイン' }}</button>
</form>
<div>
@@ -70,7 +70,7 @@ export default Vue.extend({
(this as any).api('signin', {
username: this.username,
password: this.password,
- token: this.user && this.user.two_factor_enabled ? this.token : undefined
+ token: this.user && this.user.account.two_factor_enabled ? this.token : undefined
}).then(() => {
location.reload();
}).catch(() => {
diff --git a/src/web/docs/api/entities/user.yaml b/src/web/docs/api/entities/user.yaml
index 528b9b0e13..f0d5fdbba1 100644
--- a/src/web/docs/api/entities/user.yaml
+++ b/src/web/docs/api/entities/user.yaml
@@ -81,12 +81,6 @@ props:
desc:
ja: "自分がこのユーザーをミュートしているか"
en: "Whether you muted this user"
- - name: "last_used_at"
- type: "date"
- optional: false
- desc:
- ja: "最終利用日時"
- en: "The last used date of this user"
- name: "posts_count"
type: "number"
optional: false
@@ -111,49 +105,63 @@ props:
desc:
ja: "ドライブの容量(bytes)"
en: "The capacity of drive of this user (bytes)"
- - name: "is_bot"
- type: "boolean"
- optional: true
- desc:
- ja: "botか否か(自己申告であることに留意)"
- en: "Whether is bot or not"
- - name: "twitter"
+ - name: "account"
type: "object"
- optional: true
+ optional: false
desc:
- ja: "連携されているTwitterアカウント情報"
- en: "The info of the connected twitter account of this user"
- defName: "twitter"
+ ja: "このサーバーにおけるアカウント"
+ en: "The account of this user on this server"
+ defName: "account"
def:
- - name: "user_id"
- type: "string"
+ - name: "last_used_at"
+ type: "date"
optional: false
desc:
- ja: "ユーザーID"
- en: "The user ID"
- - name: "screen_name"
- type: "string"
- optional: false
- desc:
- ja: "ユーザー名"
- en: "The screen name of this user"
- - name: "profile"
- type: "object"
- optional: false
- desc:
- ja: "プロフィール"
- en: "The profile of this user"
- defName: "profile"
- def:
- - name: "location"
- type: "string"
+ ja: "最終利用日時"
+ en: "The last used date of this user"
+ - name: "is_bot"
+ type: "boolean"
optional: true
desc:
- ja: "場所"
- en: "The location of this user"
- - name: "birthday"
- type: "string"
+ ja: "botか否か(自己申告であることに留意)"
+ en: "Whether is bot or not"
+ - name: "twitter"
+ type: "object"
optional: true
desc:
- ja: "誕生日 (YYYY-MM-DD)"
- en: "The birthday of this user (YYYY-MM-DD)"
+ ja: "連携されているTwitterアカウント情報"
+ en: "The info of the connected twitter account of this user"
+ defName: "twitter"
+ def:
+ - name: "user_id"
+ type: "string"
+ optional: false
+ desc:
+ ja: "ユーザーID"
+ en: "The user ID"
+ - name: "screen_name"
+ type: "string"
+ optional: false
+ desc:
+ ja: "ユーザー名"
+ en: "The screen name of this user"
+ - name: "profile"
+ type: "object"
+ optional: false
+ desc:
+ ja: "プロフィール"
+ en: "The profile of this user"
+ defName: "profile"
+ def:
+ - name: "location"
+ type: "string"
+ optional: true
+ desc:
+ ja: "場所"
+ en: "The location of this user"
+ - name: "birthday"
+ type: "string"
+ optional: true
+ desc:
+ ja: "誕生日 (YYYY-MM-DD)"
+ en: "The birthday of this user (YYYY-MM-DD)"