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

version 0.8.49.dev - block/unblock users in profile, ask question and faq link in Settings, Windows 8/8.1/10 toast notifications

This commit is contained in:
John Preston
2015-08-12 21:01:32 +03:00
parent cf9737e762
commit 8511181508
31 changed files with 685 additions and 417 deletions

View File

@@ -167,9 +167,15 @@ struct BotInfo {
QString startToken, startGroupToken;
};
enum UserBlockedStatus {
UserBlockUnknown = 0,
UserIsBlocked,
UserIsNotBlocked,
};
struct PhotoData;
struct UserData : public PeerData {
UserData(const PeerId &id) : PeerData(id), access(0), 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), blocked(UserBlockUnknown), photosCount(-1), botInfo(0) {
}
void setPhoto(const MTPUserProfilePhoto &photo);
void setName(const QString &first, const QString &last, const QString &phoneName, const QString &username);
@@ -192,6 +198,7 @@ struct UserData : public PeerData {
TextLinkPtr lnk;
int32 onlineTill;
int32 contact; // -1 - not contact, cant add (self, empty, deleted, foreign), 0 - not contact, can add (request), 1 - contact
UserBlockedStatus blocked;
typedef QList<PhotoData*> Photos;
Photos photos;
@@ -230,8 +237,8 @@ inline int32 newMessageFlags(PeerData *p) {
typedef QMap<char, QPixmap> PreparedPhotoThumbs;
struct PhotoData {
PhotoData(const PhotoId &id, const uint64 &access = 0, int32 user = 0, int32 date = 0, const ImagePtr &thumb = ImagePtr(), const ImagePtr &medium = ImagePtr(), const ImagePtr &full = ImagePtr()) :
id(id), access(access), user(user), date(date), thumb(thumb), medium(medium), full(full), chat(0) {
PhotoData(const PhotoId &id, const uint64 &access = 0, int32 date = 0, const ImagePtr &thumb = ImagePtr(), const ImagePtr &medium = ImagePtr(), const ImagePtr &full = ImagePtr()) :
id(id), access(access), date(date), thumb(thumb), medium(medium), full(full), chat(0) {
}
void forget() {
thumb->forget();
@@ -254,7 +261,6 @@ struct PhotoData {
}
PhotoId id;
uint64 access;
int32 user;
int32 date;
ImagePtr thumb, replyPreview;
ImagePtr medium;
@@ -294,7 +300,7 @@ enum FileStatus {
};
struct VideoData {
VideoData(const VideoId &id, const uint64 &access = 0, int32 user = 0, int32 date = 0, int32 duration = 0, int32 w = 0, int32 h = 0, const ImagePtr &thumb = ImagePtr(), int32 dc = 0, int32 size = 0);
VideoData(const VideoId &id, const uint64 &access = 0, int32 date = 0, int32 duration = 0, int32 w = 0, int32 h = 0, const ImagePtr &thumb = ImagePtr(), int32 dc = 0, int32 size = 0);
void forget() {
thumb->forget();
@@ -330,7 +336,6 @@ struct VideoData {
VideoId id;
uint64 access;
int32 user;
int32 date;
int32 duration;
int32 w, h;
@@ -390,7 +395,7 @@ public:
};
struct AudioData {
AudioData(const AudioId &id, const uint64 &access = 0, int32 user = 0, int32 date = 0, const QString &mime = QString(), int32 duration = 0, int32 dc = 0, int32 size = 0);
AudioData(const AudioId &id, const uint64 &access = 0, int32 date = 0, const QString &mime = QString(), int32 duration = 0, int32 dc = 0, int32 size = 0);
void forget() {
}
@@ -425,7 +430,6 @@ struct AudioData {
AudioId id;
uint64 access;
int32 user;
int32 date;
QString mime;
int32 duration;