You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Set the updated .sender and .target props on the event when the event itself updates these props.
This commit is contained in:
@@ -250,8 +250,10 @@ Room.prototype.addEventsToTimeline = function(events, toStartOfTimeline) {
|
|||||||
stateContext.setStateEvents([events[i]]);
|
stateContext.setStateEvents([events[i]]);
|
||||||
// it is possible that the act of setting the state event means we
|
// it is possible that the act of setting the state event means we
|
||||||
// can set more metadata (specifically sender/target props), so try
|
// can set more metadata (specifically sender/target props), so try
|
||||||
// it again if the prop wasn't previously set.
|
// it again if the prop wasn't previously set. It may also mean that
|
||||||
if (!events[i].sender) {
|
// the sender/target is updated (if the event set was a room member event)
|
||||||
|
// so we want to use the *updated* member (new avatar/name) instead.
|
||||||
|
if (!events[i].sender || events[i].getType() === "m.room.member") {
|
||||||
setEventMetadata(events[i], stateContext, toStartOfTimeline);
|
setEventMetadata(events[i], stateContext, toStartOfTimeline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user