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

Start feeds support.

This commit is contained in:
John Preston
2018-01-04 12:40:58 +03:00
parent 46612ef128
commit 724fe65d72
15 changed files with 199 additions and 32 deletions

View File

@@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_peer_values.h"
#include "data/data_channel_admins.h"
#include "data/data_photo.h"
#include "data/data_feed.h"
#include "lang/lang_keys.h"
#include "observer_peer.h"
#include "mainwidget.h"
@@ -849,6 +850,26 @@ void ChannelData::setPinnedMessageId(MsgId messageId) {
}
}
void ChannelData::setFeed(not_null<Data::Feed*> feed) {
setFeedPointer(feed);
}
void ChannelData::clearFeed() {
setFeedPointer(nullptr);
}
void ChannelData::setFeedPointer(Data::Feed *feed) {
if (_feed != feed) {
if (_feed) {
_feed->unregisterOne(this);
}
_feed = feed;
if (_feed) {
_feed->registerOne(this);
}
}
}
bool ChannelData::canBanMembers() const {
return (adminRights() & AdminRight::f_ban_users)
|| amCreator();