2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Merge branch 'gyp_xcode' into dev

This commit is contained in:
John Preston
2016-08-31 16:06:12 -04:00
65 changed files with 1199 additions and 6990 deletions

View File

@@ -48,6 +48,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "window/chat_background.h"
#include "observer_peer.h"
#include "playerwidget.h"
#include "core/qthelp_regex.h"
namespace {
@@ -2967,9 +2968,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)));
}
}
}
@@ -8114,7 +8114,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;