mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 13:44:57 -04:00
Rejig display names when paginating to lie less.
This commit is contained in:
parent
43e7ad1b1c
commit
1c86ec5b8d
3 changed files with 24 additions and 13 deletions
|
@ -45,12 +45,17 @@ angular.module('modelService', [])
|
|||
addMessageEvent: function addMessageEvent(event, toFront) {
|
||||
// every message must reference the RoomMember which made it *at
|
||||
// that time* so things like display names display correctly.
|
||||
var stateAtTheTime = toFront ? this.old_room_state : this.current_room_state;
|
||||
event.room_member = stateAtTheTime.getStateEvent("m.room.member", event.user_id);
|
||||
if (event.type === "m.room.member" && event.content.membership === "invite") {
|
||||
// give information on both the inviter and invitee
|
||||
event.__target_room_member = stateAtTheTime.getStateEvent("m.room.member", event.state_key);
|
||||
}
|
||||
|
||||
if (toFront) {
|
||||
event.room_member = this.old_room_state.getStateEvent("m.room.member", event.user_id);
|
||||
this.events.unshift(event);
|
||||
}
|
||||
else {
|
||||
event.room_member = this.current_room_state.getStateEvent("m.room.member", event.user_id);
|
||||
this.events.push(event);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue