mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 23:25:13 +00:00
This commit is contained in:
parent
14aedb07aa
commit
f8c414aafc
8 changed files with 39 additions and 11 deletions
|
@ -550,6 +550,8 @@ desktop/views/components/settings.profile.vue:
|
||||||
description: "自己紹介"
|
description: "自己紹介"
|
||||||
birthday: "誕生日"
|
birthday: "誕生日"
|
||||||
save: "保存"
|
save: "保存"
|
||||||
|
is-bot: "このアカウントはBotです"
|
||||||
|
is-cat: "このアカウントはCatです"
|
||||||
|
|
||||||
desktop/views/components/sub-note-content.vue:
|
desktop/views/components/sub-note-content.vue:
|
||||||
hidden: "(この投稿は非公開です)"
|
hidden: "(この投稿は非公開です)"
|
||||||
|
@ -814,6 +816,7 @@ mobile/views/pages/settings/settings.profile.vue:
|
||||||
avatar: "アイコン"
|
avatar: "アイコン"
|
||||||
banner: "バナー"
|
banner: "バナー"
|
||||||
is-bot: "このアカウントはBotです"
|
is-bot: "このアカウントはBotです"
|
||||||
|
is-cat: "このアカウントはCatです"
|
||||||
save: "保存"
|
save: "保存"
|
||||||
saved: "プロフィールを保存しました"
|
saved: "プロフィールを保存しました"
|
||||||
uploading: "アップロード中"
|
uploading: "アップロード中"
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<header>
|
<header>
|
||||||
<router-link class="name" :to="p.user | userPage" v-user-preview="p.user.id">{{ p.user | userName }}</router-link>
|
<router-link class="name" :to="p.user | userPage" v-user-preview="p.user.id">{{ p.user | userName }}</router-link>
|
||||||
<span class="is-bot" v-if="p.user.host === null && p.user.isBot">bot</span>
|
<span class="is-bot" v-if="p.user.isBot">bot</span>
|
||||||
|
<span class="is-cat" v-if="p.user.isCat">cat</span>
|
||||||
<span class="username"><mk-acct :user="p.user"/></span>
|
<span class="username"><mk-acct :user="p.user"/></span>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
|
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
|
||||||
|
@ -431,6 +432,7 @@ root(isDark)
|
||||||
text-decoration underline
|
text-decoration underline
|
||||||
|
|
||||||
> .is-bot
|
> .is-bot
|
||||||
|
> .is-cat
|
||||||
margin 0 .5em 0 0
|
margin 0 .5em 0 0
|
||||||
padding 1px 6px
|
padding 1px 6px
|
||||||
font-size 12px
|
font-size 12px
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
<button class="ui primary" @click="save">%i18n:@save%</button>
|
<button class="ui primary" @click="save">%i18n:@save%</button>
|
||||||
<section>
|
<section>
|
||||||
<h2>その他</h2>
|
<h2>その他</h2>
|
||||||
<mk-switch v-model="os.i.isBot" @change="onChangeIsBot" text="このアカウントはbotです"/>
|
<mk-switch v-model="os.i.isBot" @change="onChangeIsBot" text="%i18n:@is-bot%"/>
|
||||||
|
<mk-switch v-model="os.i.isCat" @change="onChangeIsCat" text="%i18n:@is-cat%"/>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -65,6 +66,11 @@ export default Vue.extend({
|
||||||
(this as any).api('i/update', {
|
(this as any).api('i/update', {
|
||||||
isBot: (this as any).os.i.isBot
|
isBot: (this as any).os.i.isBot
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
onChangeIsCat() {
|
||||||
|
(this as any).api('i/update', {
|
||||||
|
isCat: (this as any).os.i.isCat
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
<header>
|
<header>
|
||||||
<mk-avatar class="avatar" :user="p.user" v-if="$store.state.device.postStyle == 'smart'"/>
|
<mk-avatar class="avatar" :user="p.user" v-if="$store.state.device.postStyle == 'smart'"/>
|
||||||
<router-link class="name" :to="p.user | userPage">{{ p.user | userName }}</router-link>
|
<router-link class="name" :to="p.user | userPage">{{ p.user | userName }}</router-link>
|
||||||
<span class="is-bot" v-if="p.user.host === null && p.user.isBot">bot</span>
|
<span class="is-bot" v-if="p.user.isBot">bot</span>
|
||||||
|
<span class="is-cat" v-if="p.user.isCat">cat</span>
|
||||||
<span class="username"><mk-acct :user="p.user"/></span>
|
<span class="username"><mk-acct :user="p.user"/></span>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span class="mobile" v-if="p.viaMobile">%fa:mobile-alt%</span>
|
<span class="mobile" v-if="p.viaMobile">%fa:mobile-alt%</span>
|
||||||
|
@ -386,6 +387,7 @@ root(isDark)
|
||||||
text-decoration underline
|
text-decoration underline
|
||||||
|
|
||||||
> .is-bot
|
> .is-bot
|
||||||
|
> .is-cat
|
||||||
margin 0 0.5em 0 0
|
margin 0 0.5em 0 0
|
||||||
padding 1px 6px
|
padding 1px 6px
|
||||||
font-size 12px
|
font-size 12px
|
||||||
|
|
|
@ -50,7 +50,11 @@
|
||||||
md-content="%18n:!@uploading%"/>
|
md-content="%18n:!@uploading%"/>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<md-switch v-model="os.i.isBot" @change="onChangeIsBot">%i18n:@is-bot%</md-switch>
|
<md-switch v-model="isBot">%i18n:@is-bot%</md-switch>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<md-switch v-model="isCat">%i18n:@is-cat%</md-switch>
|
||||||
</div>
|
</div>
|
||||||
</md-card-content>
|
</md-card-content>
|
||||||
|
|
||||||
|
@ -75,6 +79,8 @@ export default Vue.extend({
|
||||||
birthday: null,
|
birthday: null,
|
||||||
avatarId: null,
|
avatarId: null,
|
||||||
bannerId: null,
|
bannerId: null,
|
||||||
|
isBot: false,
|
||||||
|
isCat: false,
|
||||||
saving: false,
|
saving: false,
|
||||||
uploading: false
|
uploading: false
|
||||||
};
|
};
|
||||||
|
@ -88,15 +94,11 @@ export default Vue.extend({
|
||||||
this.birthday = (this as any).os.i.profile.birthday;
|
this.birthday = (this as any).os.i.profile.birthday;
|
||||||
this.avatarId = (this as any).os.i.avatarId;
|
this.avatarId = (this as any).os.i.avatarId;
|
||||||
this.bannerId = (this as any).os.i.bannerId;
|
this.bannerId = (this as any).os.i.bannerId;
|
||||||
|
this.isBot = (this as any).os.i.isBot;
|
||||||
|
this.isCat = (this as any).os.i.isCat;
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onChangeIsBot() {
|
|
||||||
(this as any).api('i/update', {
|
|
||||||
isBot: (this as any).os.i.isBot
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
onAvatarChange([file]) {
|
onAvatarChange([file]) {
|
||||||
this.uploading = true;
|
this.uploading = true;
|
||||||
|
|
||||||
|
@ -150,7 +152,9 @@ export default Vue.extend({
|
||||||
description: this.description || null,
|
description: this.description || null,
|
||||||
birthday: this.birthday || null,
|
birthday: this.birthday || null,
|
||||||
avatarId: this.avatarId,
|
avatarId: this.avatarId,
|
||||||
bannerId: this.bannerId
|
bannerId: this.bannerId,
|
||||||
|
isBot: this.isBot,
|
||||||
|
isCat: this.isCat
|
||||||
}).then(i => {
|
}).then(i => {
|
||||||
this.saving = false;
|
this.saving = false;
|
||||||
(this as any).os.i.avatarId = i.avatarId;
|
(this as any).os.i.avatarId = i.avatarId;
|
||||||
|
|
|
@ -324,6 +324,10 @@ export const pack = async (
|
||||||
// resolve promises in _note object
|
// resolve promises in _note object
|
||||||
_note = await rap(_note);
|
_note = await rap(_note);
|
||||||
|
|
||||||
|
if (_note.user.isCat && _note.text) {
|
||||||
|
_note.text = _note.text.replace(/な/g, 'にゃ').replace(/ナ/g, 'ニャ');
|
||||||
|
}
|
||||||
|
|
||||||
if (hide) {
|
if (hide) {
|
||||||
_note.mediaIds = [];
|
_note.mediaIds = [];
|
||||||
_note.text = null;
|
_note.text = null;
|
||||||
|
|
|
@ -77,6 +77,7 @@ export interface ILocalUser extends IUserBase {
|
||||||
};
|
};
|
||||||
lastUsedAt: Date;
|
lastUsedAt: Date;
|
||||||
isBot: boolean;
|
isBot: boolean;
|
||||||
|
isCat: boolean;
|
||||||
isPro: boolean;
|
isPro: boolean;
|
||||||
twoFactorSecret: string;
|
twoFactorSecret: string;
|
||||||
twoFactorEnabled: boolean;
|
twoFactorEnabled: boolean;
|
||||||
|
|
|
@ -47,6 +47,11 @@ module.exports = async (params, user, app) => new Promise(async (res, rej) => {
|
||||||
if (isBotErr) return rej('invalid isBot param');
|
if (isBotErr) return rej('invalid isBot param');
|
||||||
if (isBot != null) user.isBot = isBot;
|
if (isBot != null) user.isBot = isBot;
|
||||||
|
|
||||||
|
// Get 'isCat' parameter
|
||||||
|
const [isCat, isCatErr] = $.bool.optional().get(params.isCat);
|
||||||
|
if (isCatErr) return rej('invalid isCat param');
|
||||||
|
if (isCat != null) user.isCat = isCat;
|
||||||
|
|
||||||
// Get 'autoWatch' parameter
|
// Get 'autoWatch' parameter
|
||||||
const [autoWatch, autoWatchErr] = $.bool.optional().get(params.autoWatch);
|
const [autoWatch, autoWatchErr] = $.bool.optional().get(params.autoWatch);
|
||||||
if (autoWatchErr) return rej('invalid autoWatch param');
|
if (autoWatchErr) return rej('invalid autoWatch param');
|
||||||
|
@ -82,6 +87,7 @@ module.exports = async (params, user, app) => new Promise(async (res, rej) => {
|
||||||
bannerColor: user.bannerColor,
|
bannerColor: user.bannerColor,
|
||||||
profile: user.profile,
|
profile: user.profile,
|
||||||
isBot: user.isBot,
|
isBot: user.isBot,
|
||||||
|
isCat: user.isCat,
|
||||||
settings: user.settings
|
settings: user.settings
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue