matridge.reactions

Module Contents

Classes

ReactionCache

To avoid fetching history on each matrix reaction event, we store the

class matridge.reactions.ReactionCache(client)[source]

To avoid fetching history on each matrix reaction event, we store the “reaction state” per sender 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(target)[source]
Parameters:

target (ReactionTarget)

async _fetch(room, sender=None, limit=100)[source]
Parameters:
  • room (str)

  • sender (Optional[str])

async add(room, msg, sender, emoji, reaction_event)[source]
Parameters:
Return type:

None

async get(room: str, msg: str, sender: str, with_event_ids: Literal[False]) set[str][source]
async get(room: str, msg: str, sender: str) set[str]
async get(room: str, msg: str, sender: str, with_event_ids: Literal[True]) dict[str, str]
remove(event_id)[source]
Parameters:

event_id (str)

Return type:

Optional[ReactionTarget]