1
0

ユーザーグループ

Resolve #3218
This commit is contained in:
syuilo
2019-05-18 20:36:33 +09:00
parent 61f54f8f74
commit c7cc3dcdfd
65 changed files with 1797 additions and 638 deletions
@@ -2,9 +2,10 @@
<mk-ui>
<template #header>
<template v-if="user"><span style="margin-right:4px;"><fa :icon="['far', 'comments']"/></span><mk-user-name :user="user"/></template>
<template v-else-if="group"><span style="margin-right:4px;"><fa :icon="['far', 'comments']"/></span>{{ group.name }}</template>
<template v-else><mk-ellipsis/></template>
</template>
<x-messaging-room v-if="!fetching" :user="user" :is-naked="true"/>
<x-messaging-room v-if="!fetching" :user="user" :group="group" :is-naked="true"/>
</mk-ui>
</template>
@@ -22,6 +23,7 @@ export default Vue.extend({
return {
fetching: true,
user: null,
group: null,
unwatchDarkmode: null
};
},
@@ -48,12 +50,21 @@ export default Vue.extend({
methods: {
fetch() {
this.fetching = true;
this.$root.api('users/show', parseAcct(this.$route.params.user)).then(user => {
this.user = user;
this.fetching = false;
if (this.$route.params.user) {
this.$root.api('users/show', parseAcct(this.$route.params.user)).then(user => {
this.user = user;
this.fetching = false;
document.title = `${this.$t('@.messaging')}: ${Vue.filter('userName')(this.user)} | ${this.$root.instanceName}`;
});
document.title = `${this.$t('@.messaging')}: ${Vue.filter('userName')(this.user)} | ${this.$root.instanceName}`;
});
} else {
this.$root.api('users/groups/show', { groupId: this.$route.params.group }).then(group => {
this.group = group;
this.fetching = false;
document.title = this.$t('@.messaging') + ': ' + this.group.name;
});
}
}
}
});