Show username and "change" in the welcome header
This commit is contained in:
parent
d7d2bfc566
commit
75ed2167b8
3 changed files with 24 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue