Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Rename various ApplicationServices interested methods #11915

Merged
merged 10 commits into from
Mar 3, 2022

Commits on Mar 3, 2022

  1. Rename various ApplicationServices interested methods

    ...to better reflect what they actually do.
    
    * ApplicationServices.is_interested -> is_interested_in_event
    * ApplicationService.is_interested_in_user -> is_user_in_namespace
    * ApplicationService.is_interested_in_alias -> is_room_alias_in_namespace
    * ApplicationService.is_interested_in_room_id -> is_room_id_in_namespace
    
    This leaves us with only an is_interested_in_event method. Next commit
    we'll fill in the gaps for checking interest of rooms and users.
    anoadragon453 committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    aaa402e View commit details
    Browse the repository at this point in the history
  2. Add 'is_interested_in_user' and 'is_interested_in_room'

    ...that make use of the simpler helper methods we just renamed.
    
    This commit adds the equivalent methods of is_interested_in_event for
    both users and rooms. These implementations include more comprehensive
    checks then the older methods with the same names.
    anoadragon453 committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    fe17863 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a493a16 View commit details
    Browse the repository at this point in the history
  4. Remove _matches_user

    This function was no longer used.
    anoadragon453 committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    4866227 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bcae63e View commit details
    Browse the repository at this point in the history
  6. Add caching to ApplicationService.is_interested_in_event

    Which will be invalidated when RoomMemberWorkerStore.get_users_in_room
    is.
    
    is_interested_in_room already has caching, and is_interested_in_user
    does not arguably need it (as the check is so cheap and regex
    comparisons are cached anyways).
    anoadragon453 committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    381b560 View commit details
    Browse the repository at this point in the history
  7. Make matches_user_in_member_list method private; update refs

    References to this method wanted to check if an AS should receive events
    from a room. They were only checking to see if the AS had a user in the
    room, whereas the AS should also see those events if it has registered
    the room's ID or one of its aliases in the AS' relevant namespace.
    anoadragon453 committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    bf00539 View commit details
    Browse the repository at this point in the history
  8. Changelog

    anoadragon453 committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    27ffd6d View commit details
    Browse the repository at this point in the history
  9. Type hints and docstring for _mkservice, _mkservice_alias

    This commit also returns _mkservice to only modifying whether an AS is
    interested in an event (and shifts other interest modifications back to
    specific test methods).
    
    Modifying _mkservice to enable further interest wasn't necessary for these
    tests to pass.
    anoadragon453 committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    eb779e0 View commit details
    Browse the repository at this point in the history
  10. Add an event ID arg to is_interested_in_event to cache with

    Caching using an EventBase is not quite sufficient while we have no defined way of
    checking whether two instances are equal other than if they are the equivalent object.
    
    Instead, we use the event ID here for now, which should be good enough in this case.
    anoadragon453 committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    453fdac View commit details
    Browse the repository at this point in the history