diff --git a/src/channel/channel.cairo b/src/channel/channel.cairo index b3dddf0..cd084ef 100644 --- a/src/channel/channel.cairo +++ b/src/channel/channel.cairo @@ -371,6 +371,12 @@ pub mod ChannelComponent { self.channels.read(channel_id).channel_total_members } + ///@notice gets the community id of a channel + /// @param channel_id the id of the channel + /// @return u256 the community id + fn get_channel_community(self: @ComponentState, channel_id: u256) -> u256 { + self.channels.read(channel_id).community_id + } /// @notice checks if a profile is a moderator /// @param profile addresss to be checked /// @param channel_id the id of the channel diff --git a/src/interfaces/IChannel.cairo b/src/interfaces/IChannel.cairo index 817bbf7..d78644d 100644 --- a/src/interfaces/IChannel.cairo +++ b/src/interfaces/IChannel.cairo @@ -27,6 +27,7 @@ pub trait IChannel { fn is_channel_member( self: @TState, profile: ContractAddress, channel_id: u256 ) -> (bool, ChannelMember); + fn get_channel_community(self: @TState, channel_id: u256) -> u256; fn get_total_channel_members(self: @TState, channel_id: u256) -> u256; fn is_channel_mod(self: @TState, profile: ContractAddress, channel_id: u256) -> bool; fn get_channel_censorship_status(self: @TState, channel_id: u256) -> bool;