Skip to content

Commit

Permalink
0.8.57 stable version with confirmation for spam reports
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Sep 13, 2015
1 parent b31c997 commit a9319bf
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Telegram/PrepareWin.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@echo OFF

set "AppVersionStrMajor=0.8"
set "AppVersion=8056"
set "AppVersionStrSmall=0.8.56"
set "AppVersionStr=0.8.56"
set "AppVersionStrFull=0.8.56.0"
set "AppVersion=8057"
set "AppVersionStrSmall=0.8.57"
set "AppVersionStr=0.8.57"
set "AppVersionStrFull=0.8.57.0"
set "DevChannel=0"

if %DevChannel% neq 0 goto preparedev
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/boxes/confirmbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _text(100) {
void ConfirmBox::init(const QString &text) {
_text.setText(st::boxFont, text, (_infoMsg ? _confirmBoxTextOptions : _textPlainOptions));

_textWidth = st::boxWidth - st::boxPadding.left() - st::boxPadding.right();
_textWidth = st::boxWidth + 10 - st::boxPadding.left() - st::boxPadding.right();
_textHeight = qMin(_text.countHeight(_textWidth), 16 * st::boxFont->height);
setMaxHeight(st::boxPadding.top() + _textHeight + st::boxPadding.bottom() + (_infoMsg ? _close.height() : _confirm.height()));

Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
*/
#pragma once

static const int32 AppVersion = 8056;
static const wchar_t *AppVersionStr = L"0.8.56";
static const int32 AppVersion = 8057;
static const wchar_t *AppVersionStr = L"0.8.57";
static const bool DevVersion = false;

static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";
Expand Down
14 changes: 11 additions & 3 deletions Telegram/SourceFiles/historywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4640,10 +4640,18 @@ void HistoryWidget::onAudioFailed(MsgId newId) {
}

void HistoryWidget::onReportSpamClicked() {
ConfirmBox *box = new ConfirmBox(lang(_peer->chat ? lng_report_spam_sure_group : lng_report_spam_sure), lang(lng_report_spam_ok));
connect(box, SIGNAL(confirmed()), this, SLOT(onReportSpamSure()));
App::wnd()->showLayer(box);
_clearPeer = _peer;
}

void HistoryWidget::onReportSpamSure() {
if (_reportSpamRequest) return;

if (!_peer->chat) MTP::send(MTPcontacts_Block(_peer->asUser()->inputUser), rpcDone(&HistoryWidget::blockDone, _peer), RPCFailHandlerPtr(), 0, 5);
_reportSpamRequest = MTP::send(MTPmessages_ReportSpam(_peer->input), rpcDone(&HistoryWidget::reportSpamDone, _peer), rpcFail(&HistoryWidget::reportSpamFail));
App::wnd()->hideLayer();
if (!_clearPeer->chat) MTP::send(MTPcontacts_Block(_clearPeer->asUser()->inputUser), rpcDone(&HistoryWidget::blockDone, _clearPeer), RPCFailHandlerPtr(), 0, 5);
_reportSpamRequest = MTP::send(MTPmessages_ReportSpam(_clearPeer->input), rpcDone(&HistoryWidget::reportSpamDone, _clearPeer), rpcFail(&HistoryWidget::reportSpamFail));
}

void HistoryWidget::reportSpamDone(PeerData *peer, const MTPBool &result, mtpRequestId req) {
Expand Down Expand Up @@ -4684,8 +4692,8 @@ void HistoryWidget::onReportSpamClear() {
}

void HistoryWidget::onReportSpamClearSure() {
App::wnd()->hideLayer();
if (_clearPeer->chat) {
App::wnd()->hideLayer();
App::main()->showDialogs();
MTP::send(MTPmessages_DeleteChatUser(MTP_int(_clearPeer->id & 0xFFFFFFFF), App::self()->inputUser), App::main()->rpcDone(&MainWidget::deleteHistoryAfterLeave, _clearPeer), App::main()->rpcFail(&MainWidget::leaveChatFailed, _clearPeer));
} else {
Expand Down
1 change: 1 addition & 0 deletions Telegram/SourceFiles/historywidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ public slots:
void onAudioFailed(MsgId msgId);

void onReportSpamClicked();
void onReportSpamSure();
void onReportSpamHide();
void onReportSpamClear();
void onReportSpamClearSure();
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Telegram.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.8.56</string>
<string>0.8.57</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>CFBundleSignature</key>
Expand Down
Binary file modified Telegram/Telegram.rc
Binary file not shown.
12 changes: 6 additions & 6 deletions Telegram/Telegram.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.56;
CURRENT_PROJECT_VERSION = 0.8.57;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -1725,7 +1725,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 0.8.56;
CURRENT_PROJECT_VERSION = 0.8.57;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = fast;
GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h;
Expand All @@ -1751,10 +1751,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.56;
CURRENT_PROJECT_VERSION = 0.8.57;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 0.8;
DYLIB_CURRENT_VERSION = 0.8.56;
DYLIB_CURRENT_VERSION = 0.8.57;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
Expand Down Expand Up @@ -1885,10 +1885,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.56;
CURRENT_PROJECT_VERSION = 0.8.57;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 0.8;
DYLIB_CURRENT_VERSION = 0.8.56;
DYLIB_CURRENT_VERSION = 0.8.57;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Version.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
echo 0.8 8056 0.8.56 0
echo 0.8 8057 0.8.57 0
# AppVersionStrMajor AppVersion AppVersionStr DevChannel

0 comments on commit a9319bf

Please sign in to comment.