Allow downloading my own stories.
This commit is contained in:
parent
2bc7f465c2
commit
2212b55b13
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "base/timer.h"
|
#include "base/timer.h"
|
||||||
#include "base/power_save_blocker.h"
|
#include "base/power_save_blocker.h"
|
||||||
#include "data/data_stories.h"
|
#include "data/data_stories.h"
|
||||||
|
#include "data/data_user.h"
|
||||||
#include "media/stories/media_stories_delegate.h"
|
#include "media/stories/media_stories_delegate.h"
|
||||||
#include "media/stories/media_stories_header.h"
|
#include "media/stories/media_stories_header.h"
|
||||||
#include "media/stories/media_stories_sibling.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) {
|
void Controller::repaintSibling(not_null<Sibling*> sibling) {
|
||||||
if (sibling == _siblingLeft.get() || sibling == _siblingRight.get()) {
|
if (sibling == _siblingLeft.get() || sibling == _siblingRight.get()) {
|
||||||
_delegate->storiesRepaint();
|
_delegate->storiesRepaint();
|
||||||
|
|
|
@ -86,6 +86,8 @@ public:
|
||||||
[[nodiscard]] bool paused() const;
|
[[nodiscard]] bool paused() const;
|
||||||
void togglePaused(bool paused);
|
void togglePaused(bool paused);
|
||||||
|
|
||||||
|
[[nodiscard]] bool canDownload() const;
|
||||||
|
|
||||||
void repaintSibling(not_null<Sibling*> sibling);
|
void repaintSibling(not_null<Sibling*> sibling);
|
||||||
[[nodiscard]] SiblingView siblingLeft() const;
|
[[nodiscard]] SiblingView siblingLeft() const;
|
||||||
[[nodiscard]] SiblingView siblingRight() const;
|
[[nodiscard]] SiblingView siblingRight() const;
|
||||||
|
|
|
@ -32,6 +32,10 @@ void View::ready() {
|
||||||
_controller->ready();
|
_controller->ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool View::canDownload() const {
|
||||||
|
return _controller->canDownload();
|
||||||
|
}
|
||||||
|
|
||||||
QRect View::contentGeometry() const {
|
QRect View::contentGeometry() const {
|
||||||
return _controller->layout().content;
|
return _controller->layout().content;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
int subindex);
|
int subindex);
|
||||||
void ready();
|
void ready();
|
||||||
|
|
||||||
|
[[nodiscard]] bool canDownload() const;
|
||||||
[[nodiscard]] QRect contentGeometry() const;
|
[[nodiscard]] QRect contentGeometry() const;
|
||||||
[[nodiscard]] rpl::producer<QRect> contentGeometryValue() const;
|
[[nodiscard]] rpl::producer<QRect> contentGeometryValue() const;
|
||||||
[[nodiscard]] SiblingView siblingLeft() const;
|
[[nodiscard]] SiblingView siblingLeft() const;
|
||||||
|
|
|
@ -1044,7 +1044,8 @@ void OverlayWidget::refreshNavVisibility() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OverlayWidget::contentCanBeSaved() const {
|
bool OverlayWidget::contentCanBeSaved() const {
|
||||||
if (_stories || hasCopyMediaRestriction()) {
|
if ((_stories && !_stories->canDownload())
|
||||||
|
|| hasCopyMediaRestriction()) {
|
||||||
return false;
|
return false;
|
||||||
} else if (_photo) {
|
} else if (_photo) {
|
||||||
return _photo->hasVideo() || _photoMedia->loaded();
|
return _photo->hasVideo() || _photoMedia->loaded();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user