parent
2b67a35a06
commit
2112448ae9
2 changed files with 80 additions and 33 deletions
|
|
@ -904,3 +904,16 @@ $admin-fg: white;
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.new-room {
|
||||||
|
font-family: "Inter", sans-serif;
|
||||||
|
font-size: 16px !important;
|
||||||
|
font-weight: 600 !important;
|
||||||
|
text-decoration: underline;
|
||||||
|
color: black;
|
||||||
|
&::after {
|
||||||
|
content: "\00a0\00a0>";
|
||||||
|
display: inline-block;
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,36 @@
|
||||||
<template>
|
<template>
|
||||||
<v-list dense class="room-list">
|
<v-list dense class="room-list">
|
||||||
<div v-if="showInvites && $matrix.invites.length > 0" class="h4">{{invitesTitle}}</div>
|
<div v-if="showInvites && $matrix.invites.length > 0" class="h4">
|
||||||
<v-list-item-group v-if="showInvites" v-model="currentRoomId" color="primary">
|
{{ invitesTitle }}
|
||||||
|
</div>
|
||||||
|
<v-list-item-group
|
||||||
|
v-if="showInvites"
|
||||||
|
v-model="currentRoomId"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
<v-slide-y-transition group>
|
<v-slide-y-transition group>
|
||||||
<v-list-item :disabled="roomsProcessing[room.roomId]" v-for="room in $matrix.invites" :key="room.roomId" :value="room.roomId">
|
<v-list-item
|
||||||
|
:disabled="roomsProcessing[room.roomId]"
|
||||||
|
v-for="room in $matrix.invites"
|
||||||
|
:key="room.roomId"
|
||||||
|
:value="room.roomId"
|
||||||
|
>
|
||||||
<v-list-item-avatar size="40" color="#e0e0e0">
|
<v-list-item-avatar size="40" color="#e0e0e0">
|
||||||
<v-img :src="room.avatar" />
|
<v-img :src="room.avatar" />
|
||||||
</v-list-item-avatar>
|
</v-list-item-avatar>
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
<v-list-item-title>{{ room.name || room.summary.info.title }}</v-list-item-title>
|
<v-list-item-title>{{
|
||||||
|
room.name || room.summary.info.title
|
||||||
|
}}</v-list-item-title>
|
||||||
<v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle>
|
<v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
<v-list-item-action>
|
<v-list-item-action>
|
||||||
<v-btn @click.stop="acceptInvitation(room)" icon><v-icon>check_circle</v-icon></v-btn>
|
<v-btn @click.stop="acceptInvitation(room)" icon
|
||||||
<v-btn @click.stop="rejectInvitation(room)" icon><v-icon>cancel</v-icon></v-btn>
|
><v-icon>check_circle</v-icon></v-btn
|
||||||
|
>
|
||||||
|
<v-btn @click.stop="rejectInvitation(room)" icon
|
||||||
|
><v-icon>cancel</v-icon></v-btn
|
||||||
|
>
|
||||||
</v-list-item-action>
|
</v-list-item-action>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-slide-y-transition>
|
</v-slide-y-transition>
|
||||||
|
|
@ -21,19 +38,24 @@
|
||||||
<div class="h4">{{ title }}</div>
|
<div class="h4">{{ title }}</div>
|
||||||
<v-list-item-group v-model="currentRoomId" color="primary">
|
<v-list-item-group v-model="currentRoomId" color="primary">
|
||||||
<v-list-item v-if="showCreate" @click.stop="$emit('newroom')">
|
<v-list-item v-if="showCreate" @click.stop="$emit('newroom')">
|
||||||
<v-list-item-avatar size="40" color="#e0e0e0">
|
|
||||||
<v-img />
|
|
||||||
</v-list-item-avatar>
|
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
<v-list-item-title>{{$t('menu.new_room')}}</v-list-item-title>
|
<v-list-item-title class="new-room">{{
|
||||||
|
$t("menu.new_room")
|
||||||
|
}}</v-list-item-title>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
<v-list-item v-for="room in $matrix.joinedRooms" :key="room.roomId" :value="room.roomId">
|
<v-list-item
|
||||||
|
v-for="room in $matrix.joinedRooms"
|
||||||
|
:key="room.roomId"
|
||||||
|
:value="room.roomId"
|
||||||
|
>
|
||||||
<v-list-item-avatar size="40" color="#e0e0e0">
|
<v-list-item-avatar size="40" color="#e0e0e0">
|
||||||
<v-img :src="room.avatar" />
|
<v-img :src="room.avatar" />
|
||||||
</v-list-item-avatar>
|
</v-list-item-avatar>
|
||||||
<div class="room-list-notification-count">{{ notificationCount(room) }}</div>
|
<div class="room-list-notification-count">
|
||||||
|
{{ notificationCount(room) }}
|
||||||
|
</div>
|
||||||
<v-list-item-content>
|
<v-list-item-content>
|
||||||
<v-list-item-title>{{ room.summary.info.title }}</v-list-item-title>
|
<v-list-item-title>{{ room.summary.info.title }}</v-list-item-title>
|
||||||
<v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle>
|
<v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle>
|
||||||
|
|
@ -45,7 +67,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import util from "../plugins/utils";
|
import util from "../plugins/utils";
|
||||||
import Vue from 'vue';
|
import Vue from "vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RoomList",
|
name: "RoomList",
|
||||||
|
|
@ -53,20 +75,20 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "Rooms"
|
default: "Rooms",
|
||||||
},
|
},
|
||||||
invitesTitle: {
|
invitesTitle: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "Invites"
|
default: "Invites",
|
||||||
},
|
},
|
||||||
showInvites: {
|
showInvites: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
},
|
},
|
||||||
showCreate: {
|
showCreate: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
|
@ -77,18 +99,23 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
notificationCount(room) {
|
notificationCount(room) {
|
||||||
return room.getUnreadNotificationCount('total') || 0;
|
return room.getUnreadNotificationCount("total") || 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
acceptInvitation(room) {
|
acceptInvitation(room) {
|
||||||
Vue.set(this.roomsProcessing, room.roomId, true);
|
Vue.set(this.roomsProcessing, room.roomId, true);
|
||||||
this.$matrix.matrixClient.joinRoom(room.roomId)
|
this.$matrix.matrixClient
|
||||||
|
.joinRoom(room.roomId)
|
||||||
.then((ignoredRoom) => {
|
.then((ignoredRoom) => {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$navigation.push(
|
this.$navigation.push(
|
||||||
{
|
{
|
||||||
name: "Chat",
|
name: "Chat",
|
||||||
params: { roomId: util.sanitizeRoomId(room.getCanonicalAlias() || room.roomId) },
|
params: {
|
||||||
|
roomId: util.sanitizeRoomId(
|
||||||
|
room.getCanonicalAlias() || room.roomId
|
||||||
|
),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
-1
|
-1
|
||||||
);
|
);
|
||||||
|
|
@ -104,7 +131,8 @@ export default {
|
||||||
|
|
||||||
rejectInvitation(room) {
|
rejectInvitation(room) {
|
||||||
Vue.set(this.roomsProcessing, room.roomId, true);
|
Vue.set(this.roomsProcessing, room.roomId, true);
|
||||||
this.$matrix.leaveRoom(room.roomId)
|
this.$matrix
|
||||||
|
.leaveRoom(room.roomId)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error("Failed to reject invite: ", err);
|
console.error("Failed to reject invite: ", err);
|
||||||
})
|
})
|
||||||
|
|
@ -121,7 +149,13 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.$emit("close");
|
this.$emit("close");
|
||||||
this.$navigation.push({name: 'Chat', params: { roomId: util.sanitizeRoomId(this.currentRoomId) }}, -1);
|
this.$navigation.push(
|
||||||
|
{
|
||||||
|
name: "Chat",
|
||||||
|
params: { roomId: util.sanitizeRoomId(this.currentRoomId) },
|
||||||
|
},
|
||||||
|
-1
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue