Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a method to remove the room topic. #4589

Closed
wants to merge 1 commit into from
Closed

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Jan 28, 2025

This PR adds Room::remove_room_topic to allow clients to redact the topic instead of setting it to an empty string. See element-hq/element-meta#2705 for more info.

Closes #4588.

@pixlwave pixlwave requested a review from a team as a code owner January 28, 2025 12:04
@pixlwave pixlwave requested review from bnjbvr and removed request for a team January 28, 2025 12:04
Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.40%. Comparing base (1d3f8bf) to head (40c93b0).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/room/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4589      +/-   ##
==========================================
+ Coverage   85.38%   85.40%   +0.01%     
==========================================
  Files         286      286              
  Lines       32255    32256       +1     
==========================================
+ Hits        27542    27547       +5     
+ Misses       4713     4709       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but a smoke test would make this even better.

@@ -2270,6 +2270,19 @@ impl Room {
self.send_state_event(RoomTopicEventContent::new(topic.into())).await
}

/// Removes the topic from this room if one is set.
pub async fn remove_room_topic(&self) -> Result<()> {
let event = self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a smoke test to check that this calls the correct requests? The MatrixMockServer should make this relatively easy.

Let me know if you need some guidance on how the MatrixMockServer is supposed to be used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nice. Just waiting to hear back if we actually want this method now given element-hq/element-meta#2705 (comment). Will come back and add that test if we do 👍

@poljar poljar removed the request for review from bnjbvr January 28, 2025 12:56
@pixlwave
Copy link
Member Author

It was decided not to use this (at least for now).

element-hq/element-meta#2705 (comment)

@pixlwave pixlwave closed this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task] Add a method to remove the room's topic
2 participants