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

megagroups started

This commit is contained in:
John Preston
2015-11-02 17:33:57 -05:00
parent 6d7c55e7cc
commit ede2065c26
23 changed files with 193 additions and 125 deletions

View File

@@ -211,6 +211,7 @@ public:
return (input.type() == mtpc_inputPeerSelf);
}
bool isVerified() const;
bool isMegagroup() const;
UserData *asUser();
const UserData *asUser() const;
ChatData *asChat();
@@ -515,6 +516,9 @@ public:
int32 date;
int32 version;
int32 flags, flagsFull;
bool isMegagroup() const {
return flags & MTPDchannel::flag_megagroup;
}
bool isBroadcast() const {
return flags & MTPDchannel::flag_broadcast;
}
@@ -626,6 +630,9 @@ inline const QString &PeerData::userName() const {
inline bool PeerData::isVerified() const {
return isUser() ? asUser()->isVerified() : (isChannel() ? asChannel()->isVerified() : false);
}
inline bool PeerData::isMegagroup() const {
return isChannel() ? asChannel()->isMegagroup() : false;
}
inline int32 newMessageFlags(PeerData *p) {
return p->isSelf() ? 0 : (((p->isChat() || (p->isUser() && !p->asUser()->botInfo)) ? MTPDmessage::flag_unread : 0) | MTPDmessage::flag_out);