mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 08:56:04 -04:00
Show display name changes in the message list.
This commit is contained in:
parent
176e3fd141
commit
b5c9d99424
2 changed files with 30 additions and 8 deletions
|
@ -253,12 +253,30 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
|
|||
// Exception: Do not do this if the event is a room state event because such events already come
|
||||
// as room messages events. Moreover, when they come as room messages events, they are relatively ordered
|
||||
// with other other room messages
|
||||
if (event.content.prev !== event.content.membership && !isStateEvent) {
|
||||
if (isLiveEvent) {
|
||||
$rootScope.events.rooms[event.room_id].messages.push(event);
|
||||
if (!isStateEvent) {
|
||||
// could be a membership change, display name change, etc.
|
||||
// Find out which one.
|
||||
var memberChanges = undefined;
|
||||
if (event.content.prev !== event.content.membership) {
|
||||
memberChanges = "membership";
|
||||
}
|
||||
else {
|
||||
$rootScope.events.rooms[event.room_id].messages.unshift(event);
|
||||
else if (event.prev_content.displayname !==
|
||||
event.content.displayname) {
|
||||
memberChanges = "displayname";
|
||||
}
|
||||
|
||||
// mark the key which changed
|
||||
event.changedKey = memberChanges;
|
||||
|
||||
// If there was a change we want to display, dump it in the message
|
||||
// list.
|
||||
if (memberChanges) {
|
||||
if (isLiveEvent) {
|
||||
$rootScope.events.rooms[event.room_id].messages.push(event);
|
||||
}
|
||||
else {
|
||||
$rootScope.events.rooms[event.room_id].messages.unshift(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue