mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-06 11:14:09 -04:00
Make StateHandler._state_cache only store event_ids.
This commit is contained in:
parent
d787e41b20
commit
99f929f36b
2 changed files with 42 additions and 7 deletions
|
@ -151,6 +151,31 @@ class EventsStore(SQLBaseStore):
|
|||
|
||||
defer.returnValue(events[0] if events else None)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def get_events(self, event_ids, check_redacted=True,
|
||||
get_prev_content=False, allow_rejected=False):
|
||||
"""Get events from the database
|
||||
|
||||
Args:
|
||||
event_ids (list): The event_ids of the events to fetch
|
||||
check_redacted (bool): If True, check if event has been redacted
|
||||
and redact it.
|
||||
get_prev_content (bool): If True and event is a state event,
|
||||
include the previous states content in the unsigned field.
|
||||
allow_rejected (bool): If True return rejected events.
|
||||
|
||||
Returns:
|
||||
Deferred : Dict from event_id to event.
|
||||
"""
|
||||
events = yield self._get_events(
|
||||
event_ids,
|
||||
check_redacted=check_redacted,
|
||||
get_prev_content=get_prev_content,
|
||||
allow_rejected=allow_rejected,
|
||||
)
|
||||
|
||||
defer.returnValue({e.event_id: e for e in events})
|
||||
|
||||
@log_function
|
||||
def _persist_event_txn(self, txn, event, context,
|
||||
is_new_state=True, current_state=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue