matridge.reactions¶
Classes¶
To avoid fetching history on each matrix reaction event, we store the |
Functions¶
|
Module Contents¶
- class matridge.reactions.ReactionCache(client)[source]¶
To avoid fetching history on each matrix reaction event, we store the “reaction state” per message.
This is because matrix reaction events are atomic, unlike XMPP reactions which contain the full state in each event.
- Parameters:
client (matridge.matrix.Client)
- async _fetch_if_needed(session, target)[source]¶
- Parameters:
session (sqlalchemy.orm.Session)
target (ReactionTarget)
- Return type:
tuple[Message, bool]
- async _fetch(room, event_id)[source]¶
- Parameters:
room (str)
event_id (str)
- Return type:
AsyncIterator[Reaction]
- async add(session, room, msg, sender, emoji, reaction_event)[source]¶
- Parameters:
session (sqlalchemy.orm.Session)
room (str)
msg (str)
sender (str)
emoji (str)
reaction_event (str)
- Return type:
None
- async get(session: sqlalchemy.orm.Session, room: str, msg: str, sender: str, with_event_ids: Literal[False]) set[str] [source]¶
- async get(session: sqlalchemy.orm.Session, room: str, msg: str, sender: str) set[str]
- async get(session: sqlalchemy.orm.Session, room: str, msg: str, sender: str, with_event_ids: Literal[True]) dict[str, str]