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

Rearrange the user_directory's _handle_deltas function #11035

Merged
merged 9 commits into from
Oct 13, 2021

Commits on Oct 8, 2021

  1. Pull out _handle_room_membership_event

    David Robertson committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    aa4f0fe View commit details
    Browse the repository at this point in the history
  2. Discard excluded users early

    David Robertson committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    5e99901 View commit details
    Browse the repository at this point in the history
  3. if -> elif number 1

    Suppose `change is MatchChange.no_change`. Then we will return on 332,
    and hit neither the now_true branch nor the `else` branch. Therefore the
    `if` can be turned into an `elif` with no behaviour change.
    David Robertson committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    0391b5c View commit details
    Browse the repository at this point in the history
  4. Group together the now_false cases

    Justification:
    
    - the only way to hit the final else branch is if `change is
      MatchChange.now_false`
    - if `not is_in_room`, then the `state_key` will be
      one of the `user_id in user_ids` and so we'll call
      `self._handle_remove_user` with the `state_key` and return early
    - therefore the call to `_handle_remove_user` in the final else branch
      was only hit if `is_in_room`, and so it can be moved to first `else`
      branch.
    
    Having made this change we now have three mutually exclusive
    cases (now_false, now_true, no_change). Therefore I can change if->elif
    for the no_change branch.
    David Robertson committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    cf0f938 View commit details
    Browse the repository at this point in the history
  5. Remove redundant early returns.

    David Robertson committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    79059f4 View commit details
    Browse the repository at this point in the history
  6. Rename to emphasise remote profile change+comments

    David Robertson committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    cd8ecee View commit details
    Browse the repository at this point in the history
  7. changed -> joined

    David Robertson committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    3303dda View commit details
    Browse the repository at this point in the history
  8. Changelog

    David Robertson committed Oct 8, 2021
    Configuration menu
    Copy the full SHA
    951b042 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2021

  1. Comment -> docstring

    David Robertson committed Oct 13, 2021
    Configuration menu
    Copy the full SHA
    7f1d151 View commit details
    Browse the repository at this point in the history