fix(sync): correctly update presence properties

This commit is contained in:
Jakub Kubík 2023-12-20 13:34:45 +01:00
parent 5314221e89
commit aaf746ffdd
No known key found for this signature in database
GPG key ID: 5E67F25531ADB523

View file

@ -594,17 +594,15 @@ async fn process_room_presence_updates(
// Update existing presence event with more info // Update existing presence event with more info
curr_content.presence = new_content.presence; curr_content.presence = new_content.presence;
curr_content.status_msg = curr_content.status_msg = new_content.status_msg.or(curr_content.status_msg.take());
curr_content.status_msg.clone().or(new_content.status_msg);
curr_content.last_active_ago = curr_content.last_active_ago =
curr_content.last_active_ago.or(new_content.last_active_ago); new_content.last_active_ago.or(curr_content.last_active_ago);
curr_content.displayname = curr_content.displayname =
curr_content.displayname.clone().or(new_content.displayname); new_content.displayname.or(curr_content.displayname.take());
curr_content.avatar_url = curr_content.avatar_url = new_content.avatar_url.or(curr_content.avatar_url.take());
curr_content.avatar_url.clone().or(new_content.avatar_url); curr_content.currently_active = new_content
curr_content.currently_active = curr_content
.currently_active .currently_active
.or(new_content.currently_active); .or(curr_content.currently_active);
} }
} }
} }