EventIndex: Simplify the json event getting logic.
parent
b4c8a686ce
commit
0b4b9d8d5d
|
@ -172,10 +172,7 @@ export default class EventIndex {
|
||||||
}
|
}
|
||||||
|
|
||||||
const jsonEvent = ev.toJSON();
|
const jsonEvent = ev.toJSON();
|
||||||
|
const e = ev.isEncrypted() ? jsonEvent.decrypted: jsonEvent;
|
||||||
let e;
|
|
||||||
if (ev.isEncrypted()) e = jsonEvent.decrypted;
|
|
||||||
else e = jsonEvent;
|
|
||||||
|
|
||||||
const profile = {
|
const profile = {
|
||||||
displayname: ev.sender.rawDisplayName,
|
displayname: ev.sender.rawDisplayName,
|
||||||
|
@ -311,10 +308,7 @@ export default class EventIndex {
|
||||||
// consume.
|
// consume.
|
||||||
const events = filteredEvents.map((ev) => {
|
const events = filteredEvents.map((ev) => {
|
||||||
const jsonEvent = ev.toJSON();
|
const jsonEvent = ev.toJSON();
|
||||||
|
const e = ev.isEncrypted() ? jsonEvent.decrypted: jsonEvent;
|
||||||
let e;
|
|
||||||
if (ev.isEncrypted()) e = jsonEvent.decrypted;
|
|
||||||
else e = jsonEvent;
|
|
||||||
|
|
||||||
let profile = {};
|
let profile = {};
|
||||||
if (e.sender in profiles) profile = profiles[e.sender];
|
if (e.sender in profiles) profile = profiles[e.sender];
|
||||||
|
|
Loading…
Reference in New Issue