2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Move discussion group link to three-dot menu.

This commit is contained in:
John Preston
2020-09-03 15:53:54 +04:00
parent 60002555c3
commit d42ce87c09
12 changed files with 95 additions and 208 deletions

View File

@@ -613,6 +613,16 @@ const ChannelData *PeerData::asMegagroup() const {
: nullptr;
}
ChannelData *PeerData::asBroadcast() {
return isBroadcast() ? static_cast<ChannelData*>(this) : nullptr;
}
const ChannelData *PeerData::asBroadcast() const {
return isBroadcast()
? static_cast<const ChannelData*>(this)
: nullptr;
}
ChatData *PeerData::asChatNotMigrated() {
if (const auto chat = asChat()) {
return chat->migrateTo() ? nullptr : chat;
@@ -729,6 +739,10 @@ bool PeerData::isMegagroup() const {
return isChannel() ? asChannel()->isMegagroup() : false;
}
bool PeerData::isBroadcast() const {
return isChannel() ? asChannel()->isBroadcast() : false;
}
bool PeerData::canWrite() const {
if (const auto user = asUser()) {
return user->canWrite();