Merge branch '591-feedback-on-channels-implementation-29-apr-2024' into 'dev'

Show username and "change" in the welcome header

See merge request keanuapp/keanuapp-weblite!309
This commit is contained in:
N Pex 2024-07-23 09:36:57 +00:00
commit ff7851cb53
3 changed files with 24 additions and 7 deletions

View file

@ -54,7 +54,7 @@
<component :is="roomWelcomeHeader" v-on:close="closeRoomWelcomeHeader"></component>
<!-- If we have a retention timer, it means we have active message retention. Show header. -->
<WelcomeHeaderChannelUser v-if="retentionTimer && !roomWelcomeHeader" />
<WelcomeHeaderChannelUser v-if="retentionTimer && !roomWelcomeHeader && newlyJoinedRoom" />
<div v-for="(event, index) in filteredEvents" :key="event.getId()" :eventId="event.getId()">
<!-- DAY Marker, shown for every new day in the timeline -->
@ -478,6 +478,7 @@ export default {
/** If we just created this room, show a small welcome header with info */
hideRoomWelcomeHeader: false,
newlyJoinedRoom: false,
/** An array of recent emojis. Used in the "message operations" popup. */
recentEmojis: [],
@ -830,6 +831,7 @@ export default {
this.typingMembers = [];
this.initialLoadDone = false;
this.hideRoomWelcomeHeader = false;
this.newlyJoinedRoom = false;
// Stop RR timer
this.stopRRTimer();
@ -957,6 +959,16 @@ export default {
},
onRoomJoined(initialEventId) {
// If our own join event is less than a minute old, consider this a "newly joined" room.
//
// Previously tried to look at initialEventId, but it seems like "this.room.getEventReadUpTo(this.$matrix.currentUserId, false)"
// always returns an event id? Strange. I would expect it to be null on a fresh room.
//
const joinEvent = this.room && this.room.currentState.getStateEvents("m.room.member", this.$matrix.currentUserId);
if (joinEvent) {
this.newlyJoinedRoom = joinEvent.getLocalAge() < 1 * 60000 /* 1 minute */;
}
// Listen to events
this.$matrix.on("Room.timeline", this.onEvent);
this.$matrix.on("RoomMember.typing", this.onUserTyping);

View file

@ -20,12 +20,8 @@
<template v-slot:time>
<b>{{ messageRetentionDisplay }}</b>
</template>
</i18n>
</div>
<div class="mt-2" v-if="roomMessageRetention() > 0">
<a href="#" text @click.prevent="showMessageRetentionDialog = true">
{{ $t("room_welcome.change") }}
</a>
</i18n>&nbsp;
<a href="#" text @click.prevent="showMessageRetentionDialog = true" style="white-space: pre-line;">{{ $t("room_welcome.change") }}</a>
</div>
<div class="text-end">
<v-btn id="btn-got-it" text @click.stop="$emit('close')" class="text-transform-0">

View file

@ -1,5 +1,11 @@
<template>
<div class="created-room-welcome-header">
<div v-if="$config.auto_join_rooms" style="white-space: pre-line;">
{{ $t('room_welcome.info_auto_join',{room: room ? room.name : "",you: $matrix.currentUserDisplayName}) }}
<a href="#" text @click.prevent="viewProfile">
{{ $t("room_welcome.change") }}
</a>
</div>
<div class="mt-2" v-if="roomMessageRetention() > 0">
<i18n path="room_welcome.info_retention_user" tag="span">
<template v-slot:time>
@ -25,6 +31,9 @@ export default {
}
},
methods: {
viewProfile() {
this.$navigation.push({ name: "Profile" }, 1);
},
onMessageRetention(ignoredretention) {
this.updateMessageRetention();
},