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

version 0.8.47.dev - search in conversation, clear history, delete conversation, saving cleared conversations locally, removed contacts from left column

This commit is contained in:
John Preston
2015-08-07 15:11:50 +03:00
parent 61729119c5
commit 5dd8eab606
29 changed files with 492 additions and 141 deletions

View File

@@ -59,8 +59,10 @@ style::color peerColor(int32 index);
ImagePtr userDefPhoto(int32 index);
ImagePtr chatDefPhoto(int32 index);
struct ChatData;
static const PhotoId UnknownPeerPhotoId = 0xFFFFFFFFFFFFFFFFULL;
struct UserData;
struct ChatData;
struct PeerData {
PeerData(const PeerId &id);
virtual ~PeerData() {
@@ -94,13 +96,13 @@ struct PeerData {
bool loaded;
bool chat;
uint64 access;
MTPinputPeer input;
MTPinputUser inputUser;
int32 colorIndex;
style::color color;
ImagePtr photo;
PhotoId photoId;
StorageImageLocation photoLoc;
int32 nameVersion;
@@ -165,11 +167,9 @@ struct BotInfo {
QString startToken, startGroupToken;
};
static const PhotoId UnknownPeerPhotoId = 0xFFFFFFFFFFFFFFFFULL;
struct PhotoData;
struct UserData : public PeerData {
UserData(const PeerId &id) : PeerData(id), photoId(UnknownPeerPhotoId), lnk(new PeerLink(this)), onlineTill(0), contact(-1), photosCount(-1), botInfo(0) {
UserData(const PeerId &id) : PeerData(id), access(0), lnk(new PeerLink(this)), onlineTill(0), contact(-1), photosCount(-1), botInfo(0) {
}
void setPhoto(const MTPUserProfilePhoto &photo);
void setName(const QString &first, const QString &last, const QString &phoneName, const QString &username);
@@ -180,12 +180,15 @@ struct UserData : public PeerData {
void madeAction(); // pseudo-online
uint64 access;
MTPinputUser inputUser;
QString firstName;
QString lastName;
QString username;
QString phone;
Text nameText;
PhotoId photoId;
TextLinkPtr lnk;
int32 onlineTill;
int32 contact; // -1 - not contact, cant add (self, empty, deleted, foreign), 0 - not contact, can add (request), 1 - contact
@@ -198,7 +201,7 @@ struct UserData : public PeerData {
};
struct ChatData : public PeerData {
ChatData(const PeerId &id) : PeerData(id), count(0), date(0), version(0), left(false), forbidden(true), botStatus(0), photoId(UnknownPeerPhotoId) {
ChatData(const PeerId &id) : PeerData(id), count(0), date(0), version(0), left(false), forbidden(true), botStatus(0) {
}
void setPhoto(const MTPChatPhoto &photo, const PhotoId &phId = UnknownPeerPhotoId);
int32 count;
@@ -216,8 +219,7 @@ struct ChatData : public PeerData {
typedef QMap<UserData*, bool> MarkupSenders;
MarkupSenders markupSenders;
int32 botStatus; // -1 - no bots, 0 - unknown, 1 - one bot, that sees all history, 2 - other
ImagePtr photoFull;
PhotoId photoId;
// ImagePtr photoFull;
QString invitationUrl;
// geo
};