diff --git a/src/assets/css/chat.scss b/src/assets/css/chat.scss index d571e76..f47a278 100644 --- a/src/assets/css/chat.scss +++ b/src/assets/css/chat.scss @@ -922,8 +922,9 @@ body { } .room-info { - background-color: #e8e8e8; + background-color: #FDFBF9; height: 100%; + .chat-header { background-color: transparent; border: none; @@ -978,6 +979,7 @@ body { .v-card { background-color: white; border-radius: 20px; + box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.05) !important; } .member .user-name { @@ -994,6 +996,14 @@ body { margin-left: 38px; } + .member.v-list-item { + height: 56px; + + &::before { + opacity: 0; + } + } + .show-all { color: black; font-size: 14 * $chat-text-size; @@ -1009,6 +1019,22 @@ body { } } +.member-action-dialog { + .user-name { + font-size: 18px; + font-weight: 700; + } + .v-list-item__title { + color:#074EE8; + font-size: 16px !important; + font-weight: 700 !important; + } + .v-list-item__subtitle { + color: rgba(0, 0, 0, 0.8); + font-size: 14px !important; + } +} + .with-right-label { display: flex; flex-wrap: nowrap; diff --git a/src/assets/icons/direct_chat.vue b/src/assets/icons/direct_chat.vue new file mode 100644 index 0000000..44c53ba --- /dev/null +++ b/src/assets/icons/direct_chat.vue @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/src/assets/icons/kickout.vue b/src/assets/icons/kickout.vue new file mode 100644 index 0000000..e69e435 --- /dev/null +++ b/src/assets/icons/kickout.vue @@ -0,0 +1,8 @@ + diff --git a/src/assets/icons/make_admin.vue b/src/assets/icons/make_admin.vue new file mode 100644 index 0000000..d22467a --- /dev/null +++ b/src/assets/icons/make_admin.vue @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/src/assets/icons/make_moderator.vue b/src/assets/icons/make_moderator.vue new file mode 100644 index 0000000..7527061 --- /dev/null +++ b/src/assets/icons/make_moderator.vue @@ -0,0 +1,5 @@ + diff --git a/src/assets/icons/revoke.vue b/src/assets/icons/revoke.vue new file mode 100644 index 0000000..7c2c00d --- /dev/null +++ b/src/assets/icons/revoke.vue @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/src/assets/translations/bo.json b/src/assets/translations/bo.json index 963a18a..356bd16 100644 --- a/src/assets/translations/bo.json +++ b/src/assets/translations/bo.json @@ -115,11 +115,9 @@ "ignore": "སྣང་མེད་ཐོངས།", "join": "ཞུགས།", "undo": "ཕྱིར་བསྡུ།", - "user_kick_and_ban": "སྤྱོད་མཁན་འདི་ཕྱིར་འབུད་དང་བཀག་སྡོམ་བྱོས།", "user_make_admin": "འཛིན་སྐྱོང་པ་བཟོས།", "user_make_moderator": "གཙོ་སྐྱོང་བ་བཟོས།", - "user_revoke_moderator": "གཙོ་སྐྱོང་བའི་དབང་ཚད་མེད་པར་བཟོས།", - "user_kick": "སྤྱོད་མཁན་འདི་སྒོར་ཕུད།" + "user_revoke_moderator": "གཙོ་སྐྱོང་བའི་དབང་ཚད་མེད་པར་བཟོས།" }, "profile": { "change_password": "གསང་ཚིག་རྗེས།", diff --git a/src/assets/translations/en.json b/src/assets/translations/en.json index 173a8bc..2423754 100644 --- a/src/assets/translations/en.json +++ b/src/assets/translations/en.json @@ -23,7 +23,7 @@ }, "menu": { "start_private_chat": "Direct Message with this user", - "actions": "actions", + "direct_chat": "Direct chat", "reply": "Reply", "edit": "Edit", "delete": "Delete", @@ -41,9 +41,8 @@ "join": "Join", "ignore": "Ignore", "loading": "Loading {appName}", - "user_kick": "Kick this user", - "user_kick_and_ban": "Kick and ban this user", - "user_make_admin": "Make administrator", + "user_kick_and_ban": "Kick out", + "user_make_admin": "Make admin", "user_make_moderator": "Make moderator", "user_revoke_moderator": "Revoke moderator" }, @@ -164,7 +163,6 @@ "options": "Options" }, "device_list": { - "title": "DEVICES", "blocked": "Blocked", "verified": "Verified", "not_verified": "Not verified" diff --git a/src/assets/translations/es.json b/src/assets/translations/es.json index cb49075..bf2e25c 100644 --- a/src/assets/translations/es.json +++ b/src/assets/translations/es.json @@ -263,8 +263,6 @@ "loading": "Cargando {appName}", "undo": "Deshacer", "join": "Unirse", - "user_kick": "Expulsa a este usuario", - "user_kick_and_ban": "Expulsar y banear a este usuario", "user_make_moderator": "Hacer moderador", "user_make_admin": "Hacer administrador", "user_revoke_moderator": "Revocar al moderador", diff --git a/src/assets/translations/pt_BR.json b/src/assets/translations/pt_BR.json index 564d8c1..d5e71a1 100644 --- a/src/assets/translations/pt_BR.json +++ b/src/assets/translations/pt_BR.json @@ -52,9 +52,7 @@ "join": "Entrar", "ignore": "Ignore", "loading": "Carregando {appName}", - "user_kick": "Expulsar este usuário", "user_make_moderator": "Tornar moderador", - "user_kick_and_ban": "Expulsar e banir este usuário", "user_make_admin": "Tornar administrador", "user_revoke_moderator": "Revogar moderador", "delete_now": "Excluir agora" diff --git a/src/assets/translations/zh_Hans.json b/src/assets/translations/zh_Hans.json index 30da12a..048d919 100644 --- a/src/assets/translations/zh_Hans.json +++ b/src/assets/translations/zh_Hans.json @@ -179,8 +179,6 @@ "ignore": "忽略", "join": "加入", "undo": "撤销", - "user_kick_and_ban": "移出并禁止该用户", - "user_kick": "移出该用户", "user_make_admin": "设为管理员", "user_make_moderator": "设为版主", "user_revoke_moderator": "撤销版主身份" diff --git a/src/components/MemberActionDialog.vue b/src/components/MemberActionDialog.vue new file mode 100644 index 0000000..a2f4f52 --- /dev/null +++ b/src/components/MemberActionDialog.vue @@ -0,0 +1,200 @@ + + + + \ No newline at end of file diff --git a/src/components/RoomInfo.vue b/src/components/RoomInfo.vue index c7b3beb..236b753 100644 --- a/src/components/RoomInfo.vue +++ b/src/components/RoomInfo.vue @@ -189,6 +189,14 @@ v-model="readOnlyRoom" > + +
+
{{ $t('room_info.message_retention') }}
+
{{ $t('room_info.message_retention_info') }}
+
+
{{ messageRetention }}
+ edit +
@@ -196,69 +204,48 @@ >{{ $t("room_info.members") }}
{{ members.length }}
- - - -
- - - {{ - member.name.substring(0, 1).toUpperCase() - }} - - - {{ - member.userId == $matrix.currentUserId - ? $t("room_info.user_you", { - user: member.user ? member.user.displayName : member.name, - }) - : $t("room_info.user", { - user: member.user ? member.user.displayName : member.name, - }) - }} - - - {{ $t("room_info.user_admin") }} - - - {{ $t("room_info.user_moderator") }} - -
-
- - - {{ $t("menu.actions") }} - {{$t('device_list.title')}} - - -
- {{ $t("menu.start_private_chat") }} -
-
{{ String.fromCharCode(160) }}
- {{ $t("menu.user_kick") }} - {{ $t("menu.user_kick_and_ban") }} -
-
{{ String.fromCharCode(160) }}
- {{ $t("menu.user_make_admin") }} - {{ $t("menu.user_make_moderator") }} - {{ $t("menu.user_revoke_moderator") }} -
-
- - - - -
-
-
-
+ + + + +
{{ showAllMembers ? $t("room_info.hide_all") : $t("room_info.show_all") }}
@@ -279,6 +266,13 @@ {{ $t("room_info.version_info", { version: buildVersion }) }} + + rp.value===retention) this.messageRetention = retentionPeriodsFound.text + }, + onListItemClick(member) { + this.activeMember = member + this.showMemberActionConfirmation = true }, onEvent(event) { if (this.room && this.room.roomId == event.getRoomId()) { @@ -490,19 +490,6 @@ export default { } }, - memberAvatar(member) { - if (member) { - return member.getAvatarUrl( - this.$matrix.matrixClient.getHomeserverUrl(), - 40, - 40, - "scale", - true - ); - } - return null; - }, - viewProfile() { this.$navigation.push({ name: "Profile" }, 1); }, @@ -551,49 +538,11 @@ export default { this.updatingJoinRule = false; }); }, - startPrivateChat(userId) { - this.$matrix - .getOrCreatePrivateChat(userId) - .then((room) => { - this.$nextTick(() => { - this.$navigation.push( - { - name: "Chat", - params: { - roomId: util.sanitizeRoomId( - room.getCanonicalAlias() || room.roomId - ), - }, - }, - -1 - ); - }); - }) - .catch((err) => { - console.error(err); - }); - }, exportRoom() { if (this.room) { this.exporting = true; } }, - canKickUser(member) { - if (this.room) { - const myUserId = this.$matrix.currentUserId; - const me = this.room.getMember(myUserId); - return me && me.powerLevel > member.powerLevel && this.room.currentState && this.room.currentState.hasSufficientPowerLevelFor("kick", me.powerLevel); - } - return false; - }, - canBanUser(member) { - if (this.room) { - const myUserId = this.$matrix.currentUserId; - const me = this.room.getMember(myUserId); - return me && me.powerLevelNorm > member.powerLevelNorm && this.room.currentState && this.room.currentState.hasSufficientPowerLevelFor("ban", me.powerLevel); - } - return false; - }, /** * Return true if we can change power levels in the room, i.e. make read only room */ @@ -610,76 +559,6 @@ export default { } return false; }, - // TODO - following power level comparisons assume that default power levels are used in the room! - isAdmin(member) { - return member.powerLevelNorm > 50; - }, - isModerator(member) { - return member.powerLevelNorm > 0 && member.powerLevelNorm <= 50; - }, - /** - * Return true if WE can make the member an admin - * @param member - */ - canMakeAdmin(ignoredmember) { - if (this.room) { - const myUserId = this.$matrix.currentUserId; - const me = this.room.getMember(myUserId); - return me && this.isAdmin(me); - } - return false; - }, - - /** - * Return true if WE can make the member a moderator - * @param member - */ - canMakeModerator(ignoredmember) { - if (this.room) { - const myUserId = this.$matrix.currentUserId; - const me = this.room.getMember(myUserId); - return me && this.isAdmin(me); - } - return false; - }, - /** - * Return true if WE can "unmake" the member a moderator - * @param member - */ - canRevokeModerator(member) { - if (this.room) { - const myUserId = this.$matrix.currentUserId; - const me = this.room.getMember(myUserId); - return me && this.isAdmin(me) && me.powerLevel > member.powerLevel; - } - return false; - }, - makeAdmin(member) { - if (this.room) { - this.$matrix.makeAdmin(this.room.roomId, member.userId) - } - }, - makeModerator(member) { - if (this.room) { - this.$matrix.makeModerator(this.room.roomId, member.userId) - } - }, - revokeModerator(member) { - if (this.room) { - this.$matrix.revokeModerator(this.room.roomId, member.userId) - } - }, - kickUser(member) { - if (this.room) { - this.$matrix.kickUser(this.room.roomId, member.userId) - } - }, - banUser(member) { - if (this.room) { - this.$matrix.banUser(this.room.roomId, member.userId) - } - }, - /** * Go back to previous page, or if none on the stack, go back to current room view. */ diff --git a/src/components/roomInfoMixin.js b/src/components/roomInfoMixin.js index 2a5c08c..5497406 100644 --- a/src/components/roomInfoMixin.js +++ b/src/components/roomInfoMixin.js @@ -159,6 +159,25 @@ export default { }, }, methods: { + memberAvatar(member) { + if (member) { + return member.getAvatarUrl( + this.$matrix.matrixClient.getHomeserverUrl(), + 40, + 40, + "scale", + true + ); + } + return null; + }, + // TODO - following power level comparisons assume that default power levels are used in the room! + isAdmin(member) { + return member.powerLevelNorm > 50; + }, + isModerator(member) { + return member.powerLevelNorm > 0 && member.powerLevelNorm <= 50; + }, /** * Get a string describing current room retention setting. * Can be "None", "1 week", "1 hour" etc...