mirror of
https://github.com/element-hq/synapse.git
synced 2026-07-28 16:30:04 +00:00
Apply suggestions from code review
Co-authored-by: Olivier 'reivilibre' <olivier@librepush.net>
This commit is contained in:
co-authored by
Olivier 'reivilibre'
parent
edc8624a64
commit
f31d9fb983
@@ -585,7 +585,7 @@ impl EventInternalMetadata {
|
||||
}
|
||||
|
||||
/// For membership events, this will contain a list of users who
|
||||
/// would be interested in the users profile updates, triggered
|
||||
/// would be interested in the user's profile updates, triggered
|
||||
/// by the membership change.
|
||||
pub fn membership_update_users_in_shared_rooms(&self) -> PyResult<Option<Vec<String>>> {
|
||||
Ok(self
|
||||
|
||||
@@ -271,13 +271,13 @@ class ProfileHandler:
|
||||
target_user: the user whose displayname is to be changed.
|
||||
requester: The user attempting to make this change.
|
||||
new_displayname: The displayname to give this user.
|
||||
profile_update_target_user_ids: User id's to trigger profile updates stream
|
||||
profile_update_target_user_ids: User IDs to trigger profile updates stream
|
||||
updates for.
|
||||
by_admin: Whether this change was made by an administrator.
|
||||
propagate: Whether this change also applies to the user's membership events.
|
||||
|
||||
Returns:
|
||||
Stream ID of the profile updates stream that was just inserted.
|
||||
Stream ID of the profile updates stream row that was just inserted.
|
||||
"""
|
||||
if not self.hs.is_mine(target_user):
|
||||
raise SynapseError(400, "User is not hosted on this homeserver")
|
||||
@@ -397,13 +397,13 @@ class ProfileHandler:
|
||||
target_user: the user whose avatar URL is to be changed.
|
||||
requester: The user attempting to make this change.
|
||||
new_avatar_url: The avatar URL to give this user.
|
||||
profile_update_target_user_ids: User ID's to trigger profile update stream
|
||||
profile_update_target_user_ids: User IDs to trigger profile update stream
|
||||
updates for.
|
||||
by_admin: Whether this change was made by an administrator.
|
||||
propagate: Whether this change also applies to the user's membership events.
|
||||
|
||||
Returns:
|
||||
Stream ID of the profile updates stream that was just inserted.
|
||||
Stream ID of the profile updates stream row that was just inserted.
|
||||
"""
|
||||
if not self.hs.is_mine(target_user):
|
||||
raise SynapseError(400, "User is not hosted on this homeserver")
|
||||
@@ -475,7 +475,7 @@ class ProfileHandler:
|
||||
if we're an events stream writer.
|
||||
|
||||
Args:
|
||||
target_user: User ID who'se profile is being deactivated.
|
||||
target_user: User ID whose profile is being deactivated.
|
||||
requester: The requesting user.
|
||||
by_admin: Whether the action is being done by an admin.
|
||||
"""
|
||||
@@ -552,7 +552,7 @@ class ProfileHandler:
|
||||
field_names=profile_updates,
|
||||
target_users=profile_update_targets["users"],
|
||||
)
|
||||
if stream_id and profile_update_targets["rooms"]:
|
||||
if stream_id is not None and profile_update_targets["rooms"]:
|
||||
self._notifier.on_new_event(
|
||||
StreamKeyType.PROFILE_UPDATES,
|
||||
stream_id,
|
||||
@@ -774,7 +774,7 @@ class ProfileHandler:
|
||||
profile_update_target_user_ids=profile_update_targets["users"],
|
||||
)
|
||||
|
||||
if stream_id and profile_update_targets["rooms"]:
|
||||
if stream_id is not None and profile_update_targets["rooms"]:
|
||||
self._notifier.on_new_event(
|
||||
StreamKeyType.PROFILE_UPDATES,
|
||||
stream_id,
|
||||
|
||||
@@ -273,7 +273,7 @@ class ReplicationDataHandler:
|
||||
# Get all the rooms of the updated users, dict of
|
||||
# User ID -> [Room ID]
|
||||
users_and_rooms = await self.store.get_rooms_for_users(updated_user_ids)
|
||||
# Loop through each users room ID's and add to our set of rooms
|
||||
# Loop through each user's room IDs and add to our set of rooms
|
||||
for user_room_ids in users_and_rooms.values():
|
||||
room_ids.update(user_room_ids)
|
||||
|
||||
|
||||
@@ -778,7 +778,7 @@ class ProfileUpdatesStreamRow:
|
||||
"""
|
||||
field_name: str | None
|
||||
"""The profile field that was updated, see https://spec.matrix.org/unstable/client-server-api/#profiles.
|
||||
This can be None if `action` is not 'update'.
|
||||
This is None if `action` is not 'update'.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user