Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions grammers-client/src/peer/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ impl Channel {
None => None,
}
}

/// Return whether this channel requires join requests.
pub fn requires_join_request(&self) -> bool {
self.raw.join_request
}
}

impl TryFrom<Channel> for ChannelKind {
Expand Down
12 changes: 12 additions & 0 deletions grammers-client/src/peer/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,18 @@ impl Group {
C::Channel(_) | C::ChannelForbidden(_) => true,
}
}

/// Return whether this group requires join requests.
pub fn requires_join_request(&self) -> bool {
use tl::enums::Chat;

match &self.raw {
Chat::Empty(_) | Chat::Chat(_) | Chat::Forbidden(_) | Chat::ChannelForbidden(_) => {
false
}
Chat::Channel(channel) => channel.join_request,
}
}
}

impl From<Group> for PeerInfo {
Expand Down