Skip to content

Lightweight native Discord client for Windows, Linux and macOS, written in Rust. No Electron, no browser engine.

Drop Store::remove_channel, unused since leaving group DMs went through remove_channel_by_id

VRonGitHub255a69fcf4fc
diff --git a/apps/rustcord/src/store.rs b/apps/rustcord/src/store.rs
index b8c0759..32f307e 100644
--- a/apps/rustcord/src/store.rs
+++ b/apps/rustcord/src/store.rs
@@ -665,11 +665,6 @@ impl Store {
}
}
- pub fn remove_channel(&mut self, v: &Value) {
- let Some(id) = Id::from_value(&v["id"]) else { return };
- self.remove_channel_by_id(id);
- }
-
/// Drop a channel and its cached per-channel state (messages, read state,
/// DM pin, typing, voice roster) from the local store.
pub fn remove_channel_by_id(&mut self, id: Id) {
@@ -1954,7 +1949,7 @@ mod tests {
// Leaving a thread, or its deletion, takes it off the list.
store.me = Some(User { id: Id(7), ..Default::default() });
store.thread_members_update(&json!({ "id": "21", "guild_id": "500", "removed_member_ids": ["7"] }));
- store.remove_channel(&json!({ "id": "23" }));
+ store.remove_channel_by_id(Id(23));
assert_eq!(rows(&store, gid), ["general", " older (last)", "help"]);
store.thread_list_sync(&json!({ "guild_id": "500", "threads": [{ "id": "24", "type": 11, "name": "synced", "parent_id": "12" }], "members": [{ "id": "24", "user_id": "7" }] }));
assert_eq!(rows(&store, gid), ["general", " older (last)", "help", " synced (last)"]);
@@ -2110,7 +2105,7 @@ mod tests {
assert!(!store.voice.contains_key(&group));
// Idempotent if CHANNEL_DELETE arrives after local removal.
- store.remove_channel(&json!({ "id": "31", "type": 3 }));
+ store.remove_channel_by_id(Id(31));
assert_eq!(store.dm_list(), [Id(30)]);
}
}