You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
Fix incorrect prevEv being sent in ClientEvent.AccountData events (#2794)
This commit is contained in:
committed by
GitHub
parent
ade2e81d3d
commit
9bdeea0a8d
@@ -208,7 +208,7 @@ class ExtensionAccountData implements Extension {
|
||||
private processGlobalAccountData(globalAccountData: object[]): void {
|
||||
const events = mapEvents(this.client, undefined, globalAccountData);
|
||||
const prevEventsMap = events.reduce((m, c) => {
|
||||
m[c.getId()] = this.client.store.getAccountData(c.getType());
|
||||
m[c.getType()] = this.client.store.getAccountData(c.getType());
|
||||
return m;
|
||||
}, {});
|
||||
this.client.store.storeAccountDataEvents(events);
|
||||
@@ -222,7 +222,7 @@ class ExtensionAccountData implements Extension {
|
||||
const rules = accountDataEvent.getContent<IPushRules>();
|
||||
this.client.pushRules = PushProcessor.rewriteDefaultRules(rules);
|
||||
}
|
||||
const prevEvent = prevEventsMap[accountDataEvent.getId()];
|
||||
const prevEvent = prevEventsMap[accountDataEvent.getType()];
|
||||
this.client.emit(ClientEvent.AccountData, accountDataEvent, prevEvent);
|
||||
return accountDataEvent;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user