mirror of https://github.com/procxx/kepka.git
fixed bug in history size count, 0.9.5
This commit is contained in:
parent
21570c0479
commit
bf6bebb0aa
|
@ -763,7 +763,7 @@ namespace App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
existing->updateMedia(m.has_media() ? (&m.vmedia) : 0);
|
existing->updateMedia(m.has_media() ? (&m.vmedia) : 0, true);
|
||||||
|
|
||||||
existing->setViewsCount(m.has_views() ? m.vviews.v : -1);
|
existing->setViewsCount(m.has_views() ? m.vviews.v : -1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1345,7 +1345,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPMessage &msg, boo
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg.type() == mtpc_message) {
|
if (msg.type() == mtpc_message) {
|
||||||
existing->updateMedia(msg.c_message().has_media() ? (&msg.c_message().vmedia) : 0);
|
existing->updateMedia(msg.c_message().has_media() ? (&msg.c_message().vmedia) : 0, (block ? false : true));
|
||||||
}
|
}
|
||||||
return (returnExisting || regged) ? existing : 0;
|
return (returnExisting || regged) ? existing : 0;
|
||||||
}
|
}
|
||||||
|
@ -6259,7 +6259,7 @@ HistoryMedia *HistoryMessage::getMedia(bool inOverview) const {
|
||||||
return _media;
|
return _media;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryMessage::setMedia(const MTPMessageMedia *media) {
|
void HistoryMessage::setMedia(const MTPMessageMedia *media, bool allowEmitResize) {
|
||||||
if ((!_media || _media->isImageLink()) && (!media || media->type() == mtpc_messageMediaEmpty)) return;
|
if ((!_media || _media->isImageLink()) && (!media || media->type() == mtpc_messageMediaEmpty)) return;
|
||||||
|
|
||||||
bool mediaWasDisplayed = false;
|
bool mediaWasDisplayed = false;
|
||||||
|
@ -6280,7 +6280,7 @@ void HistoryMessage::setMedia(const MTPMessageMedia *media) {
|
||||||
_textHeight = 0;
|
_textHeight = 0;
|
||||||
}
|
}
|
||||||
initDimensions();
|
initDimensions();
|
||||||
if (App::main()) App::main()->itemResized(this);
|
if (allowEmitResize && App::main()) App::main()->itemResized(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryMessage::setText(const QString &text, const LinksInText &links) {
|
void HistoryMessage::setText(const QString &text, const LinksInText &links) {
|
||||||
|
|
|
@ -880,7 +880,7 @@ public:
|
||||||
virtual bool serviceMsg() const {
|
virtual bool serviceMsg() const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
virtual void updateMedia(const MTPMessageMedia *media) {
|
virtual void updateMedia(const MTPMessageMedia *media, bool allowEmitResize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual QString selectedText(uint32 selection) const {
|
virtual QString selectedText(uint32 selection) const {
|
||||||
|
@ -930,8 +930,6 @@ public:
|
||||||
virtual HistoryMedia *getMedia(bool inOverview = false) const {
|
virtual HistoryMedia *getMedia(bool inOverview = false) const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
virtual void setMedia(const MTPMessageMedia *media) {
|
|
||||||
}
|
|
||||||
virtual void setText(const QString &text, const LinksInText &links) {
|
virtual void setText(const QString &text, const LinksInText &links) {
|
||||||
}
|
}
|
||||||
virtual void getTextWithLinks(QString &text, LinksInText &links) {
|
virtual void getTextWithLinks(QString &text, LinksInText &links) {
|
||||||
|
@ -1541,11 +1539,11 @@ public:
|
||||||
QString notificationHeader() const;
|
QString notificationHeader() const;
|
||||||
QString notificationText() const;
|
QString notificationText() const;
|
||||||
|
|
||||||
void updateMedia(const MTPMessageMedia *media) {
|
void updateMedia(const MTPMessageMedia *media, bool allowEmitResize) {
|
||||||
if (media && _media && _media->type() != MediaTypeWebPage) {
|
if (media && _media && _media->type() != MediaTypeWebPage) {
|
||||||
_media->updateFrom(*media);
|
_media->updateFrom(*media);
|
||||||
} else {
|
} else {
|
||||||
setMedia(media);
|
setMedia(media, allowEmitResize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1553,7 +1551,7 @@ public:
|
||||||
LinksInText textLinks() const;
|
LinksInText textLinks() const;
|
||||||
QString inDialogsText() const;
|
QString inDialogsText() const;
|
||||||
HistoryMedia *getMedia(bool inOverview = false) const;
|
HistoryMedia *getMedia(bool inOverview = false) const;
|
||||||
void setMedia(const MTPMessageMedia *media);
|
void setMedia(const MTPMessageMedia *media, bool allowEmitResize);
|
||||||
void setText(const QString &text, const LinksInText &links);
|
void setText(const QString &text, const LinksInText &links);
|
||||||
void getTextWithLinks(QString &text, LinksInText &links);
|
void getTextWithLinks(QString &text, LinksInText &links);
|
||||||
bool textHasLinks();
|
bool textHasLinks();
|
||||||
|
|
|
@ -4169,7 +4169,7 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
item->updateMedia(d.has_media() ? (&d.vmedia) : 0);
|
item->updateMedia(d.has_media() ? (&d.vmedia) : 0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue