mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-25 04:38:23 +00:00
version 0.8.20.dev prepared (some fixes)
This commit is contained in:
parent
30be7af3e3
commit
e7b94f3d3a
@ -1,9 +1,9 @@
|
||||
@echo OFF
|
||||
|
||||
set "AppVersion=8019"
|
||||
set "AppVersionStrSmall=0.8.19"
|
||||
set "AppVersionStr=0.8.19"
|
||||
set "AppVersionStrFull=0.8.19.0"
|
||||
set "AppVersion=8020"
|
||||
set "AppVersionStrSmall=0.8.20"
|
||||
set "AppVersionStr=0.8.20"
|
||||
set "AppVersionStrFull=0.8.20.0"
|
||||
set "DevChannel=1"
|
||||
|
||||
if %DevChannel% neq 0 goto preparedev
|
||||
|
@ -986,9 +986,9 @@ btnAttachPhoto: iconedButton(btnAttachDocument) {
|
||||
btnAttachEmoji: iconedButton(btnAttachDocument) {
|
||||
overBgColor: white;
|
||||
icon: sprite(363px, 344px, 21px, 22px);
|
||||
iconPos: point(6px, 13px);
|
||||
iconPos: point(6px, 12px);
|
||||
downIcon: sprite(363px, 344px, 21px, 22px);
|
||||
downIconPos: point(6px, 13px);
|
||||
downIconPos: point(6px, 12px);
|
||||
|
||||
width: 33px;
|
||||
}
|
||||
@ -1726,9 +1726,13 @@ mvDocExtColor: white;
|
||||
mvDocExtPadding: 10px;
|
||||
mvDocLinksTop: 57px;
|
||||
mvDocRed: sprite(0px, 400px, 80px, 80px);
|
||||
mvDocRedColor: #e47272;
|
||||
mvDocYellow: sprite(80px, 400px, 80px, 80px);
|
||||
mvDocYellowColor: #efc274;
|
||||
mvDocGreen: sprite(160px, 400px, 80px, 80px);
|
||||
mvDocGreenColor: #61b96e;
|
||||
mvDocBlue: sprite(240px, 400px, 80px, 80px);
|
||||
mvDocBlueColor: #72b1df;
|
||||
mvDocLink: linkButton(btnDefLink) {
|
||||
color: #4595d3;
|
||||
overColor: #4595d3;
|
||||
|
@ -662,8 +662,8 @@ void Application::checkMapVersion() {
|
||||
psRegisterCustomScheme();
|
||||
if (Local::oldMapVersion()) {
|
||||
QString versionFeatures;
|
||||
if (DevChannel && Local::oldMapVersion() < 8019) {
|
||||
versionFeatures = lang(lng_new_version_text).trimmed();// QString::fromUtf8("\xe2\x80\x94 Video captions are displayed\n\xe2\x80\x94 Photo captions are displayed in photo viewer\n\xe2\x80\x94 Round corners for messages").replace('@', qsl("@") + QChar(0x200D));
|
||||
if (DevChannel && Local::oldMapVersion() < 8020) {
|
||||
versionFeatures = lang(lng_new_version_minor).trimmed();// QString::fromUtf8("\xe2\x80\x94 Video captions are displayed\n\xe2\x80\x94 Photo captions are displayed in photo viewer\n\xe2\x80\x94 Round corners for messages").replace('@', qsl("@") + QChar(0x200D));
|
||||
} else if (!DevChannel && Local::oldMapVersion() < 8016) {
|
||||
versionFeatures = lang(lng_new_version_text).trimmed();
|
||||
} else if (!DevChannel && Local::oldMapVersion() < 8017) {
|
||||
|
@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
static const int32 AppVersion = 8019;
|
||||
static const wchar_t *AppVersionStr = L"0.8.19";
|
||||
static const int32 AppVersion = 8020;
|
||||
static const wchar_t *AppVersionStr = L"0.8.20";
|
||||
static const bool DevChannel = true;
|
||||
|
||||
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
|
||||
@ -40,6 +40,8 @@ enum {
|
||||
MTPContainerLives = 600, // container lives 10 minutes in haveSent map
|
||||
MTPMinReceiveDelay = 4000, // 4 seconds
|
||||
MTPMaxReceiveDelay = 64000, // 64 seconds
|
||||
MTPMinConnectDelay = 1000, // tcp connect should take less then 1 second
|
||||
MTPMaxConnectDelay = 8000, // tcp connect should take 8 seconds max
|
||||
MTPConnectionOldTimeout = 192000, // 192 seconds
|
||||
MTPTcpConnectionWaitTimeout = 3000, // 3 seconds waiting for tcp, until we accept http
|
||||
MTPMillerRabinIterCount = 30, // 30 Miller-Rabin iterations for dh_prime primality check
|
||||
|
@ -2399,12 +2399,39 @@ void HistoryAudio::draw(QPainter &p, const HistoryItem *parent, bool selected, i
|
||||
}
|
||||
|
||||
QRect img;
|
||||
if (already || hasdata) {
|
||||
bool showPause = (playing == data) && (playingState == AudioPlayerPlaying || playingState == AudioPlayerResuming || playingState == AudioPlayerStarting);
|
||||
QString statusText;
|
||||
if (data->status == FileFailed) {
|
||||
statusText = lang(lng_attach_failed);
|
||||
img = out ? st::mediaAudioOutImg : st::mediaAudioInImg;
|
||||
} else if (data->status == FileUploading) {
|
||||
if (_uplTextCache.isEmpty() || _uplDone != data->uploadOffset) {
|
||||
_uplDone = data->uploadOffset;
|
||||
_uplTextCache = formatDownloadText(_uplDone, data->size);
|
||||
}
|
||||
statusText = _uplTextCache;
|
||||
img = out ? st::mediaAudioOutImg : st::mediaAudioInImg;
|
||||
} else if (already || hasdata) {
|
||||
bool showPause = false;
|
||||
if (playing == data && playingState != AudioPlayerStopped && playingState != AudioPlayerStoppedAtStart) {
|
||||
statusText = formatDurationText(playingPosition / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency)) + qsl(" / ") + formatDurationText(playingDuration / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency));
|
||||
showPause = (playingState == AudioPlayerPlaying || playingState == AudioPlayerResuming || playingState == AudioPlayerStarting);
|
||||
} else {
|
||||
statusText = formatDurationText(data->duration);
|
||||
}
|
||||
img = out ? (showPause ? st::mediaPauseOutImg : st::mediaPlayOutImg) : (showPause ? st::mediaPauseInImg : st::mediaPlayInImg);
|
||||
} else {
|
||||
if (data->loader) {
|
||||
if (_dldTextCache.isEmpty() || _dldDone != data->loader->currentOffset()) {
|
||||
_dldDone = data->loader->currentOffset();
|
||||
_dldTextCache = formatDownloadText(_dldDone, data->size);
|
||||
}
|
||||
statusText = _dldTextCache;
|
||||
} else {
|
||||
statusText = _size;
|
||||
}
|
||||
img = out ? st::mediaAudioOutImg : st::mediaAudioInImg;
|
||||
}
|
||||
|
||||
p.drawPixmap(QPoint(st::mediaPadding.left(), skipy + st::mediaPadding.top()), App::sprite(), img);
|
||||
if (selected) {
|
||||
App::roundRect(p, st::mediaPadding.left(), skipy + st::mediaPadding.top(), st::mediaThumbSize, st::mediaThumbSize, textstyleCurrent()->selectOverlay, SelectedOverlayCorners);
|
||||
@ -2419,33 +2446,8 @@ void HistoryAudio::draw(QPainter &p, const HistoryItem *parent, bool selected, i
|
||||
p.setPen(st::black->c);
|
||||
p.drawText(tleft, skipy + st::mediaPadding.top() + st::mediaNameTop + st::mediaFont->ascent, lang(lng_media_audio));
|
||||
|
||||
QString statusText;
|
||||
|
||||
style::color status(selected ? (out ? st::mediaOutSelectColor : st::mediaInSelectColor) : (out ? st::mediaOutColor : st::mediaInColor));
|
||||
p.setPen(status->p);
|
||||
if (data->status == FileFailed) {
|
||||
statusText = lang(lng_attach_failed);
|
||||
} else if (data->status == FileUploading) {
|
||||
if (_uplTextCache.isEmpty() || _uplDone != data->uploadOffset) {
|
||||
_uplDone = data->uploadOffset;
|
||||
_uplTextCache = formatDownloadText(_uplDone, data->size);
|
||||
}
|
||||
statusText = _uplTextCache;
|
||||
} else if (already || hasdata) {
|
||||
if (playing == data && playingState != AudioPlayerStopped && playingState != AudioPlayerStoppedAtStart) {
|
||||
statusText = formatDurationText(playingPosition / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency)) + qsl(" / ") + formatDurationText(playingDuration / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency));
|
||||
} else {
|
||||
statusText = formatDurationText(data->duration);
|
||||
}
|
||||
} else if (data->loader) {
|
||||
if (_dldTextCache.isEmpty() || _dldDone != data->loader->currentOffset()) {
|
||||
_dldDone = data->loader->currentOffset();
|
||||
_dldTextCache = formatDownloadText(_dldDone, data->size);
|
||||
}
|
||||
statusText = _dldTextCache;
|
||||
} else {
|
||||
statusText = _size;
|
||||
}
|
||||
int32 texty = skipy + st::mediaPadding.top() + st::mediaThumbSize - st::mediaDetailsShift - st::mediaFont->height;
|
||||
p.drawText(tleft, texty + st::mediaFont->ascent, statusText);
|
||||
if (parent->isMediaUnread()) {
|
||||
@ -2975,7 +2977,7 @@ void HistorySticker::initDimensions(const HistoryItem *parent) {
|
||||
_maxw = qMax(pixw, int16(st::minPhotoSize));
|
||||
_minh = qMax(pixh, int16(st::minPhotoSize));
|
||||
if (const HistoryReply *reply = toHistoryReply(parent)) {
|
||||
_maxw += reply->replyToWidth();
|
||||
_maxw += st::msgReplyPadding.left() + reply->replyToWidth();
|
||||
}
|
||||
_height = _minh;
|
||||
w = qMin(lastw, _maxw);
|
||||
@ -2989,7 +2991,7 @@ void HistorySticker::draw(QPainter &p, const HistoryItem *parent, bool selected,
|
||||
int32 usew = _maxw, usex = 0;
|
||||
const HistoryReply *reply = toHistoryReply(parent);
|
||||
if (reply) {
|
||||
usew -= reply->replyToWidth();
|
||||
usew -= st::msgReplyPadding.left() + reply->replyToWidth();
|
||||
if (parent->out()) {
|
||||
usex = width - usew;
|
||||
}
|
||||
@ -3052,8 +3054,8 @@ void HistorySticker::draw(QPainter &p, const HistoryItem *parent, bool selected,
|
||||
}
|
||||
|
||||
if (reply) {
|
||||
int32 rw = width - usew, rh = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom();
|
||||
int32 rx = parent->out() ? 0 : usew, ry = _height - rh;
|
||||
int32 rw = width - usew - st::msgReplyPadding.left(), rh = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom();
|
||||
int32 rx = parent->out() ? 0 : (usew + st::msgReplyPadding.left()), ry = _height - rh;
|
||||
|
||||
App::roundRect(p, rx, ry, rw, rh, selected ? App::msgServiceSelectBg() : App::msgServiceBg(), selected ? ServiceSelectedCorners : ServiceCorners);
|
||||
|
||||
|
@ -1711,7 +1711,7 @@ void HistoryWidget::onTextChange() {
|
||||
updateTyping();
|
||||
|
||||
if (cHasAudioCapture()) {
|
||||
if (_field.getLastText().isEmpty()) {
|
||||
if (_field.getLastText().isEmpty() && !App::main()->hasForwardingItems()) {
|
||||
_previewCancelled = false;
|
||||
_send.hide();
|
||||
setMouseTracking(true);
|
||||
@ -1831,6 +1831,10 @@ void HistoryWidget::onRecordDone(QByteArray result, qint32 samples) {
|
||||
}
|
||||
|
||||
void HistoryWidget::onRecordUpdate(qint16 level, qint32 samples) {
|
||||
if (!_recording) {
|
||||
return;
|
||||
}
|
||||
|
||||
a_recordingLevel.start(level);
|
||||
_recordingAnim.start();
|
||||
_recordingSamples = samples;
|
||||
@ -2333,7 +2337,7 @@ void HistoryWidget::updateControlsVisibility() {
|
||||
_toHistoryEnd.show();
|
||||
}
|
||||
if (!histPeer->chat || !histPeer->asChat()->forbidden) {
|
||||
if (cHasAudioCapture() && _field.getLastText().isEmpty()) {
|
||||
if (cHasAudioCapture() && _field.getLastText().isEmpty() && !App::main()->hasForwardingItems()) {
|
||||
_send.hide();
|
||||
setMouseTracking(true);
|
||||
mouseMoveEvent(0);
|
||||
@ -2360,10 +2364,14 @@ void HistoryWidget::updateControlsVisibility() {
|
||||
_attachPhoto.hide();
|
||||
}
|
||||
}
|
||||
if ((_replyToId || App::main()->hasForwardingItems() || (_previewData && _previewData->pendingTill >= 0)) && _replyForwardPreviewCancel.isHidden()) {
|
||||
_replyForwardPreviewCancel.show();
|
||||
resizeEvent(0);
|
||||
update();
|
||||
if ((_replyToId || App::main()->hasForwardingItems() || (_previewData && _previewData->pendingTill >= 0))) {
|
||||
if (_replyForwardPreviewCancel.isHidden()) {
|
||||
_replyForwardPreviewCancel.show();
|
||||
resizeEvent(0);
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
_replyForwardPreviewCancel.hide();
|
||||
}
|
||||
} else {
|
||||
_attachMention.hide();
|
||||
@ -2668,7 +2676,7 @@ void HistoryWidget::loadMessagesAround() {
|
||||
void HistoryWidget::onListScroll() {
|
||||
App::checkImageCacheSize();
|
||||
|
||||
if (histPreloading || !hist || ((_list->isHidden() || _scroll.isHidden() || !App::wnd()->windowHandle()->isVisible()) && hist->readyForWork())) {
|
||||
if (histPreloading || !hist || ((_list->isHidden() || _scroll.isHidden() || _showAnim.animating() || !App::wnd()->windowHandle()->isVisible()) && hist->readyForWork())) {
|
||||
checkUnreadLoaded(true);
|
||||
return;
|
||||
}
|
||||
@ -2849,7 +2857,6 @@ bool HistoryWidget::showStep(float64 ms) {
|
||||
_bgAnimCache = _animCache = _animTopBarCache = _bgAnimTopBarCache = QPixmap();
|
||||
App::main()->topBar()->stopAnim();
|
||||
App::main()->topBar()->enableShadow();
|
||||
updateControlsVisibility();
|
||||
if (hist && hist->readyForWork()) {
|
||||
_scroll.show();
|
||||
if (hist->lastScrollTop == History::ScrollMax) {
|
||||
@ -2857,6 +2864,10 @@ bool HistoryWidget::showStep(float64 ms) {
|
||||
}
|
||||
onListScroll();
|
||||
}
|
||||
if (hist && !_histInited) {
|
||||
checkUnreadLoaded();
|
||||
}
|
||||
updateControlsVisibility();
|
||||
App::wnd()->setInnerFocus();
|
||||
} else {
|
||||
a_bgCoord.update(dt1, st::introHideFunc);
|
||||
@ -3702,7 +3713,7 @@ MsgId HistoryWidget::replyToId() const {
|
||||
void HistoryWidget::updateListSize(int32 addToY, bool initial, bool loadedDown, HistoryItem *resizedItem, bool scrollToIt) {
|
||||
if (!hist || (!_histInited && !initial)) return;
|
||||
|
||||
if (!isVisible()) {
|
||||
if (!isVisible() || _showAnim.animating()) {
|
||||
if (initial) _histInited = false;
|
||||
if (resizedItem) _list->recountHeight(true);
|
||||
return; // scrollTopMax etc are not working after recountHeight()
|
||||
@ -3959,7 +3970,7 @@ void HistoryWidget::cancelReply() {
|
||||
}
|
||||
|
||||
void HistoryWidget::cancelForwarding() {
|
||||
if (!_previewData || _previewData->pendingTill < 0) _replyForwardPreviewCancel.hide();
|
||||
updateControlsVisibility();
|
||||
resizeEvent(0);
|
||||
update();
|
||||
}
|
||||
@ -4241,10 +4252,11 @@ void HistoryWidget::updateReplyTo(bool force) {
|
||||
|
||||
void HistoryWidget::updateForwarding(bool force) {
|
||||
if (App::main()->hasForwardingItems()) {
|
||||
_replyForwardPreviewCancel.show();
|
||||
updateControlsVisibility();
|
||||
} else {
|
||||
resizeEvent(0);
|
||||
update();
|
||||
}
|
||||
resizeEvent(0);
|
||||
update();
|
||||
}
|
||||
|
||||
void HistoryWidget::updateReplyToName() {
|
||||
|
@ -824,6 +824,7 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) {
|
||||
if (_current.isNull() && _currentGif.isNull()) {
|
||||
if (_doc->thumb->isNull()) {
|
||||
style::sprite thumbs[] = { st::mvDocBlue, st::mvDocGreen, st::mvDocRed, st::mvDocYellow };
|
||||
style::color colors[] = { st::mvDocBlueColor, st::mvDocGreenColor, st::mvDocRedColor, st::mvDocYellowColor };
|
||||
QString name = _doc->name.toLower(), mime = _doc->mime.toLower();
|
||||
if (name.endsWith(QLatin1String(".doc")) ||
|
||||
name.endsWith(QLatin1String(".txt")) ||
|
||||
@ -831,17 +832,20 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) {
|
||||
mime.startsWith(QLatin1String("text/"))
|
||||
) {
|
||||
_docIcon = thumbs[0];
|
||||
_docIconColor = colors[0];
|
||||
} else if (
|
||||
name.endsWith(QLatin1String(".xls")) ||
|
||||
name.endsWith(QLatin1String(".csv"))
|
||||
) {
|
||||
_docIcon = thumbs[1];
|
||||
_docIconColor = colors[1];
|
||||
} else if (
|
||||
name.endsWith(QLatin1String(".pdf")) ||
|
||||
name.endsWith(QLatin1String(".ppt")) ||
|
||||
name.endsWith(QLatin1String(".key"))
|
||||
) {
|
||||
_docIcon = thumbs[2];
|
||||
_docIconColor = colors[2];
|
||||
} else if (
|
||||
name.endsWith(QLatin1String(".zip")) ||
|
||||
name.endsWith(QLatin1String(".rar")) ||
|
||||
@ -851,10 +855,12 @@ void MediaView::displayDocument(DocumentData *doc, HistoryItem *item) {
|
||||
name.endsWith(QLatin1String(".avi"))
|
||||
) {
|
||||
_docIcon = thumbs[3];
|
||||
_docIconColor = colors[3];
|
||||
} else {
|
||||
int ext = name.lastIndexOf('.');
|
||||
QChar ch = (ext >= 0 && ext + 1 < name.size()) ? name.at(ext + 1) : (name.isEmpty() ? (mime.isEmpty() ? '0' : mime.at(0)) : name.at(0));
|
||||
_docIcon = thumbs[ch.unicode() % 4];
|
||||
_docIconColor = colors[ch.unicode() % 4];
|
||||
}
|
||||
} else {
|
||||
_doc->thumb->load();
|
||||
@ -1074,11 +1080,13 @@ void MediaView::paintEvent(QPaintEvent *e) {
|
||||
if (_docIconRect.intersects(r)) {
|
||||
icon = true;
|
||||
if (_doc->thumb->isNull()) {
|
||||
p.drawPixmap(_docIconRect.topLeft(), App::sprite(), _docIcon);
|
||||
if (!_doc->already().isEmpty() && (!_docRadialStart || _docRadialOpacity < 1)) {
|
||||
p.drawPixmap(_docIconRect.topLeft(), App::sprite(), _docIcon);
|
||||
p.setPen(st::mvDocExtColor->p);
|
||||
p.setFont(st::mvDocExtFont->f);
|
||||
p.drawText(_docIconRect.x() + (_docIconRect.width() - _docExtWidth) / 2, _docIconRect.y() + st::mvDocExtTop + st::mvDocExtFont->ascent, _docExt);
|
||||
} else {
|
||||
p.fillRect(_docIconRect, _docIconColor->b);
|
||||
}
|
||||
} else {
|
||||
int32 rf(cIntRetinaFactor());
|
||||
|
@ -140,6 +140,7 @@ private:
|
||||
int32 _full; // -1 - thumb, 0 - medium, 1 - full
|
||||
|
||||
style::sprite _docIcon;
|
||||
style::color _docIconColor;
|
||||
QString _docName, _docSize, _docExt;
|
||||
int32 _docNameWidth, _docSizeWidth, _docExtWidth;
|
||||
QRect _docRect, _docIconRect;
|
||||
|
@ -1093,6 +1093,7 @@ MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConne
|
||||
, retryTimeout(1)
|
||||
, oldConnection(true)
|
||||
, receiveDelay(MTPMinReceiveDelay)
|
||||
, connectDelay(MTPMinConnectDelay)
|
||||
, firstSentAt(-1)
|
||||
, _pingId(0)
|
||||
, _pingIdToSend(0)
|
||||
@ -1106,6 +1107,7 @@ MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConne
|
||||
, authKeyStrings(0) {
|
||||
|
||||
oldConnectionTimer.moveToThread(thread);
|
||||
cantConnectTimer.moveToThread(thread);
|
||||
connCheckTimer.moveToThread(thread);
|
||||
_pingSender.moveToThread(thread);
|
||||
retryTimer.moveToThread(thread);
|
||||
@ -1130,6 +1132,7 @@ MTProtoConnectionPrivate::MTProtoConnectionPrivate(QThread *thread, MTProtoConne
|
||||
|
||||
connect(&retryTimer, SIGNAL(timeout()), this, SLOT(retryByTimer()));
|
||||
connect(&connCheckTimer, SIGNAL(timeout()), this, SLOT(onBadConnection()));
|
||||
connect(&cantConnectTimer, SIGNAL(timeout()), this, SLOT(onCantConnect()));
|
||||
connect(&oldConnectionTimer, SIGNAL(timeout()), this, SLOT(onOldConnection()));
|
||||
connect(&_pingSender, SIGNAL(timeout()), this, SLOT(onPingSender()));
|
||||
connect(sessionData->owner(), SIGNAL(authKeyCreated()), this, SLOT(updateAuthKey()), Qt::QueuedConnection);
|
||||
@ -1732,6 +1735,8 @@ void MTProtoConnectionPrivate::restartNow() {
|
||||
|
||||
void MTProtoConnectionPrivate::socketStart(bool afterConfig) {
|
||||
if (!conn) createConn();
|
||||
retryTimer.stop();
|
||||
cantConnectTimer.stop();
|
||||
|
||||
if (conn->isConnected()) {
|
||||
onConnected();
|
||||
@ -1768,6 +1773,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) {
|
||||
connect(conn, SIGNAL(connected()), this, SLOT(onConnected()));
|
||||
connect(conn, SIGNAL(disconnected()), this, SLOT(restart()));
|
||||
|
||||
cantConnectTimer.start(connectDelay);
|
||||
conn->connectToServer(ip.c_str(), port);
|
||||
}
|
||||
|
||||
@ -1778,6 +1784,7 @@ void MTProtoConnectionPrivate::restart(bool maybeBadKey) {
|
||||
DEBUG_LOG(("MTP Info: restarting MTProtoConnection, maybe bad key = %1").arg(logBool(maybeBadKey)));
|
||||
|
||||
connCheckTimer.stop();
|
||||
cantConnectTimer.stop();
|
||||
|
||||
mtpAuthKeyPtr key(sessionData->getKey());
|
||||
if (key) {
|
||||
@ -1884,6 +1891,17 @@ void MTProtoConnectionPrivate::onBadConnection() {
|
||||
QTimer::singleShot(0, this, SLOT(socketStart()));
|
||||
}
|
||||
|
||||
void MTProtoConnectionPrivate::onCantConnect() {
|
||||
DEBUG_LOG(("MTP Info: can't connect in %1ms").arg(connectDelay));
|
||||
if (connectDelay < MTPMaxConnectDelay) connectDelay *= 2;
|
||||
|
||||
doDisconnect();
|
||||
restarted = true;
|
||||
|
||||
DEBUG_LOG(("MTP Info: immediate restart!"));
|
||||
QTimer::singleShot(0, this, SLOT(socketStart()));
|
||||
}
|
||||
|
||||
void MTProtoConnectionPrivate::doDisconnect() {
|
||||
if (conn) {
|
||||
disconnect(conn, SIGNAL(disconnected()), 0, 0);
|
||||
@ -2819,6 +2837,9 @@ void MTProtoConnectionPrivate::resendMany(QVector<quint64> msgIds, quint64 msCan
|
||||
}
|
||||
|
||||
void MTProtoConnectionPrivate::onConnected() {
|
||||
connectDelay = MTPMinConnectDelay;
|
||||
cantConnectTimer.stop();
|
||||
|
||||
QReadLocker lockFinished(&sessionDataMutex);
|
||||
if (!sessionData) return;
|
||||
|
||||
@ -3308,6 +3329,8 @@ void MTProtoConnectionPrivate::clearAuthKeyData() {
|
||||
}
|
||||
|
||||
void MTProtoConnectionPrivate::onError(bool mayBeBadKey) {
|
||||
cantConnectTimer.stop();
|
||||
|
||||
MTP_LOG(dc, ("Restarting after error, maybe bad key: %1..").arg(logBool(mayBeBadKey)));
|
||||
return restart(mayBeBadKey);
|
||||
}
|
||||
|
@ -344,6 +344,7 @@ public slots:
|
||||
void onPingSender();
|
||||
void onPingSendForce();
|
||||
void onBadConnection();
|
||||
void onCantConnect();
|
||||
void onOldConnection();
|
||||
void onSentSome(uint64 size);
|
||||
void onReceivedSome();
|
||||
@ -405,8 +406,8 @@ private:
|
||||
SingleTimer oldConnectionTimer;
|
||||
bool oldConnection;
|
||||
|
||||
SingleTimer connCheckTimer;
|
||||
uint32 receiveDelay;
|
||||
SingleTimer connCheckTimer, cantConnectTimer;
|
||||
uint32 receiveDelay, connectDelay;
|
||||
int64 firstSentAt;
|
||||
|
||||
QVector<MTPlong> ackRequestData, resendRequestData;
|
||||
|
@ -1061,10 +1061,6 @@ void PsMainWindow::psInitSize() {
|
||||
setMinimumHeight(st::wndMinHeight);
|
||||
|
||||
TWindowPos pos(cWindowPos());
|
||||
if (cDebug()) { // temp while design
|
||||
pos.w = st::wndDefWidth;
|
||||
pos.h = st::wndDefHeight;
|
||||
}
|
||||
QRect avail(App::app() ? App::app()->desktop()->availableGeometry() : QDesktopWidget().availableGeometry());
|
||||
bool maximized = false;
|
||||
QRect geom(avail.x() + (avail.width() - st::wndDefWidth) / 2, avail.y() + (avail.height() - st::wndDefHeight) / 2, st::wndDefWidth, st::wndDefHeight);
|
||||
|
@ -11,7 +11,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.8.19</string>
|
||||
<string>0.8.20</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
Binary file not shown.
@ -1693,7 +1693,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 0.8.19;
|
||||
CURRENT_PROJECT_VERSION = 0.8.20;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
@ -1711,7 +1711,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
CURRENT_PROJECT_VERSION = 0.8.19;
|
||||
CURRENT_PROJECT_VERSION = 0.8.20;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = fast;
|
||||
GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h;
|
||||
@ -1737,10 +1737,10 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 0.8.19;
|
||||
CURRENT_PROJECT_VERSION = 0.8.20;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DYLIB_COMPATIBILITY_VERSION = 0.8;
|
||||
DYLIB_CURRENT_VERSION = 0.8.19;
|
||||
DYLIB_CURRENT_VERSION = 0.8.20;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
@ -1880,10 +1880,10 @@
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 0.8.19;
|
||||
CURRENT_PROJECT_VERSION = 0.8.20;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DYLIB_COMPATIBILITY_VERSION = 0.8;
|
||||
DYLIB_CURRENT_VERSION = 0.8.19;
|
||||
DYLIB_CURRENT_VERSION = 0.8.20;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = "";
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
|
@ -1,2 +1,2 @@
|
||||
echo 8019 0.8.19 1
|
||||
echo 8020 0.8.20 1
|
||||
# AppVersion AppVersionStr DevChannel
|
||||
|
Loading…
Reference in New Issue
Block a user