Updated to TD 1.8.12
This commit is contained in:
commit
e89418482d
32 changed files with 164 additions and 114 deletions
|
|
@ -28,7 +28,7 @@ GOTO:EOF
|
|||
git clone -q --depth 1 --branch master https://github.com/telegramdesktop/dependencies_windows.git %LIB_DIR%
|
||||
cd %LIB_DIR%
|
||||
|
||||
git clone --depth 1 --branch 0.5.0 https://github.com/ericniebler/range-v3
|
||||
git clone --depth 1 --branch 0.9.1 https://github.com/ericniebler/range-v3
|
||||
|
||||
if exist prepare.bat (
|
||||
call prepare.bat
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ GYP_CACHE_VERSION="3"
|
|||
GYP_PATCH="$UPSTREAM/Telegram/Patches/gyp.diff"
|
||||
|
||||
RANGE_PATH="$BUILD/range-v3"
|
||||
RANGE_CACHE_VERSION="4"
|
||||
RANGE_CACHE_VERSION="3"
|
||||
|
||||
VA_PATH="$BUILD/libva"
|
||||
VA_CACHE_VERSION="3"
|
||||
|
|
@ -217,7 +217,7 @@ buildRange() {
|
|||
rm -rf *
|
||||
|
||||
cd "$EXTERNAL"
|
||||
git clone --depth 1 --branch 0.5.0 https://github.com/ericniebler/range-v3
|
||||
git clone --depth 1 --branch 0.9.1 https://github.com/ericniebler/range-v3
|
||||
|
||||
cd "$EXTERNAL/range-v3"
|
||||
cp -r * "$RANGE_PATH/"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<Identity Name="TelegramMessengerLLP.TelegramDesktop"
|
||||
ProcessorArchitecture="ARCHITECTURE"
|
||||
Publisher="CN=536BC709-8EE1-4478-AF22-F0F0F26FF64A"
|
||||
Version="1.8.11.0" />
|
||||
Version="1.8.12.0" />
|
||||
<Properties>
|
||||
<DisplayName>Telegram Desktop</DisplayName>
|
||||
<PublisherDisplayName>Telegram FZ-LLC</PublisherDisplayName>
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void SingleChoiceBox::prepare() {
|
|||
content->add(object_ptr<Ui::FixedHeightWidget>(
|
||||
content,
|
||||
st::boxOptionListPadding.top() + st::autolockButton.margin.top()));
|
||||
auto &&ints = ranges::view::ints(0);
|
||||
auto &&ints = ranges::view::ints(0, ranges::unreachable);
|
||||
for (const auto &[i, text] : ranges::view::zip(ints, _optionTexts)) {
|
||||
content->add(
|
||||
object_ptr<Ui::Radiobutton>(
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ std::vector<Result> EmojiKeywords::LangPack::query(
|
|||
}
|
||||
|
||||
const auto from = _data.emoji.lower_bound(normalized);
|
||||
auto &&chosen = ranges::make_iterator_range(
|
||||
auto &&chosen = ranges::make_subrange(
|
||||
from,
|
||||
end(_data.emoji)
|
||||
) | ranges::view::take_while([&](const auto &pair) {
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ void Row::paintPreview(Painter &p) const {
|
|||
const auto y = st::manageEmojiPreviewPadding.top();
|
||||
const auto width = st::manageEmojiPreviewWidth;
|
||||
const auto height = st::manageEmojiPreviewWidth;
|
||||
auto &&preview = ranges::view::zip(_preview, ranges::view::ints(0));
|
||||
auto &&preview = ranges::view::zip(_preview, ranges::view::ints(0, int(_preview.size())));
|
||||
for (const auto &[pixmap, index] : preview) {
|
||||
const auto row = (index / 2);
|
||||
const auto column = (index % 2);
|
||||
|
|
@ -570,7 +570,7 @@ void Row::setupPreview(const Set &set) {
|
|||
const auto size = st::manageEmojiPreview * cIntRetinaFactor();
|
||||
const auto original = QImage(set.previewPath);
|
||||
const auto full = original.height();
|
||||
auto &&preview = ranges::view::zip(_preview, ranges::view::ints(0));
|
||||
auto &&preview = ranges::view::zip(_preview, ranges::view::ints(0, int(_preview.size())));
|
||||
for (auto &&[pixmap, index] : preview) {
|
||||
pixmap = App::pixmapFromImageInPlace(original.copy(
|
||||
{ full * index, 0, full, full }
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ void UiIntegration::textActionsUpdated() {
|
|||
window->updateGlobalMenu();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UiIntegration::activationFromTopPanel() {
|
||||
Platform::IgnoreApplicationActivationRightNow();
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ std::shared_ptr<ClickHandler> UiIntegration::createLinkHandler(
|
|||
bool UiIntegration::handleUrlClick(
|
||||
const QString &url,
|
||||
const QVariant &context) {
|
||||
auto local = Core::TryConvertUrlToLocal(url);
|
||||
const auto local = Core::TryConvertUrlToLocal(url);
|
||||
if (Core::InternalPassportLink(local)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -123,8 +123,8 @@ bool UiIntegration::handleUrlClick(
|
|||
if (UrlClickHandler::IsEmail(url)) {
|
||||
File::OpenEmailLink(url);
|
||||
return true;
|
||||
} else if (url.startsWith(qstr("tg://"), Qt::CaseInsensitive)) {
|
||||
Core::App().openLocalUrl(url, context);
|
||||
} else if (local.startsWith(qstr("tg://"), Qt::CaseInsensitive)) {
|
||||
Core::App().openLocalUrl(local, context);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#define TDESKTOP_ALPHA_VERSION (0ULL)
|
||||
#endif // TDESKTOP_OFFICIAL_TARGET
|
||||
|
||||
constexpr auto AppVersion = 1008011;
|
||||
constexpr auto AppVersionStr = "1.8.11";
|
||||
constexpr auto AppVersion = 1008012;
|
||||
constexpr auto AppVersionStr = "1.8.12";
|
||||
constexpr auto AppBetaVersion = false;
|
||||
constexpr auto AppAlphaVersion = TDESKTOP_ALPHA_VERSION;
|
||||
constexpr auto AppKotatoVersion = 1000003;
|
||||
|
|
|
|||
|
|
@ -764,7 +764,7 @@ void ApplyMegagroupAdmins(
|
|||
}
|
||||
|
||||
auto adding = base::flat_map<UserId, QString>();
|
||||
auto admins = ranges::make_iterator_range(
|
||||
auto admins = ranges::make_subrange(
|
||||
list.begin(), list.end()
|
||||
) | ranges::view::transform([](const MTPChannelParticipant &p) {
|
||||
const auto userId = p.match([](const auto &data) {
|
||||
|
|
|
|||
|
|
@ -2962,7 +2962,7 @@ void InnerWidget::setupShortcuts() {
|
|||
Command::ChatPinned4,
|
||||
Command::ChatPinned5,
|
||||
};
|
||||
auto &&pinned = ranges::view::zip(kPinned, ranges::view::ints(0));
|
||||
auto &&pinned = ranges::view::zip(kPinned, ranges::view::ints(0, ranges::unreachable));
|
||||
for (const auto [command, index] : pinned) {
|
||||
request->check(command) && request->handle([=, index = index] {
|
||||
const auto list = session().data().chatsList()->indexed();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include <range/v3/algorithm/max_element.hpp>
|
||||
#include <range/v3/view/all.hpp>
|
||||
#include <range/v3/view/transform.hpp>
|
||||
#include <range/v3/to_container.hpp>
|
||||
#include <range/v3/range/conversion.hpp>
|
||||
|
||||
namespace App { // Hackish..
|
||||
QString formatPhone(QString phone);
|
||||
|
|
|
|||
|
|
@ -2444,7 +2444,7 @@ MessageIdsList HistoryInner::getSelectedItems() const {
|
|||
return {};
|
||||
}
|
||||
|
||||
auto result = make_iterator_range(
|
||||
auto result = ranges::make_subrange(
|
||||
_selected.begin(),
|
||||
_selected.end()
|
||||
) | view::filter([](const auto &selected) {
|
||||
|
|
|
|||
|
|
@ -1041,6 +1041,9 @@ void HistoryMessage::applyEdition(const MTPDmessage &message) {
|
|||
// }
|
||||
//}
|
||||
|
||||
const auto copyFlags = MTPDmessage::Flag::f_edit_hide;
|
||||
_flags = (_flags & ~copyFlags) | (message.vflags().v & copyFlags);
|
||||
|
||||
if (const auto editDate = message.vedit_date()) {
|
||||
_flags |= MTPDmessage::Flag::f_edit_date;
|
||||
if (!Has<HistoryMessageEdited>()) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ QSize Photo::countOptimalSize() {
|
|||
if (_serviceWidth > 0) {
|
||||
return { _serviceWidth, _serviceWidth };
|
||||
}
|
||||
const auto minWidth = qMax((!_parent->hasBubble() ? st::minPhotoSize : st::historyPhotoBubbleMinWidth), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
|
||||
const auto minWidth = qMax((_parent->hasBubble() ? st::historyPhotoBubbleMinWidth : st::minPhotoSize), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
|
||||
const auto maxActualWidth = qMax(tw, minWidth);
|
||||
maxWidth = qMax(maxActualWidth, th);
|
||||
minHeight = qMax(th, st::minPhotoSize);
|
||||
|
|
@ -127,7 +127,7 @@ QSize Photo::countCurrentSize(int newWidth) {
|
|||
if (_pixw < 1) _pixw = 1;
|
||||
if (_pixh < 1) _pixh = 1;
|
||||
|
||||
auto minWidth = qMax((!_parent->hasBubble() ? st::minPhotoSize : st::historyPhotoBubbleMinWidth), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
|
||||
|
||||
newWidth = qMax(_pixw, minWidth);
|
||||
auto newHeight = qMax(_pixh, st::minPhotoSize);
|
||||
if (_parent->hasBubble() && !_caption.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ struct PercentCounterItem {
|
|||
int percent = 0;
|
||||
int remainder = 0;
|
||||
|
||||
inline bool operator==(const PercentCounterItem &o) const {
|
||||
return remainder == o.remainder && percent == o.percent;
|
||||
}
|
||||
|
||||
inline bool operator<(const PercentCounterItem &other) const {
|
||||
if (remainder > other.remainder) {
|
||||
return true;
|
||||
|
|
@ -87,7 +91,7 @@ void CountNicePercent(
|
|||
auto &&zipped = ranges::view::zip(
|
||||
votes,
|
||||
items,
|
||||
ranges::view::ints(0));
|
||||
ranges::view::ints(0, int(items.size())));
|
||||
for (auto &&[votes, item, index] : zipped) {
|
||||
item.index = index;
|
||||
item.percent = (votes * 100) / total;
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ auto Reader::Slice::prepareFill(int from, int till) -> PrepareFillResult {
|
|||
ranges::less(),
|
||||
&PartsMap::value_type::first);
|
||||
const auto haveTill = FindNotLoadedStart(
|
||||
ranges::make_iterator_range(start, finish),
|
||||
ranges::make_subrange(start, finish),
|
||||
fromOffset);
|
||||
if (haveTill < till) {
|
||||
result.offsetsFromLoader = offsetsFromLoader(
|
||||
|
|
@ -607,14 +607,14 @@ auto Reader::Slices::fill(int offset, bytes::span buffer) -> FillResult {
|
|||
markSliceUsed(fromSlice);
|
||||
CopyLoaded(
|
||||
buffer,
|
||||
ranges::make_iterator_range(first.start, first.finish),
|
||||
ranges::make_subrange(first.start, first.finish),
|
||||
firstFrom,
|
||||
firstTill);
|
||||
if (fromSlice + 1 < tillSlice) {
|
||||
markSliceUsed(fromSlice + 1);
|
||||
CopyLoaded(
|
||||
buffer.subspan(firstTill - firstFrom),
|
||||
ranges::make_iterator_range(second.start, second.finish),
|
||||
ranges::make_subrange(second.start, second.finish),
|
||||
secondFrom,
|
||||
secondTill);
|
||||
}
|
||||
|
|
@ -644,7 +644,7 @@ auto Reader::Slices::fillFromHeader(int offset, bytes::span buffer)
|
|||
if (prepared.ready) {
|
||||
CopyLoaded(
|
||||
buffer,
|
||||
ranges::make_iterator_range(prepared.start, prepared.finish),
|
||||
ranges::make_subrange(prepared.start, prepared.finish),
|
||||
from,
|
||||
till);
|
||||
result.filled = true;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,11 @@ void ConfigLoader::createSpecialLoader() {
|
|||
const std::string &ip,
|
||||
int port,
|
||||
bytes::const_span secret) {
|
||||
addSpecialEndpoint(dcId, ip, port, secret);
|
||||
if (ip.empty()) {
|
||||
_specialLoader = nullptr;
|
||||
} else {
|
||||
addSpecialEndpoint(dcId, ip, port, secret);
|
||||
}
|
||||
}, _phone);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -374,19 +374,22 @@ SpecialConfigRequest::SpecialConfigRequest(
|
|||
while (!domains.empty()) {
|
||||
_attempts.push_back({ Type::Google, takeDomain(), "dns" });
|
||||
}
|
||||
_attempts.push_back({ Type::Realtime, "firebaseio.com" });
|
||||
_attempts.push_back({ Type::FireStore, "firestore" });
|
||||
for (const auto &domain : DnsDomains()) {
|
||||
_attempts.push_back({ Type::FireStore, domain, "firestore" });
|
||||
if (!_timeDoneCallback) {
|
||||
_attempts.push_back({ Type::Realtime, "firebaseio.com" });
|
||||
_attempts.push_back({ Type::FireStore, "firestore" });
|
||||
for (const auto &domain : DnsDomains()) {
|
||||
_attempts.push_back({ Type::FireStore, domain, "firestore" });
|
||||
}
|
||||
}
|
||||
|
||||
shuffle(0, 2);
|
||||
shuffle(2, 4);
|
||||
shuffle(
|
||||
_attempts.size() - (2 + domainsCount),
|
||||
_attempts.size() - domainsCount);
|
||||
shuffle(_attempts.size() - domainsCount, _attempts.size());
|
||||
|
||||
if (!_timeDoneCallback) {
|
||||
shuffle(
|
||||
_attempts.size() - (2 + domainsCount),
|
||||
_attempts.size() - domainsCount);
|
||||
shuffle(_attempts.size() - domainsCount, _attempts.size());
|
||||
}
|
||||
ranges::reverse(_attempts); // We go from last to first.
|
||||
|
||||
sendNextRequest();
|
||||
|
|
@ -666,20 +669,27 @@ void SpecialConfigRequest::handleResponse(const QByteArray &bytes) {
|
|||
switch (address.type()) {
|
||||
case mtpc_ipPort: {
|
||||
const auto &fields = address.c_ipPort();
|
||||
_callback(dcId, parseIp(fields.vipv4()), fields.vport().v, {});
|
||||
const auto ip = parseIp(fields.vipv4());
|
||||
if (!ip.empty()) {
|
||||
_callback(dcId, ip, fields.vport().v, {});
|
||||
}
|
||||
} break;
|
||||
case mtpc_ipPortSecret: {
|
||||
const auto &fields = address.c_ipPortSecret();
|
||||
_callback(
|
||||
dcId,
|
||||
parseIp(fields.vipv4()),
|
||||
fields.vport().v,
|
||||
bytes::make_span(fields.vsecret().v));
|
||||
const auto ip = parseIp(fields.vipv4());
|
||||
if (!ip.empty()) {
|
||||
_callback(
|
||||
dcId,
|
||||
ip,
|
||||
fields.vport().v,
|
||||
bytes::make_span(fields.vsecret().v));
|
||||
}
|
||||
} break;
|
||||
default: Unexpected("Type in simpleConfig ips.");
|
||||
}
|
||||
}
|
||||
}
|
||||
_callback(0, std::string(), 0, {});
|
||||
}
|
||||
|
||||
DomainResolver::DomainResolver(Fn<void(
|
||||
|
|
|
|||
|
|
@ -74,6 +74,17 @@ constexpr auto kArchiveId = -1;
|
|||
|
||||
constexpr auto kMaxStickerSets = 5;
|
||||
|
||||
constexpr auto kGestureStateProcessed = {
|
||||
NSGestureRecognizerStateChanged,
|
||||
NSGestureRecognizerStateBegan,
|
||||
};
|
||||
|
||||
constexpr auto kGestureStateFinished = {
|
||||
NSGestureRecognizerStateEnded,
|
||||
NSGestureRecognizerStateCancelled,
|
||||
NSGestureRecognizerStateFailed,
|
||||
};
|
||||
|
||||
NSString *const kTypePinned = @"pinned";
|
||||
NSString *const kTypeSlider = @"slider";
|
||||
NSString *const kTypeButton = @"button";
|
||||
|
|
@ -641,9 +652,11 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
|
|||
@end // @interface PickerScrubberItemView
|
||||
@implementation PickerScrubberItemView {
|
||||
rpl::lifetime _lifetime;
|
||||
Data::FileOrigin _origin;
|
||||
QSize _dimensions;
|
||||
Image *_image;
|
||||
@public
|
||||
Data::FileOrigin fileOrigin;
|
||||
DocumentData *documentData;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(NSRect)frameRect {
|
||||
|
|
@ -667,9 +680,10 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
|
|||
if (!_image) {
|
||||
return;
|
||||
}
|
||||
fileOrigin = document->stickerSetOrigin();
|
||||
documentData = std::move(document);
|
||||
_dimensions = document->dimensions;
|
||||
_origin = document->stickerSetOrigin();
|
||||
_image->load(_origin);
|
||||
_image->load(fileOrigin);
|
||||
if (_image->loaded()) {
|
||||
[self updateImage];
|
||||
return;
|
||||
|
|
@ -689,7 +703,7 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
|
|||
.scaled(kCircleDiameter, kCircleDiameter, Qt::KeepAspectRatio);
|
||||
_imageView.image = [qt_mac_create_nsimage(
|
||||
_image->pixSingle(
|
||||
_origin,
|
||||
fileOrigin,
|
||||
size.width(),
|
||||
size.height(),
|
||||
kCircleDiameter,
|
||||
|
|
@ -711,9 +725,7 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
|
|||
@implementation PickerCustomTouchBarItem {
|
||||
std::vector<PickerScrubberItem> _stickers;
|
||||
NSPopoverTouchBarItem *_parentPopover;
|
||||
std::unique_ptr<base::Timer> _previewTimer;
|
||||
int _highlightedIndex;
|
||||
bool _previewShown;
|
||||
DocumentId _lastPreviewedSticker;
|
||||
}
|
||||
|
||||
- (id) init:(ScrubberItemType)type popover:(NSPopoverTouchBarItem *)popover {
|
||||
|
|
@ -739,18 +751,65 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
|
|||
[scrubber registerClass:[NSScrubberTextItemView class] forItemIdentifier:kPickerTitleItemIdentifier];
|
||||
[scrubber registerClass:[NSScrubberImageItemView class] forItemIdentifier:kEmojiItemIdentifier];
|
||||
|
||||
_previewShown = false;
|
||||
_highlightedIndex = 0;
|
||||
_previewTimer = !IsSticker(type)
|
||||
? nullptr
|
||||
: std::make_unique<base::Timer>([=] {
|
||||
[self showPreview];
|
||||
});
|
||||
if (IsSticker(type)) {
|
||||
auto *gesture = [[NSPressGestureRecognizer alloc]
|
||||
initWithTarget:self
|
||||
action:@selector(gesturePreviewHandler:)];
|
||||
gesture.allowedTouchTypes = NSTouchTypeMaskDirect;
|
||||
gesture.minimumPressDuration = QApplication::startDragTime() / 1000.;
|
||||
gesture.allowableMovement = 0;
|
||||
[scrubber addGestureRecognizer:gesture];
|
||||
}
|
||||
_lastPreviewedSticker = 0;
|
||||
|
||||
self.view = scrubber;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)gesturePreviewHandler:(NSPressGestureRecognizer *)gesture {
|
||||
const auto customEnter = [](const auto callback) {
|
||||
Core::Sandbox::Instance().customEnterFromEventLoop([=] {
|
||||
if (App::wnd()) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const auto checkState = [&](const auto &states) {
|
||||
return ranges::find(states, gesture.state) != end(states);
|
||||
};
|
||||
|
||||
if (checkState(kGestureStateProcessed)) {
|
||||
NSScrollView *scrollView = self.view;
|
||||
auto *container = scrollView.documentView.subviews.firstObject;
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
const auto point = [gesture locationInView:(std::move(container))];
|
||||
|
||||
for (PickerScrubberItemView *item in container.subviews) {
|
||||
const auto &doc = item->documentData;
|
||||
const auto &origin = item->fileOrigin
|
||||
? item->fileOrigin
|
||||
: Data::FileOrigin();
|
||||
if (![item isMemberOfClass:[PickerScrubberItemView class]]
|
||||
|| !doc
|
||||
|| (doc->id == _lastPreviewedSticker)
|
||||
|| !NSPointInRect(point, item.frame)) {
|
||||
continue;
|
||||
}
|
||||
_lastPreviewedSticker = doc->id;
|
||||
customEnter([origin = std::move(origin), doc = std::move(doc)] {
|
||||
App::wnd()->showMediaPreview(origin, doc);
|
||||
});
|
||||
break;
|
||||
}
|
||||
} else if (checkState(kGestureStateFinished)) {
|
||||
customEnter([] { App::wnd()->hideMediaPreview(); });
|
||||
_lastPreviewedSticker = 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(nonnull NSCoder *)aCoder {
|
||||
// Has not been implemented.
|
||||
}
|
||||
|
|
@ -765,7 +824,7 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
|
|||
const auto item = _stickers[index];
|
||||
if (const auto document = item.document) {
|
||||
PickerScrubberItemView *itemView = [scrubber makeItemWithIdentifier:kStickerItemIdentifier owner:nil];
|
||||
[itemView addDocument:document];
|
||||
[itemView addDocument:(std::move(document))];
|
||||
return itemView;
|
||||
} else if (const auto emoji = item.emoji) {
|
||||
NSScrubberImageItemView *itemView = [scrubber makeItemWithIdentifier:kEmojiItemIdentifier owner:nil];
|
||||
|
|
@ -791,12 +850,6 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
|
|||
return;
|
||||
}
|
||||
scrubber.selectedIndex = -1;
|
||||
if (_previewShown && [self hidePreview]) {
|
||||
return;
|
||||
}
|
||||
if (_previewTimer) {
|
||||
_previewTimer->cancel();
|
||||
}
|
||||
const auto chat = GetActiveChat();
|
||||
|
||||
const auto callback = [&]() -> bool {
|
||||
|
|
@ -828,47 +881,6 @@ void AppendEmojiPacks(std::vector<PickerScrubberItem> &to) {
|
|||
}
|
||||
}
|
||||
|
||||
- (void)scrubber:(NSScrubber *)scrubber didHighlightItemAtIndex:(NSInteger)index {
|
||||
if (_previewTimer) {
|
||||
_previewTimer->callOnce(QApplication::startDragTime());
|
||||
_highlightedIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)scrubber:(NSScrubber *)scrubber didChangeVisibleRange:(NSRange)visibleRange {
|
||||
[self didCancelInteractingWithScrubber:scrubber];
|
||||
}
|
||||
|
||||
- (void)didCancelInteractingWithScrubber:(NSScrubber *)scrubber {
|
||||
if (_previewTimer) {
|
||||
_previewTimer->cancel();
|
||||
}
|
||||
if (_previewShown) {
|
||||
[self hidePreview];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showPreview {
|
||||
if (const auto document = _stickers[_highlightedIndex].document) {
|
||||
if (const auto w = App::wnd()) {
|
||||
w->showMediaPreview(document->stickerSetOrigin(), document);
|
||||
_previewShown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (bool)hidePreview {
|
||||
if (const auto w = App::wnd()) {
|
||||
Core::Sandbox::Instance().customEnterFromEventLoop([=] {
|
||||
w->hideMediaPreview();
|
||||
});
|
||||
_previewShown = false;
|
||||
_highlightedIndex = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
- (void)updateStickers {
|
||||
std::vector<PickerScrubberItem> temp;
|
||||
if (const auto error = RestrictionToSendStickers()) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "platform/platform_info.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "base/timer.h"
|
||||
#include "facades.h"
|
||||
#include "styles/style_window.h"
|
||||
|
||||
#include <QtGui/QWindow>
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ std::string Layouter::CountProportions(const std::vector<float64> &ratios) {
|
|||
ratios
|
||||
) | ranges::view::transform([](float64 ratio) {
|
||||
return (ratio > 1.2) ? 'w' : (ratio < 0.8) ? 'n' : 'q';
|
||||
}) | ranges::to_<std::string>();
|
||||
}) | ranges::to<std::string>();
|
||||
}
|
||||
|
||||
std::vector<GroupMediaLayout> Layouter::layout() const {
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ QImage BlurLargeImage(QImage image, int radius) {
|
|||
const auto dvs = take(dvcount);
|
||||
|
||||
auto &&ints = ranges::view::ints;
|
||||
for (auto &&[value, index] : ranges::view::zip(dvs, ints(0))) {
|
||||
for (auto &&[value, index] : ranges::view::zip(dvs, ints(0, ranges::unreachable))) {
|
||||
value = (index / divsum);
|
||||
}
|
||||
const auto dv = dvs.data();
|
||||
|
|
|
|||
|
|
@ -1141,7 +1141,7 @@ const QRegularExpression &RegExpWordSplit() {
|
|||
|
||||
[[nodiscard]] QString ExpandCustomLinks(const TextWithTags &text) {
|
||||
const auto entities = ConvertTextTagsToEntities(text.tags);
|
||||
auto &&urls = ranges::make_iterator_range(
|
||||
auto &&urls = ranges::make_subrange(
|
||||
entities.begin(),
|
||||
entities.end()
|
||||
) | ranges::view::filter([](const EntityInText &entity) {
|
||||
|
|
@ -2098,7 +2098,7 @@ EntityInText::EntityInText(
|
|||
int EntityInText::FirstMonospaceOffset(
|
||||
const EntitiesInText &entities,
|
||||
int textLength) {
|
||||
auto &&monospace = ranges::make_iterator_range(
|
||||
auto &&monospace = ranges::make_subrange(
|
||||
entities.begin(),
|
||||
entities.end()
|
||||
) | ranges::view::filter([](const EntityInText & entity) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
AppVersion 1008011
|
||||
AppVersion 1008012
|
||||
AppVersionStrMajor 1.8
|
||||
AppVersionStrSmall 1.8.11
|
||||
AppVersionStr 1.8.11
|
||||
AppVersionStrSmall 1.8.12
|
||||
AppVersionStr 1.8.12
|
||||
BetaChannel 0
|
||||
AlphaVersion 0
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
|
||||
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',
|
||||
'GCC_OPTIMIZATION_LEVEL': '0',
|
||||
'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'NO', # temp for range-v3
|
||||
'ALWAYS_SEARCH_USER_PATHS': 'NO',
|
||||
},
|
||||
'configurations': {
|
||||
|
|
@ -88,6 +89,7 @@
|
|||
'OTHER_LDFLAGS': [
|
||||
'-w', # Suppress 'libstdc++ is deprecated' warning.
|
||||
],
|
||||
'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'NO', # temp for range-v3
|
||||
},
|
||||
'defines': [
|
||||
'OS_MAC_OLD',
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
'/w14834', # [[nodiscard]]
|
||||
'/w15038', # wrong initialization order
|
||||
'/w14265', # class has virtual functions, but destructor is not virtual
|
||||
'/experimental:preprocessor', # need for range-v3 see https://github.com/ericniebler/range-v3#supported-compilers
|
||||
'/wd5105', # needed for `/experimental:preprocessor`, suppressing C5105 "macro expansion producing 'defined' has undefined behavior"
|
||||
],
|
||||
'TreatWChar_tAsBuiltInType': 'false',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -45,6 +45,14 @@
|
|||
},
|
||||
'defines': [
|
||||
],
|
||||
'conditions': [[ 'build_macold', {
|
||||
'xcode_settings': {
|
||||
'OTHER_CPLUSPLUSFLAGS': [ '-nostdinc++' ],
|
||||
},
|
||||
'include_dirs': [
|
||||
'/usr/local/macold/include/c++/v1',
|
||||
],
|
||||
}]],
|
||||
'include_dirs': [
|
||||
'<(src_loc)',
|
||||
'<(SHARED_INTERMEDIATE_DIR)',
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
1.8.12 (02.10.19)
|
||||
|
||||
- Bug fixes and other minor improvements.
|
||||
|
||||
1.8.11 (01.10.19)
|
||||
|
||||
- Bug fixes and other minor improvements.
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ Go to ***BuildPath*** and run
|
|||
mkdir Libraries
|
||||
cd Libraries
|
||||
|
||||
git clone --branch 0.5.0 https://github.com/ericniebler/range-v3
|
||||
git clone --branch 0.9.1 https://github.com/ericniebler/range-v3
|
||||
|
||||
git clone https://github.com/telegramdesktop/zlib.git
|
||||
cd zlib
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath***
|
|||
mkdir Libraries
|
||||
cd Libraries
|
||||
|
||||
git clone --branch 0.5.0 https://github.com/ericniebler/range-v3 range-v3
|
||||
git clone --branch 0.9.1 https://github.com/ericniebler/range-v3 range-v3
|
||||
|
||||
git clone https://github.com/telegramdesktop/lzma.git
|
||||
cd lzma\C\Util\LzmaLib
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ Go to ***BuildPath*** and run
|
|||
|
||||
cd Libraries
|
||||
|
||||
git clone --branch 0.5.0 https://github.com/ericniebler/range-v3
|
||||
git clone --branch 0.9.1 https://github.com/ericniebler/range-v3
|
||||
|
||||
cd xz-5.0.5
|
||||
CFLAGS="-mmacosx-version-min=10.8" LDFLAGS="-mmacosx-version-min=10.8" ./configure
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ parts:
|
|||
range-v3:
|
||||
source: https://github.com/ericniebler/range-v3.git
|
||||
source-depth: 1
|
||||
source-tag: 0.5.0
|
||||
source-tag: 0.9.1
|
||||
plugin: nil
|
||||
override-build: |
|
||||
set -x
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue