Add "auto_join_rooms" flag
This commit is contained in:
parent
b646b1c8ad
commit
66ea1c4fdc
4 changed files with 32 additions and 3 deletions
|
|
@ -53,7 +53,7 @@ The app loads runtime configutation from the server at "./config.json" and merge
|
|||
* **accentColor** - The accent color of the app UI. Use a HTML-style color value string, like "#ff0080".
|
||||
* **show_status_messages** - Whether to show only user joins/leaves and display name updates, or the full range of room status updates. Possible values are "never" (only the above), "moderators" (moderators will see all status updates) or "always" (everyone will see all status updates). Defaults to "always".
|
||||
* **maxSizeAutoDownloads** - Attachments smaller than this will be auto downloaded. Default is 10Mb.
|
||||
|
||||
* **auto_join_rooms** - Whether to show the normal "join" screen or just auto join the user to the room link. Default to false.
|
||||
|
||||
### Sticker short codes - To enable sticker short codes, follow these steps:
|
||||
* Run the "create sticker config" script using "npm run create-sticker-config <path-to-sticker-packs>"
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@
|
|||
"join_channel": "All set! Invite people to join you: {link}",
|
||||
"info_retention": "🕓 Messages sent within {time} are viewable by anyone with the link.",
|
||||
"info_retention_user": "🕓 Messages older than {time} will be deleted from the history.",
|
||||
"info_auto_join": "Welcome to {room}.\nYou are joining as {you}.",
|
||||
"change": "Change"
|
||||
},
|
||||
"new_room": {
|
||||
|
|
|
|||
|
|
@ -306,7 +306,14 @@ export default {
|
|||
return roomName ? roomName : "";
|
||||
},
|
||||
getRoomInfo() {
|
||||
if (this.roomId.startsWith("#")) {
|
||||
if (this.$config.auto_join_rooms) {
|
||||
// Auto-join room
|
||||
this.waitingForRoomCreation = true;
|
||||
this.$nextTick(() => {
|
||||
this.handleJoin();
|
||||
});
|
||||
}
|
||||
else if (this.roomId.startsWith("#")) {
|
||||
this.$matrix
|
||||
.getPublicRoomInfo(this.roomId)
|
||||
.then((room) => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
<template>
|
||||
<div v-if="$config.auto_join_rooms && !roomCreatedByYou() && event.getSender() == $matrix.currentUserId" class="created-room-welcome-header" style="white-space: pre-line;">
|
||||
{{ $t('room_welcome.info_auto_join',{room: room ? room.name : "",you: $matrix.currentUserDisplayName}) }}
|
||||
<div class="ma-0">
|
||||
<a href="#" text @click.prevent="viewProfile">
|
||||
{{ $t("room_welcome.change") }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Contact joined the chat -->
|
||||
<div class="messageJoin">
|
||||
<div v-else class="messageJoin">
|
||||
{{ $t('message.user_joined',{user: eventSenderDisplayName(event)}) }}
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -10,6 +18,19 @@ import messageMixin from "./messageMixin";
|
|||
|
||||
export default {
|
||||
mixins: [messageMixin],
|
||||
methods: {
|
||||
viewProfile() {
|
||||
this.$navigation.push({ name: "Profile" }, 1);
|
||||
},
|
||||
roomCreatedByYou() {
|
||||
const createEvent = this.room && this.room.currentState.getStateEvents("m.room.create", "");
|
||||
if (createEvent) {
|
||||
const creatorId = createEvent.getContent().creator;
|
||||
return (creatorId == this.$matrix.currentUserId);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue