mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-24 03:55:09 +01:00
Parse display name and avatar of event
This commit is contained in:
parent
0c42f53a2f
commit
696980aca4
@ -562,9 +562,15 @@ export class BaseRoom extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _getEventFromHomeserver(eventId) {
|
async _getEventFromHomeserver(eventId) {
|
||||||
const response = await this._hsApi.event(this._roomId, eventId).response();
|
const response = await this._hsApi.context(this._roomId, eventId, 0).response();
|
||||||
const entry = new EventEntry({ event: response }, this._fragmentIdComparer);
|
const sender = response.event.sender;
|
||||||
return entry;
|
const member = response.state.find(e => e.type === "m.room.member" && e.user_id === sender);
|
||||||
|
const entry = {
|
||||||
|
event: response.event,
|
||||||
|
displayName: member.content.displayname,
|
||||||
|
avatarUrl: member.content.avatar_url
|
||||||
|
};
|
||||||
|
return new EventEntry(entry, this._fragmentIdComparer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user