2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Support [inputN|n]otifyBroadcasts setting.

This commit is contained in:
John Preston
2018-11-06 15:10:20 +04:00
parent 75db59a8bb
commit 36b702702b
7 changed files with 58 additions and 11 deletions

View File

@@ -1134,15 +1134,24 @@ namespace App {
}
}
void enumerateChatsChannels(
Fn<void(not_null<PeerData*>)> action) {
void enumerateGroups(Fn<void(not_null<PeerData*>)> action) {
for (const auto &[peerId, peer] : peersData) {
if (!peer->isUser()) {
if (peer->isChat() || peer->isMegagroup()) {
action(peer.get());
}
}
}
void enumerateChannels(Fn<void(not_null<ChannelData*>)> action) {
for (const auto &[peerId, peer] : peersData) {
if (const auto channel = peer->asChannel()) {
if (!channel->isMegagroup()) {
action(channel);
}
}
}
}
PeerData *peerByName(const QString &username) {
const auto uname = username.trimmed();
for (const auto &[peerId, peer] : peersData) {