mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Allow downloading my own stories.
This commit is contained in:
parent
2bc7f465c2
commit
2212b55b13
5 changed files with 14 additions and 1 deletions
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "base/timer.h"
|
||||
#include "base/power_save_blocker.h"
|
||||
#include "data/data_stories.h"
|
||||
#include "data/data_user.h"
|
||||
#include "media/stories/media_stories_delegate.h"
|
||||
#include "media/stories/media_stories_header.h"
|
||||
#include "media/stories/media_stories_sibling.h"
|
||||
|
@ -381,6 +382,10 @@ void Controller::togglePaused(bool paused) {
|
|||
}
|
||||
}
|
||||
|
||||
bool Controller::canDownload() const {
|
||||
return _list && _list->user->isSelf();
|
||||
}
|
||||
|
||||
void Controller::repaintSibling(not_null<Sibling*> sibling) {
|
||||
if (sibling == _siblingLeft.get() || sibling == _siblingRight.get()) {
|
||||
_delegate->storiesRepaint();
|
||||
|
|
|
@ -86,6 +86,8 @@ public:
|
|||
[[nodiscard]] bool paused() const;
|
||||
void togglePaused(bool paused);
|
||||
|
||||
[[nodiscard]] bool canDownload() const;
|
||||
|
||||
void repaintSibling(not_null<Sibling*> sibling);
|
||||
[[nodiscard]] SiblingView siblingLeft() const;
|
||||
[[nodiscard]] SiblingView siblingRight() const;
|
||||
|
|
|
@ -32,6 +32,10 @@ void View::ready() {
|
|||
_controller->ready();
|
||||
}
|
||||
|
||||
bool View::canDownload() const {
|
||||
return _controller->canDownload();
|
||||
}
|
||||
|
||||
QRect View::contentGeometry() const {
|
||||
return _controller->layout().content;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
int subindex);
|
||||
void ready();
|
||||
|
||||
[[nodiscard]] bool canDownload() const;
|
||||
[[nodiscard]] QRect contentGeometry() const;
|
||||
[[nodiscard]] rpl::producer<QRect> contentGeometryValue() const;
|
||||
[[nodiscard]] SiblingView siblingLeft() const;
|
||||
|
|
|
@ -1044,7 +1044,8 @@ void OverlayWidget::refreshNavVisibility() {
|
|||
}
|
||||
|
||||
bool OverlayWidget::contentCanBeSaved() const {
|
||||
if (_stories || hasCopyMediaRestriction()) {
|
||||
if ((_stories && !_stories->canDownload())
|
||||
|| hasCopyMediaRestriction()) {
|
||||
return false;
|
||||
} else if (_photo) {
|
||||
return _photo->hasVideo() || _photoMedia->loaded();
|
||||
|
|
Loading…
Add table
Reference in a new issue