Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
spb committed May 27, 2024
1 parent e85f172 commit 6be3735
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions sable_network/src/network/network/channel_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,7 @@ impl Network {
self.remove_channel(removed_membership.channel, updates);
}

if let (Some(channel), Some(user)) = (
self.channels.get(&target.channel()),
self.users.get(&target.user()),
) {
if let Some(user) = self.users.get(&target.user()) {
let update = update::ChannelPart {
membership: removed_membership,
user: self.translate_historic_user_id(&user),
Expand Down Expand Up @@ -379,10 +376,7 @@ impl Network {
let invite = state::ChannelInvite::new(target, details.source, event.timestamp);
self.channel_invites.insert(invite.id, invite.clone());

if let (Some(channel), Some(user)) = (
self.channels.get(&target.channel()),
self.users.get(&target.user()),
) {
if let Some(user) = self.users.get(&target.user()) {
let update = update::ChannelInvite {
invite: target,
source: self.translate_state_change_source(details.source.into()),
Expand Down
4 changes: 2 additions & 2 deletions sable_network/src/network/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl Network {
Ok(())
}

/// Translate an object ID into a [`state::HistoricMessageSource`]
/// Translate an object ID into a [`state::HistoricMessageSourceId`]
pub(crate) fn translate_state_change_source(
&self,
id: ObjectId,
Expand All @@ -243,7 +243,7 @@ impl Network {
HistoricUserId::new(user.id, user.serial)
}

/// Translate an [`ObjectId`] into a [`state::HistoricMessageTarget`] for storage in history log
/// Translate an [`ObjectId`] into a [`state::HistoricMessageTargetId`] for storage in history log
pub(crate) fn translate_message_target(&self, id: ObjectId) -> state::HistoricMessageTargetId {
match id {
ObjectId::User(user_id) => self.users.get(&user_id).map(|user| {
Expand Down

0 comments on commit 6be3735

Please sign in to comment.