diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 57da8554c..0ee26c103 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -638,6 +638,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org "lng_cant_invite_not_contact" = "Sorry, you can only add mutual contacts\nto groups at the moment. {more_info}"; "lng_cant_invite_not_contact_channel" = "Sorry, you can only add mutual contacts\nto channels at the moment. {more_info}"; "lng_cant_more_info" = "More info ยป"; +"lng_cant_invite_privacy" = "Sorry, you cannot add this user to groups because of the privacy settings."; +"lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings."; "lng_send_button" = "Send"; "lng_message_ph" = "Write a message.."; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 5cd2bda88..92e1622b5 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1291,9 +1291,13 @@ msgWaveformSkip: 1px; msgWaveformMin: 2px; msgWaveformMax: 20px; msgWaveformInActive: #59b6eb; -msgWaveformInInactive: #deeaf1; +msgWaveformInActiveSelected: #51a3d3; +msgWaveformInInactive: #d4dee6; +msgWaveformInInactiveSelected: #9cc1e1; msgWaveformOutActive: #78c67f; -msgWaveformOutInactive: #c4e8c5; +msgWaveformOutActiveSelected: #6badad; +msgWaveformOutInactive: #b3e2b4; +msgWaveformOutInactiveSelected: #91c3c3; sendPadding: 9px; btnSend: flatButton(btnDefFlat) { diff --git a/Telegram/SourceFiles/_other/updater.cpp b/Telegram/SourceFiles/_other/updater.cpp index 9dea213aa..d89efcd95 100644 --- a/Telegram/SourceFiles/_other/updater.cpp +++ b/Telegram/SourceFiles/_other/updater.cpp @@ -482,13 +482,18 @@ HANDLE _generateDumpFileAtPath(const WCHAR *path) { static const int maxFileLen = MAX_PATH * 10; WCHAR szPath[maxFileLen]; - wsprintf(szPath, L"%stdumps\\", path); - + wsprintf(szPath, L"%stdata\\", path); if (!CreateDirectory(szPath, NULL)) { if (GetLastError() != ERROR_ALREADY_EXISTS) { return 0; } } + wsprintf(szPath, L"%sdumps\\", path); + if (!CreateDirectory(szPath, NULL)) { + if (GetLastError() != ERROR_ALREADY_EXISTS) { + return 0; + } + } WCHAR szFileName[maxFileLen]; WCHAR szExeName[maxFileLen]; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index afc5e6bc0..89e667eb1 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -1052,9 +1052,9 @@ void AppClass::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9020) { + if ((cDevVersion() || cBetaVersion()) && Local::oldMapVersion() < 9022) { if (cPlatform() == dbipMac || cPlatform() == dbipMacOld) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Voice messages waveform visualizations\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); } else { versionFeatures = QString::fromUtf8("\xe2\x80\x94 Testing new crash reporting system\n\xe2\x80\x94 Conversation history is centered in wide windows\n\xe2\x80\x94 New cute link and timestamp tooltips design\n\xe2\x80\x94 Ctrl+W or Ctrl+F4 closes Telegram window\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); } diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 0878f1a6d..1816d479c 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -20,8 +20,8 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 9021; -static const wchar_t *AppVersionStr = L"0.9.21"; +static const int32 AppVersion = 9022; +static const wchar_t *AppVersionStr = L"0.9.22"; static const bool DevVersion = true; //#define BETA_VERSION (9019002ULL) // just comment this line to build public version diff --git a/Telegram/SourceFiles/dropdown.cpp b/Telegram/SourceFiles/dropdown.cpp index f4b9ac2a5..737e70d0b 100644 --- a/Telegram/SourceFiles/dropdown.cpp +++ b/Telegram/SourceFiles/dropdown.cpp @@ -1698,6 +1698,7 @@ bool StickerPanInner::inlineRowFinalize(InlineRow &row, int32 &sumWidth, bool fo void StickerPanInner::refreshSavedGifs() { if (_showingSavedGifs) { + _settings.hide(); clearInlineRows(false); if (_showingInlineItems) { const SavedGifs &saved(cSavedGifs()); @@ -1919,6 +1920,7 @@ int32 StickerPanInner::refreshInlineRows(UserData *bot, const InlineResults &res _showingInlineItems = true; _showingSavedGifs = false; + _settings.hide(); int32 count = results.size(), from = validateExistingInlineRows(results), added = 0; diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 8c675c0ce..8d1ed775a 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -4059,9 +4059,12 @@ void HistoryDocument::draw(Painter &p, const HistoryItem *parent, const QRect &r float64 prg = voice->_playback ? voice->_playback->a_progress.current() : 0; // rescale waveform by going in waveform.size * bar_count 1D grid - style::color active(outbg ? st::msgWaveformOutActive : st::msgWaveformInActive); - style::color inactive(outbg ? st::msgWaveformOutInactive : st::msgWaveformInInactive); + style::color active(outbg ? (selected ? st::msgWaveformOutActiveSelected : st::msgWaveformOutActive) : (selected ? st::msgWaveformInActiveSelected : st::msgWaveformInActive)); + style::color inactive(outbg ? (selected ? st::msgWaveformOutInactiveSelected : st::msgWaveformOutInactive) : (selected ? st::msgWaveformInInactiveSelected : st::msgWaveformInInactive)); int32 wf_size = wf ? wf->size() : WaveformSamplesCount, availw = int32(namewidth + st::msgWaveformSkip), activew = qRound(availw * prg); + if (!outbg && !voice->_playback && parent->isMediaUnread()) { + activew = availw; + } int32 bar_count = qMin(availw / int32(st::msgWaveformBar + st::msgWaveformSkip), wf_size); uchar max_value = 0; int32 max_delta = st::msgWaveformMax - st::msgWaveformMin, bottom = st::msgFilePadding.top() + st::msgWaveformMax; @@ -7531,6 +7534,8 @@ void HistoryServiceMsg::draw(Painter &p, const QRect &r, uint32 selection, uint6 } int32 HistoryServiceMsg::resize(int32 width) { + int32 maxwidth = qMin(_history->width, int(st::msgMaxWidth + 2 * st::msgPhotoSkip)); + if (width > maxwidth) width = maxwidth; width -= st::msgServiceMargin.left() + st::msgServiceMargin.left(); // two small margins if (width < st::msgServicePadding.left() + st::msgServicePadding.right() + 1) width = st::msgServicePadding.left() + st::msgServicePadding.right() + 1; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 085b958d7..e5be52e98 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1084,6 +1084,8 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) { QString text = lang(lng_failed_add_participant); if (error.type() == "USER_LEFT_CHAT") { // trying to return banned user to his group + } else if (error.type() == "USER_PRIVACY_RESTRICTED") { + text = lang(lng_cant_invite_privacy); } else if (error.type() == "USER_NOT_MUTUAL_CONTACT") { // trying to return user who does not have me in contacts text = lang(lng_failed_add_not_mutual); } else if (error.type() == "USER_ALREADY_PARTICIPANT" && user->botInfo) { @@ -1100,6 +1102,8 @@ bool MainWidget::addParticipantsFail(ChannelData *channel, const RPCError &error QString text = lang(lng_failed_add_participant); if (error.type() == "USER_LEFT_CHAT") { // trying to return banned user to his group + } else if (error.type() == "USER_PRIVACY_RESTRICTED") { + text = lang(lng_cant_invite_privacy_channel); } else if (error.type() == "USER_NOT_MUTUAL_CONTACT") { // trying to return user who does not have me in contacts text = lang(channel->isMegagroup() ? lng_failed_add_not_mutual : lng_failed_add_not_mutual_channel); } else if (error.type() == "PEER_FLOOD") { diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index 53df0dedf..313709f18 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -817,7 +817,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { top += st::profilePhotoSize; top += st::profileButtonTop; - if ((!_peerChat || _peerChat->canEdit()) && (!_peerChannel || _amCreator || (_peerChannel->amEditor() && _peerChannel->isMegagroup()))) { + if ((!_peerChat || _peerChat->canEdit()) && (!_peerChannel || _amCreator || (_peerChannel->canAddParticipants() && _peerChannel->isMegagroup()))) { top += _shareContact.height(); } else { top -= st::profileButtonTop; @@ -1294,13 +1294,17 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { top += st::profileButtonTop; _uploadPhoto.setGeometry(_left, top, btnWidth, _uploadPhoto.height()); - _addParticipant.setGeometry(_left + _width - btnWidth, top, btnWidth, _addParticipant.height()); + if (_peerChannel && _peerChannel->count < cMaxMegaGroupCount() && _peerChannel->isMegagroup() && !_amCreator && !_peerChannel->amEditor() && _peerChannel->canAddParticipants()) { + _addParticipant.setGeometry(_left, top, btnWidth, _addParticipant.height()); + } else { + _addParticipant.setGeometry(_left + _width - btnWidth, top, btnWidth, _addParticipant.height()); + } _sendMessage.setGeometry(_left, top, btnWidth, _sendMessage.height()); _shareContact.setGeometry(_left + _width - btnWidth, top, btnWidth, _shareContact.height()); _inviteToGroup.setGeometry(_left + _width - btnWidth, top, btnWidth, _inviteToGroup.height()); - if ((!_peerChat || _peerChat->canEdit()) && (!_peerChannel || _amCreator || (_peerChannel->amEditor() && _peerChannel->isMegagroup()))) { + if ((!_peerChat || _peerChat->canEdit()) && (!_peerChannel || _amCreator || (_peerChannel->canAddParticipants() && _peerChannel->isMegagroup()))) { top += _shareContact.height(); } else { top -= st::profileButtonTop; @@ -1634,7 +1638,7 @@ void ProfileInner::showAll() { _invitationLink.hide(); } } - if (_peerChannel->count < cMaxMegaGroupCount() && _peerChannel->isMegagroup() && (_amCreator || _peerChannel->amEditor())) { + if (_peerChannel->count < cMaxMegaGroupCount() && _peerChannel->isMegagroup() && _peerChannel->canAddParticipants()) { _addParticipant.show(); } else { _addParticipant.hide(); diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index b29ff4c1f..044827de6 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2475,48 +2475,6 @@ BOOL __stdcall ReadProcessMemoryRoutine64( return bRet; } -HANDLE _generateDumpFileAtPath(const WCHAR *path) { - static const int maxFileLen = MAX_PATH * 10; - - WCHAR szPath[maxFileLen]; - wsprintf(szPath, L"%stdumps\\", path); - - if (!CreateDirectory(szPath, NULL)) { - DWORD errCode = GetLastError(); - if (errCode && errCode != ERROR_ALREADY_EXISTS) { - return 0; - } - } - - WCHAR szFileName[maxFileLen]; - WCHAR szExeName[maxFileLen]; - - wcscpy_s(szExeName, _exeName); - WCHAR *dotFrom = wcschr(szExeName, WCHAR(L'.')); - if (dotFrom) { - wsprintf(dotFrom, L""); - } - - SYSTEMTIME stLocalTime; - - GetLocalTime(&stLocalTime); - - if (cBetaVersion()) { - wsprintf(szFileName, L"%s%s-%ld-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", - szPath, szExeName, cBetaVersion(), - stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, - stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, - GetCurrentProcessId(), GetCurrentThreadId()); - } else { - wsprintf(szFileName, L"%s%s-%s-%04d%02d%02d-%02d%02d%02d-%ld-%ld.dmp", - szPath, szExeName, AppVersionStr, - stLocalTime.wYear, stLocalTime.wMonth, stLocalTime.wDay, - stLocalTime.wHour, stLocalTime.wMinute, stLocalTime.wSecond, - GetCurrentProcessId(), GetCurrentThreadId()); - } - return CreateFile(szFileName, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0); -} - // **************************************** ToolHelp32 ************************ #define MAX_MODULE_NAME32 255 #define TH32CS_SNAPMODULE 0x00000008 diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 887ab0ebf..625b300db 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -626,6 +626,9 @@ public: bool isVerified() const { return flags & MTPDchannel::flag_verified; } + bool canAddParticipants() const { + return amCreator() || amEditor() || (flags & MTPDchannel::flag_invites_enabled); + } // ImagePtr photoFull; QString invitationUrl; diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 593925800..932d464df 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -2019,7 +2019,7 @@ LastCrashedWindow::LastCrashedWindow() , _updatingSkip(this, false) #endif { - if (!cDevVersion() && !cBetaVersion()) { + if (!cDevVersion() && !cBetaVersion()) { // currently accept crash reports only from testers _sendingState = SendingNoReport; } if (_sendingState != SendingNoReport) { @@ -2064,12 +2064,19 @@ LastCrashedWindow::LastCrashedWindow() _minidumpFull = maxDumpFull; } } - if (_minidumpName.isEmpty()) { + if (_minidumpName.isEmpty()) { // currently don't accept crash reports without dumps from google libraries _sendingState = SendingNoReport; } else { _minidump.setText(qsl("+ %1 (%2 KB)").arg(_minidumpName).arg(dumpsize / 1024)); } } + if (_sendingState != SendingNoReport) { + QString version = getReportField(qstr("version"), qstr("Version:")); + QString current = cBetaVersion() ? qsl("-%1").arg(cBetaVersion()) : QString::number(AppVersion); + if (version != current) { // currently don't accept crash reports from not current app version + _sendingState = SendingNoReport; + } + } _networkSettings.setText(qsl("NETWORK SETTINGS")); connect(&_networkSettings, SIGNAL(clicked()), this, SLOT(onNetworkSettings())); @@ -2201,7 +2208,7 @@ void LastCrashedWindow::onSendReport() { App::setProxySettings(_sendManager); QString apiid = getReportField(qstr("apiid"), qstr("ApiId:")), version = getReportField(qstr("version"), qstr("Version:")); - _checkReply = _sendManager.get(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=query_report&apiid=%1&version=%2&dmp=%3").arg(apiid).arg(version).arg(minidumpFileName().isEmpty() ? 0 : 1))); + _checkReply = _sendManager.get(QNetworkRequest(qsl("https://tdesktop.com/crash.php?act=query_report&apiid=%1&version=%2&dmp=%3&platform=%4").arg(apiid).arg(version).arg(minidumpFileName().isEmpty() ? 0 : 1).arg(cPlatformString()))); connect(_checkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onSendingError(QNetworkReply::NetworkError))); connect(_checkReply, SIGNAL(finished()), this, SLOT(onCheckingFinished())); diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 9e4f73636..8bc5a45e0 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.21 + 0.9.22 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 353487466..8dd9cd58c 100644 --- a/Telegram/Telegram.rc +++ b/Telegram/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,9,21,0 - PRODUCTVERSION 0,9,21,0 + FILEVERSION 0,9,22,0 + PRODUCTVERSION 0,9,22,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -51,10 +51,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Telegram Messenger LLP" - VALUE "FileVersion", "0.9.21.0" + VALUE "FileVersion", "0.9.22.0" VALUE "LegalCopyright", "Copyright (C) 2014-2016" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "0.9.21.0" + VALUE "ProductVersion", "0.9.22.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 0e234ad04..8454cab83 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1720,7 +1720,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.21; + CURRENT_PROJECT_VERSION = 0.9.22; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1739,7 +1739,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.9.21; + CURRENT_PROJECT_VERSION = 0.9.22; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1768,10 +1768,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.21; + CURRENT_PROJECT_VERSION = 0.9.22; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.21; + DYLIB_CURRENT_VERSION = 0.9.22; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1909,10 +1909,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.9.21; + CURRENT_PROJECT_VERSION = 0.9.22; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.9; - DYLIB_CURRENT_VERSION = 0.9.21; + DYLIB_CURRENT_VERSION = 0.9.22; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = ""; diff --git a/Telegram/Version b/Telegram/Version index 58252de8f..bcf8c071a 100644 --- a/Telegram/Version +++ b/Telegram/Version @@ -1,6 +1,6 @@ -AppVersion 9021 +AppVersion 9022 AppVersionStrMajor 0.9 -AppVersionStrSmall 0.9.21 -AppVersionStr 0.9.21 +AppVersionStrSmall 0.9.22 +AppVersionStr 0.9.22 DevChannel 1 BetaVersion 0 9019002