From 890352ef977c92cbc4436851880330d61ea76e50 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Jun 2015 13:12:38 +0300 Subject: [PATCH] version 0.8.32 crashfix + ipv6 disabled because of KIS --- Telegram/PrepareWin.bat | 10 +++++----- Telegram/SourceFiles/config.h | 6 +++--- Telegram/SourceFiles/gui/text.cpp | 11 +++++------ Telegram/SourceFiles/gui/text.h | 3 +++ .../SourceFiles/mtproto/mtpConnection.cpp | 2 +- Telegram/SourceFiles/structs.cpp | 3 +-- Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | Bin 5540 -> 5540 bytes Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++++------ Telegram/Version.sh | 2 +- 10 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Telegram/PrepareWin.bat b/Telegram/PrepareWin.bat index e1a9c96d8..997f54058 100644 --- a/Telegram/PrepareWin.bat +++ b/Telegram/PrepareWin.bat @@ -1,10 +1,10 @@ @echo OFF -set "AppVersion=8031" -set "AppVersionStrSmall=0.8.31" -set "AppVersionStr=0.8.31" -set "AppVersionStrFull=0.8.31.0" -set "DevChannel=1" +set "AppVersion=8032" +set "AppVersionStrSmall=0.8.32" +set "AppVersionStr=0.8.32" +set "AppVersionStrFull=0.8.32.0" +set "DevChannel=0" if %DevChannel% neq 0 goto preparedev diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index f8b83c672..767eba9eb 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,9 +17,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 8031; -static const wchar_t *AppVersionStr = L"0.8.31"; -static const bool DevChannel = true; +static const int32 AppVersion = 8032; +static const wchar_t *AppVersionStr = L"0.8.32"; +static const bool DevChannel = false; static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 3ff93f7e5..d1de1358f 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -863,7 +863,7 @@ public: } void draw(int32 left, int32 top, int32 w, style::align align, int32 yFrom, int32 yTo, uint16 selectedFrom = 0, uint16 selectedTo = 0) { - if (_t->_blocks.isEmpty()) return; + if (_t->isEmpty()) return; _blocksSize = _t->_blocks.size(); if (!_textStyle) _initDefault(); @@ -1043,7 +1043,7 @@ public: } void drawElided(int32 left, int32 top, int32 w, style::align align, int32 lines, int32 yFrom, int32 yTo, int32 removeFromEnd) { - if (lines <= 0) return; + if (lines <= 0 || _t->isNull()) return; if (yTo < 0 || (lines - 1) * _t->_font->height < yTo) { yTo = lines * _t->_font->height; @@ -1057,7 +1057,7 @@ public: _lnkX = x; _lnkY = y; _lnkResult = &_zeroLnk; - if (_lnkX >= 0 && _lnkX < w && _lnkY >= 0) { + if (!_t->isNull() && _lnkX >= 0 && _lnkX < w && _lnkY >= 0) { draw(0, 0, w, align, _lnkY, _lnkY + 1); } return *_lnkResult; @@ -1067,7 +1067,7 @@ public: lnk = TextLinkPtr(); inText = false; - if (x >= 0 && x < w && y >= 0) { + if (!_t->isNull() && x >= 0 && x < w && y >= 0) { _lnkX = x; _lnkY = y; _lnkResult = &lnk; @@ -1081,8 +1081,7 @@ public: symbol = 0; after = false; upon = false; - - if (y >= 0) { + if (!_t->isNull() && y >= 0) { _lnkX = x; _lnkY = y; _getSymbol = &symbol; diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index e48417d02..cca0de8e0 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -485,6 +485,9 @@ public: bool isEmpty() const { return _text.isEmpty(); } + bool isNull() const { + return !_font; + } QString original(uint16 selectedFrom = 0, uint16 selectedTo = 0xFFFF, bool expandLinks = true) const; bool lastDots(int32 dots, int32 maxdots = 3) { // hack for typing animation diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 6b34c2780..7b85e6732 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -1800,7 +1800,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) { if (afterConfig && (_conn4 || _conn6)) return; - createConn(!noIPv4, !noIPv6); + createConn(!noIPv4, false/*!noIPv6*/); retryTimer.stop(); _waitForConnectedTimer.stop(); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 1031af76e..13615b966 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -126,10 +126,10 @@ void PeerData::updateName(const QString &newName, const QString &newNameOrPhone, NameFirstChars oldChars = chars; fillNames(); App::history(id)->updateNameText(); + nameUpdated(); if (App::main()) { emit App::main()->peerNameChanged(this, oldNames, oldChars); } - nameUpdated(); } void UserData::setPhoto(const MTPUserProfilePhoto &p) { @@ -198,7 +198,6 @@ void UserData::setName(const QString &first, const QString &last, const QString void UserData::setPhone(const QString &newPhone) { phone = newPhone; - ++nameVersion; } void UserData::setBotInfoVersion(int32 version) { diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 29cd45c3f..5b11e71ea 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.8.31 + 0.8.32 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) CFBundleSignature diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 26a9199d7e9ed586ad357d5140439a06772cf643..94fdb429a469515c3d324e5344f695d1bbb2b008 100644 GIT binary patch delta 53 zcmZ3Yy+nIM5ig_B