2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Version for OS X 10.6-10.7 build from GYP is ready, not tested yet.

This commit is contained in:
John Preston
2016-08-29 23:24:16 -06:00
parent b821978a36
commit 50616cc267
26 changed files with 264 additions and 77 deletions

View File

@@ -47,6 +47,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "window/top_bar_widget.h"
#include "observer_peer.h"
#include "playerwidget.h"
#include "core/qthelp_regex.h"
namespace {
@@ -2971,9 +2972,8 @@ EntitiesInText entitiesFromTextTags(const FlatTextarea::TagList &tags) {
auto mentionStart = qstr("mention://user.");
for_const (auto &tag, tags) {
if (tag.id.startsWith(mentionStart)) {
auto match = QRegularExpression("^(\\d+\\.\\d+)(/|$)").match(tag.id.midRef(mentionStart.size()));
if (match.hasMatch()) {
result.push_back(EntityInText(EntityInTextMentionName, tag.offset, tag.length, match.captured(1)));
if (auto match = qthelp::regex_match("^(\\d+\\.\\d+)(/|$)", tag.id.midRef(mentionStart.size()))) {
result.push_back(EntityInText(EntityInTextMentionName, tag.offset, tag.length, match->captured(1)));
}
}
}
@@ -8111,7 +8111,12 @@ void HistoryWidget::updatePreview() {
updateMouseTracking();
if (_previewData->pendingTill) {
_previewTitle.setText(st::msgServiceNameFont, lang(lng_preview_loading), _textNameOptions);
_previewDescription.setText(st::msgFont, textClean(_previewLinks.splitRef(' ').at(0).toString()), _textDlgOptions);
#ifndef OS_MAC_OLD
auto linkText = _previewLinks.splitRef(' ').at(0).toString();
#else // OS_MAC_OLD
auto linkText = _previewLinks.split(' ').at(0);
#endif // OS_MAC_OLD
_previewDescription.setText(st::msgFont, textClean(linkText), _textDlgOptions);
int32 t = (_previewData->pendingTill - unixtime()) * 1000;
if (t <= 0) t = 1;