mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Update API scheme on layer 140.
This commit is contained in:
@@ -14,7 +14,7 @@ enum class ChatAdminRight;
|
||||
|
||||
enum class ChatDataFlag {
|
||||
Left = (1 << 0),
|
||||
Kicked = (1 << 1),
|
||||
//Kicked = (1 << 1),
|
||||
Creator = (1 << 2),
|
||||
Deactivated = (1 << 3),
|
||||
Forbidden = (1 << 4),
|
||||
@@ -80,17 +80,11 @@ public:
|
||||
return flags() & Flag::Forbidden;
|
||||
}
|
||||
[[nodiscard]] bool amIn() const {
|
||||
return !isForbidden()
|
||||
&& !isDeactivated()
|
||||
&& !haveLeft()
|
||||
&& !wasKicked();
|
||||
return !isForbidden() && !isDeactivated() && !haveLeft();
|
||||
}
|
||||
[[nodiscard]] bool haveLeft() const {
|
||||
return flags() & ChatDataFlag::Left;
|
||||
}
|
||||
[[nodiscard]] bool wasKicked() const {
|
||||
return flags() & ChatDataFlag::Kicked;
|
||||
}
|
||||
[[nodiscard]] bool amCreator() const {
|
||||
return flags() & ChatDataFlag::Creator;
|
||||
}
|
||||
|
@@ -179,8 +179,7 @@ rpl::producer<bool> CanWriteValue(ChatData *chat) {
|
||||
| ChatDataFlag::Deactivated
|
||||
| ChatDataFlag::Forbidden
|
||||
| ChatDataFlag::Left
|
||||
| ChatDataFlag::Creator
|
||||
| ChatDataFlag::Kicked;
|
||||
| ChatDataFlag::Creator;
|
||||
return rpl::combine(
|
||||
PeerFlagsValue(chat, mask),
|
||||
AdminRightsValue(chat),
|
||||
@@ -194,8 +193,7 @@ rpl::producer<bool> CanWriteValue(ChatData *chat) {
|
||||
const auto amOutFlags = 0
|
||||
| ChatDataFlag::Deactivated
|
||||
| ChatDataFlag::Forbidden
|
||||
| ChatDataFlag::Left
|
||||
| ChatDataFlag::Kicked;
|
||||
| ChatDataFlag::Left;
|
||||
return !(flags & amOutFlags)
|
||||
&& ((flags & ChatDataFlag::Creator)
|
||||
|| (adminRights.value != ChatAdminRights(0))
|
||||
@@ -262,8 +260,7 @@ rpl::producer<bool> CanPinMessagesValue(not_null<PeerData*> peer) {
|
||||
| ChatDataFlag::Deactivated
|
||||
| ChatDataFlag::Forbidden
|
||||
| ChatDataFlag::Left
|
||||
| ChatDataFlag::Creator
|
||||
| ChatDataFlag::Kicked;
|
||||
| ChatDataFlag::Creator;
|
||||
return rpl::combine(
|
||||
PeerFlagsValue(chat, mask),
|
||||
AdminRightValue(chat, ChatAdminRight::PinMessages),
|
||||
@@ -275,8 +272,7 @@ rpl::producer<bool> CanPinMessagesValue(not_null<PeerData*> peer) {
|
||||
const auto amOutFlags = 0
|
||||
| ChatDataFlag::Deactivated
|
||||
| ChatDataFlag::Forbidden
|
||||
| ChatDataFlag::Left
|
||||
| ChatDataFlag::Kicked;
|
||||
| ChatDataFlag::Left;
|
||||
return !(flags & amOutFlags)
|
||||
&& ((flags & ChatDataFlag::Creator)
|
||||
|| adminRightAllows
|
||||
|
@@ -637,7 +637,6 @@ not_null<PeerData*> Session::processChat(const MTPChat &data) {
|
||||
|
||||
using Flag = ChatDataFlag;
|
||||
const auto flagsMask = Flag::Left
|
||||
| Flag::Kicked
|
||||
| Flag::Creator
|
||||
| Flag::Deactivated
|
||||
| Flag::Forbidden
|
||||
@@ -645,7 +644,6 @@ not_null<PeerData*> Session::processChat(const MTPChat &data) {
|
||||
| Flag::CallNotEmpty
|
||||
| Flag::NoForwards;
|
||||
const auto flagsSet = (data.is_left() ? Flag::Left : Flag())
|
||||
| (data.is_kicked() ? Flag::Kicked : Flag())
|
||||
| (data.is_creator() ? Flag::Creator : Flag())
|
||||
| (data.is_deactivated() ? Flag::Deactivated : Flag())
|
||||
| (data.is_call_active() ? Flag::CallActive : Flag())
|
||||
|
@@ -680,8 +680,6 @@ public:
|
||||
uint64 wallpapersHash() const;
|
||||
|
||||
struct WebViewResultSent {
|
||||
PeerId peerId = 0;
|
||||
UserId botId = 0;
|
||||
uint64 queryId = 0;
|
||||
};
|
||||
void webViewResultSent(WebViewResultSent &&sent);
|
||||
|
@@ -21,6 +21,9 @@ struct BotInfo {
|
||||
std::vector<BotCommand> commands;
|
||||
Ui::Text::String text = { int(st::msgMinWidth) }; // description
|
||||
|
||||
QString botMenuButtonText;
|
||||
QString botMenuButtonUrl;
|
||||
|
||||
QString startToken;
|
||||
Dialogs::EntryState inlineReturnTo;
|
||||
|
||||
|
Reference in New Issue
Block a user