diff --git a/README.md b/README.md index 2292d13..04bb34e 100644 --- a/README.md +++ b/README.md @@ -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 " diff --git a/src/assets/translations/en.json b/src/assets/translations/en.json index 7e4424a..50c591e 100644 --- a/src/assets/translations/en.json +++ b/src/assets/translations/en.json @@ -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": { diff --git a/src/components/Join.vue b/src/components/Join.vue index 938952b..7bf3e52 100644 --- a/src/components/Join.vue +++ b/src/components/Join.vue @@ -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) => { diff --git a/src/components/messages/ContactJoin.vue b/src/components/messages/ContactJoin.vue index d8aa6d8..ec89512 100644 --- a/src/components/messages/ContactJoin.vue +++ b/src/components/messages/ContactJoin.vue @@ -1,6 +1,14 @@ @@ -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; + }, + } };