Skip to content

Commit

Permalink
Merge pull request #129 from PavitraAgarwal21/main
Browse files Browse the repository at this point in the history
feat : add get channel's community id
  • Loading branch information
Darlington02 authored Oct 24, 2024
2 parents 12ee6ff + 0c380d8 commit 08e635a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/channel/channel.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -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<TContractState>, 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
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/IChannel.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub trait IChannel<TState> {
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;
Expand Down

0 comments on commit 08e635a

Please sign in to comment.