mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Update API scheme to layer 148, start forums.
This commit is contained in:
@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/data_chat.h"
|
||||
#include "data/data_session.h"
|
||||
#include "data/data_folder.h"
|
||||
#include "data/data_forum.h"
|
||||
#include "data/data_location.h"
|
||||
#include "data/data_histories.h"
|
||||
#include "data/data_group_call.h"
|
||||
@@ -34,6 +35,10 @@ using UpdateFlag = Data::PeerUpdate::Flag;
|
||||
|
||||
} // namespace
|
||||
|
||||
MegagroupInfo::MegagroupInfo() = default;
|
||||
|
||||
MegagroupInfo::~MegagroupInfo() = default;
|
||||
|
||||
ChatData *MegagroupInfo::getMigrateFromChat() const {
|
||||
return _migratedFrom;
|
||||
}
|
||||
@@ -55,6 +60,20 @@ Data::ChatBotCommands::Changed MegagroupInfo::setBotCommands(
|
||||
return _botCommands.update(list);
|
||||
}
|
||||
|
||||
void MegagroupInfo::setIsForum(bool is) {
|
||||
if (is == (_forum != nullptr)) {
|
||||
return;
|
||||
} else if (is) {
|
||||
_forum = std::make_unique<Data::Forum>();
|
||||
} else {
|
||||
_forum = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Data::Forum *MegagroupInfo::forum() const {
|
||||
return _forum.get();
|
||||
}
|
||||
|
||||
ChannelData::ChannelData(not_null<Data::Session*> owner, PeerId id)
|
||||
: PeerData(owner, id)
|
||||
, inputChannel(
|
||||
@@ -78,6 +97,10 @@ ChannelData::ChannelData(not_null<Data::Session*> owner, PeerId id)
|
||||
mgInfo = nullptr;
|
||||
}
|
||||
}
|
||||
if (change.diff & Flag::Forum) {
|
||||
Assert(mgInfo != nullptr);
|
||||
mgInfo->setIsForum(change.value & Flag::Forum);
|
||||
}
|
||||
if (change.diff & Flag::CallNotEmpty) {
|
||||
if (const auto history = this->owner().historyLoaded(this)) {
|
||||
history->updateChatListEntry();
|
||||
|
Reference in New Issue
Block a user