diff --git a/Telegram/PrepareWin.bat b/Telegram/PrepareWin.bat index 262c7a1fa..3ce0aef9b 100644 --- a/Telegram/PrepareWin.bat +++ b/Telegram/PrepareWin.bat @@ -1,9 +1,9 @@ @echo OFF -set "AppVersion=8025" -set "AppVersionStrSmall=0.8.25" -set "AppVersionStr=0.8.25" -set "AppVersionStrFull=0.8.25.0" +set "AppVersion=8026" +set "AppVersionStrSmall=0.8.26" +set "AppVersionStr=0.8.26" +set "AppVersionStrFull=0.8.26.0" set "DevChannel=1" if %DevChannel% neq 0 goto preparedev diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index f0fb249ad..9be165a49 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -70,8 +70,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_status_service_notifications" = "service notifications"; "lng_status_bot" = "bot"; -"lng_status_bot_reads_all" = "sees all messages"; -"lng_status_bot_not_reads_all" = "only sees messages starting with /"; +"lng_status_bot_reads_all" = "has access to messages"; +"lng_status_bot_not_reads_all" = "has no access to messages"; "lng_status_offline" = "last seen a long time ago"; "lng_status_recently" = "last seen recently"; "lng_status_last_week" = "last seen within a week"; diff --git a/Telegram/Resources/style.txt b/Telegram/Resources/style.txt index 7b34bbfb9..4cdc173e8 100644 --- a/Telegram/Resources/style.txt +++ b/Telegram/Resources/style.txt @@ -1197,6 +1197,7 @@ btnShareContact: flatButton(btnDefNext, btnDefBig) { font: font(17px); overFont: font(17px); } +profileMinBtnPadding: 10px; forwardWidth: 364px; forwardMargins: margins(30px, 10px, 30px, 10px); diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 017eeab3d..af1927b43 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -2052,9 +2052,9 @@ namespace App { } } - void openUserByName(const QString &username, bool toProfile) { + void openUserByName(const QString &username, bool toProfile, const QString &start, const QString &startToken) { if (App::main()) { - App::main()->openUserByName(username, toProfile); + App::main()->openUserByName(username, toProfile, start, startToken); } } diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 056db79c9..8320a1402 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -235,7 +235,7 @@ namespace App { void sendBotCommand(const QString &cmd, MsgId replyTo = 0); void searchByHashtag(const QString &tag); - void openUserByName(const QString &username, bool toProfile = false); + void openUserByName(const QString &username, bool toProfile = false, const QString &start = QString(), const QString &startToken = QString()); void joinGroupByHash(const QString &hash); void stickersBox(const QString &name); void openLocalUrl(const QString &url); diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index c1b086843..0a4fdf100 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -640,8 +640,8 @@ void Application::checkMapVersion() { psRegisterCustomScheme(); if (Local::oldMapVersion()) { QString versionFeatures; - if (DevChannel && Local::oldMapVersion() < 8025) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 IPv6 connections support\n\xe2\x80\x94 Bug fixes and minor stuff");// .replace('@', qsl("@") + QChar(0x200D)); + if (DevChannel && Local::oldMapVersion() < 8026) { + versionFeatures = lang(lng_new_version_minor);// QString::fromUtf8("\xe2\x80\x94 IPv6 connections support\n\xe2\x80\x94 Bug fixes and minor stuff");// .replace('@', qsl("@") + QChar(0x200D)); } else if (!DevChannel && Local::oldMapVersion() < 8024) { versionFeatures = lng_new_version_text(lt_blog_link, qsl("https://telegram.org/blog/bot-revolution"));// lang(lng_new_version_text).trimmed(); } diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index f669db538..84d1f1b41 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 8025; -static const wchar_t *AppVersionStr = L"0.8.25"; +static const int32 AppVersion = 8026; +static const wchar_t *AppVersionStr = L"0.8.26"; static const bool DevChannel = true; static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; diff --git a/Telegram/SourceFiles/gui/flatbutton.cpp b/Telegram/SourceFiles/gui/flatbutton.cpp index c090958cc..eea7e4adf 100644 --- a/Telegram/SourceFiles/gui/flatbutton.cpp +++ b/Telegram/SourceFiles/gui/flatbutton.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org FlatButton::FlatButton(QWidget *parent, const QString &text, const style::flatButton &st) : Button(parent), _text(text), - _st(st), + _st(st), _autoFontPadding(0), a_bg(st.bgColor->c), a_text(st.color->c), _opacity(1) { if (_st.width < 0) { _st.width = textWidth() - _st.width; @@ -52,10 +52,35 @@ void FlatButton::setWidth(int32 w) { resize(_st.width, height()); } +void FlatButton::setAutoFontSize(int32 padding, const QString &txt) { + _autoFontPadding = padding; + if (_autoFontPadding) { + _textForAutoSize = txt; + resizeEvent(0); + } else { + _textForAutoSize = QString(); + _autoFont = style::font(); + } + update(); +} + int32 FlatButton::textWidth() const { return _st.font->m.width(_text); } +void FlatButton::resizeEvent(QResizeEvent *e) { + if (_autoFontPadding) { + _autoFont = _st.font; + for (int32 s = _st.font->f.pixelSize(); s >= st::fsize; --s) { + _autoFont = style::font(s, _st.font->flags(), _st.font->family()); + if (2 * _autoFontPadding + _autoFont->m.width(_textForAutoSize) <= width()) { + break; + } + } + } + return Button::resizeEvent(e); +} + bool FlatButton::animStep(float64 ms) { float64 dt = ms / _st.duration; bool res = true; @@ -95,12 +120,15 @@ void FlatButton::paintEvent(QPaintEvent *e) { p.setOpacity(_opacity); p.fillRect(r, a_bg.current()); - p.setFont(((_state & StateOver) ? _st.overFont : _st.font)->f); + p.setFont((_autoFont ? _autoFont : ((_state & StateOver) ? _st.overFont : _st.font))->f); p.setRenderHint(QPainter::TextAntialiasing); p.setPen(a_text.current()); - r.setTop((_state & StateOver) ? ((_state & StateDown) ? _st.downTextTop : _st.overTextTop) : _st.textTop); - p.drawText(r, _text, QTextOption(Qt::AlignHCenter)); + int32 top = (_state & StateOver) ? ((_state & StateDown) ? _st.downTextTop : _st.overTextTop) : _st.textTop; + if (_autoFont) top += (_st.font->height - _autoFont->height) / 2; + r.setTop(top); + + p.drawText(r, _text, style::al_top); } BottomButton::BottomButton(QWidget *w, const QString &t, const style::flatButton &s) : FlatButton(w, t, s) { diff --git a/Telegram/SourceFiles/gui/flatbutton.h b/Telegram/SourceFiles/gui/flatbutton.h index fc6958d74..7f4654cc0 100644 --- a/Telegram/SourceFiles/gui/flatbutton.h +++ b/Telegram/SourceFiles/gui/flatbutton.h @@ -29,12 +29,15 @@ public: FlatButton(QWidget *parent, const QString &text, const style::flatButton &st); + void resizeEvent(QResizeEvent *e); + bool animStep(float64 ms); void paintEvent(QPaintEvent *e); void setOpacity(float64 o); void setText(const QString &text); void setWidth(int32 w); + void setAutoFontSize(int32 padding, const QString &txt); int32 textWidth() const; @@ -47,12 +50,14 @@ public slots: private: - QString _text; + QString _text, _textForAutoSize; int32 _textWidth; style::flatButton _st; anim::cvalue a_bg, a_text; + int32 _autoFontPadding; + style::font _autoFont; float64 _opacity; }; diff --git a/Telegram/SourceFiles/gui/style_core.cpp b/Telegram/SourceFiles/gui/style_core.cpp index 5571bee46..11ad9bf1c 100644 --- a/Telegram/SourceFiles/gui/style_core.cpp +++ b/Telegram/SourceFiles/gui/style_core.cpp @@ -61,6 +61,10 @@ namespace style { return _flags; } + uint32 FontData::family() const { + return _family; + } + Font FontData::otherFlagsFont(uint32 flag, bool set) const { int32 newFlags = set ? (_flags | flag) : (_flags & ~flag); if (!modified[newFlags].v()) { diff --git a/Telegram/SourceFiles/gui/style_core.h b/Telegram/SourceFiles/gui/style_core.h index a9ac71060..06157981a 100644 --- a/Telegram/SourceFiles/gui/style_core.h +++ b/Telegram/SourceFiles/gui/style_core.h @@ -104,6 +104,7 @@ namespace style { Font underline(bool set = true) const; uint32 flags() const; + uint32 family() const; QFont f; QFontMetrics m; diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index 97b22da04..3665d66d3 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -748,7 +748,16 @@ void TextLink::onClick(Qt::MouseButton button) const { QRegularExpressionMatch telegramMeGroup = QRegularExpression(qsl("^https?://telegram\\.me/joinchat/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url); QRegularExpressionMatch telegramMeStickers = QRegularExpression(qsl("^https?://telegram\\.me/addstickers/([a-zA-Z0-9\\.\\_]+)(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url); if (telegramMeUser.hasMatch()) { - App::openUserByName(telegramMeUser.captured(1)); + QString params = url.mid(telegramMeUser.captured(0).size()), start, startToken; + if (!params.isEmpty()) { + QRegularExpressionMatch startParams = QRegularExpression(qsl("(^|&)(s|sg)=([a-zA-Z0-9\\.\\_\\-]+)(&|$)"), QRegularExpression::CaseInsensitiveOption).match(params); + if (startParams.hasMatch()) { + start = startParams.captured(2); + startToken = startParams.captured(3); + start = (start == qsl("sg") ? qsl("startgroup") : (start == qsl("s") ? qsl("start") : QString())); + } + } + App::openUserByName(telegramMeUser.captured(1), start == qsl("startgroup"), start, startToken); } else if (telegramMeGroup.hasMatch()) { App::joinGroupByHash(telegramMeGroup.captured(1)); } else if (telegramMeStickers.hasMatch()) { diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 8ef10d984..643d82fc3 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2533,24 +2533,25 @@ bool MainWidget::started() { void MainWidget::openLocalUrl(const QString &url) { QString u(url.trimmed()); if (u.startsWith(QLatin1String("tg://resolve"), Qt::CaseInsensitive)) { - QRegularExpressionMatch m = QRegularExpression(qsl("^tg://resolve/?\\?domain=([a-zA-Z0-9\\.\\_]+)$"), QRegularExpression::CaseInsensitiveOption).match(u); + QRegularExpressionMatch m = QRegularExpression(qsl("^tg://resolve/?\\?domain=([a-zA-Z0-9\\.\\_]+)(&(start|startgroup)=([a-zA-Z0-9\\.\\_\\-]+))?(&|$)"), QRegularExpression::CaseInsensitiveOption).match(u); if (m.hasMatch()) { - openUserByName(m.captured(1)); + QString start = m.captured(3), startToken = m.captured(4); + openUserByName(m.captured(1), (start == qsl("startgroup")), start, startToken); } } else if (u.startsWith(QLatin1String("tg://join"), Qt::CaseInsensitive)) { - QRegularExpressionMatch m = QRegularExpression(qsl("^tg://join/?\\?invite=([a-zA-Z0-9\\.\\_\\-]+)$"), QRegularExpression::CaseInsensitiveOption).match(u); + QRegularExpressionMatch m = QRegularExpression(qsl("^tg://join/?\\?invite=([a-zA-Z0-9\\.\\_\\-]+)(&|$)"), QRegularExpression::CaseInsensitiveOption).match(u); if (m.hasMatch()) { joinGroupByHash(m.captured(1)); } } else if (u.startsWith(QLatin1String("tg://addstickers"), Qt::CaseInsensitive)) { - QRegularExpressionMatch m = QRegularExpression(qsl("^tg://addstickers/?\\?set=([a-zA-Z0-9\\.\\_]+)$"), QRegularExpression::CaseInsensitiveOption).match(u); + QRegularExpressionMatch m = QRegularExpression(qsl("^tg://addstickers/?\\?set=([a-zA-Z0-9\\.\\_]+)(&|$)"), QRegularExpression::CaseInsensitiveOption).match(u); if (m.hasMatch()) { stickersBox(MTP_inputStickerSetShortName(MTP_string(m.captured(1)))); } } } -void MainWidget::openUserByName(const QString &username, bool toProfile) { +void MainWidget::openUserByName(const QString &username, bool toProfile, const QString &start, const QString &startToken) { App::wnd()->hideMediaview(); UserData *user = App::userByName(username); diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 3855d0e9d..389bd6bd8 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -187,7 +187,7 @@ public: void start(const MTPUser &user); void openLocalUrl(const QString &str); - void openUserByName(const QString &name, bool toProfile = false); + void openUserByName(const QString &name, bool toProfile = false, const QString &start = QString(), const QString &startToken = QString()); void joinGroupByHash(const QString &hash); void stickersBox(const MTPInputStickerSet &set); diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.h b/Telegram/SourceFiles/mtproto/mtpConnection.h index eedd583b6..841e40faf 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.h +++ b/Telegram/SourceFiles/mtproto/mtpConnection.h @@ -40,7 +40,7 @@ enum { MTPDuser_flag_bot_cant_join = (1 << 16), }; -static const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_vector(0)); +static const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_int(0), MTP_vector(0)); #include "mtproto/mtpPublicRSA.h" #include "mtproto/mtpAuthKey.h" diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 9f037c262..19ac0ba31 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -4351,7 +4351,8 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP to.add("\n").addSpaces(lev); } switch (stage) { - case 0: to.add(" rows: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" rows: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } break; @@ -5560,6 +5561,22 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_messages_startBot: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ messages_startBot"); + to.add("\n").addSpaces(lev); + } + switch (stage) { + case 0: to.add(" bot: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 1: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 2: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 3: to.add(" start_param: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + case mtpc_messages_getChats: if (stage) { to.add(",\n").addSpaces(lev); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 1ec3d9612..40c4746a4 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -384,7 +384,7 @@ enum { mtpc_botInfo = 0x9cf585d, mtpc_keyboardButton = 0xa2fa4880, mtpc_keyboardButtonRow = 0x77608b83, - mtpc_replyKeyboardMarkup = 0xd59bfc31, + mtpc_replyKeyboardMarkup = 0x3502758c, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_auth_checkPhone = 0x6fe51dfb, @@ -511,7 +511,8 @@ enum { mtpc_messages_importChatInvite = 0x6c50051c, mtpc_messages_getStickerSet = 0x2619a90e, mtpc_messages_installStickerSet = 0xefbbfae9, - mtpc_messages_uninstallStickerSet = 0xf96e55de + mtpc_messages_uninstallStickerSet = 0xf96e55de, + mtpc_messages_startBot = 0x1b3e0ffc }; // Type forward declarations @@ -8005,7 +8006,7 @@ public: private: explicit MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data); - friend MTPreplyMarkup MTP_replyKeyboardMarkup(const MTPVector &_rows); + friend MTPreplyMarkup MTP_replyKeyboardMarkup(MTPint _flags, const MTPVector &_rows); }; typedef MTPBoxed MTPReplyMarkup; @@ -11259,9 +11260,10 @@ class MTPDreplyKeyboardMarkup : public mtpDataImpl { public: MTPDreplyKeyboardMarkup() { } - MTPDreplyKeyboardMarkup(const MTPVector &_rows) : vrows(_rows) { + MTPDreplyKeyboardMarkup(MTPint _flags, const MTPVector &_rows) : vflags(_flags), vrows(_rows) { } + MTPint vflags; MTPVector vrows; }; @@ -16934,6 +16936,54 @@ public: } }; +class MTPmessages_startBot { // RPC method 'messages.startBot' +public: + MTPInputUser vbot; + MTPint vchat_id; + MTPlong vrandom_id; + MTPstring vstart_param; + + MTPmessages_startBot() { + } + MTPmessages_startBot(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_startBot) { + read(from, end, cons); + } + MTPmessages_startBot(const MTPInputUser &_bot, MTPint _chat_id, const MTPlong &_random_id, const MTPstring &_start_param) : vbot(_bot), vchat_id(_chat_id), vrandom_id(_random_id), vstart_param(_start_param) { + } + + uint32 innerLength() const { + return vbot.innerLength() + vchat_id.innerLength() + vrandom_id.innerLength() + vstart_param.innerLength(); + } + mtpTypeId type() const { + return mtpc_messages_startBot; + } + void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_startBot) { + vbot.read(from, end); + vchat_id.read(from, end); + vrandom_id.read(from, end); + vstart_param.read(from, end); + } + void write(mtpBuffer &to) const { + vbot.write(to); + vchat_id.write(to); + vrandom_id.write(to); + vstart_param.write(to); + } + + typedef MTPUpdates ResponseType; +}; +class MTPmessages_StartBot : public MTPBoxed { +public: + MTPmessages_StartBot() { + } + MTPmessages_StartBot(const MTPmessages_startBot &v) : MTPBoxed(v) { + } + MTPmessages_StartBot(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { + } + MTPmessages_StartBot(const MTPInputUser &_bot, MTPint _chat_id, const MTPlong &_random_id, const MTPstring &_start_param) : MTPBoxed(MTPmessages_startBot(_bot, _chat_id, _random_id, _start_param)) { + } +}; + // Inline methods definition inline MTPresPQ::MTPresPQ() : mtpDataOwner(new MTPDresPQ()) { @@ -25869,7 +25919,7 @@ inline MTPreplyMarkup::MTPreplyMarkup() : mtpDataOwner(new MTPDreplyKeyboardMark inline uint32 MTPreplyMarkup::innerLength() const { const MTPDreplyKeyboardMarkup &v(c_replyKeyboardMarkup()); - return v.vrows.innerLength(); + return v.vflags.innerLength() + v.vrows.innerLength(); } inline mtpTypeId MTPreplyMarkup::type() const { return mtpc_replyKeyboardMarkup; @@ -25879,16 +25929,18 @@ inline void MTPreplyMarkup::read(const mtpPrime *&from, const mtpPrime *end, mtp if (!data) setData(new MTPDreplyKeyboardMarkup()); MTPDreplyKeyboardMarkup &v(_replyKeyboardMarkup()); + v.vflags.read(from, end); v.vrows.read(from, end); } inline void MTPreplyMarkup::write(mtpBuffer &to) const { const MTPDreplyKeyboardMarkup &v(c_replyKeyboardMarkup()); + v.vflags.write(to); v.vrows.write(to); } inline MTPreplyMarkup::MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data) : mtpDataOwner(_data) { } -inline MTPreplyMarkup MTP_replyKeyboardMarkup(const MTPVector &_rows) { - return MTPreplyMarkup(new MTPDreplyKeyboardMarkup(_rows)); +inline MTPreplyMarkup MTP_replyKeyboardMarkup(MTPint _flags, const MTPVector &_rows) { + return MTPreplyMarkup(new MTPDreplyKeyboardMarkup(_flags, _rows)); } // Human-readable text serialization diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 26b003bda..73f882bc3 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -602,7 +602,7 @@ keyboardButton#a2fa4880 text:string = KeyboardButton; keyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow; -replyKeyboardMarkup#d59bfc31 rows:Vector = ReplyMarkup; +replyKeyboardMarkup#3502758c flags:# rows:Vector = ReplyMarkup; ---functions--- @@ -766,3 +766,4 @@ messages.importChatInvite#6c50051c hash:string = Updates; messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet; messages.installStickerSet#efbbfae9 stickerset:InputStickerSet = Bool; messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool; +messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates; diff --git a/Telegram/SourceFiles/profilewidget.cpp b/Telegram/SourceFiles/profilewidget.cpp index da9e2e7b0..640ae3732 100644 --- a/Telegram/SourceFiles/profilewidget.cpp +++ b/Telegram/SourceFiles/profilewidget.cpp @@ -101,6 +101,24 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, const Pee _invitationLink.setAcceptBoth(true); updateInvitationLink(); + if (_peerChat) { + QString maxStr = lang(_uploadPhoto.textWidth() > _addParticipant.textWidth() ? lng_profile_set_group_photo : lng_profile_add_participant); + _uploadPhoto.setAutoFontSize(st::profileMinBtnPadding, maxStr); + _uploadPhoto.setAutoFontSize(st::profileMinBtnPadding, maxStr); + } else if (_peerUser) { + QString maxStr; + if (_peerUser->botInfo && !_peerUser->botInfo->cantJoinGroups) { + maxStr = lang(_sendMessage.textWidth() > _inviteToGroup.textWidth() ? lng_profile_send_message : lng_profile_invite_to_group); + } else if (!_peerUser->phone.isEmpty()) { + maxStr = lang(_sendMessage.textWidth() > _shareContact.textWidth() ? lng_profile_send_message : lng_profile_share_contact); + } else { + maxStr = lang(lng_profile_send_message); + } + _sendMessage.setAutoFontSize(st::profileMinBtnPadding, maxStr); + _shareContact.setAutoFontSize(st::profileMinBtnPadding, maxStr); + _inviteToGroup.setAutoFontSize(st::profileMinBtnPadding, maxStr); + } + connect(&_botSettings, SIGNAL(clicked()), this, SLOT(onBotSettings())); connect(&_botHelp, SIGNAL(clicked()), this, SLOT(onBotHelp())); @@ -633,7 +651,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) { } else { p.setPen(st::btnDefLink.color->p); } - p.drawText(_left + _width - _kickWidth, top + (_pHeight - st::linkFont->height) / 2 + st::linkFont->ascent, lang(lng_profile_kick)); + p.drawText(_left + _width - _kickWidth, top + st::profileListNameTop + st::linkFont->ascent, lang(lng_profile_kick)); } } top += fullCnt * _pHeight; @@ -685,7 +703,7 @@ void ProfileInner::updateSelected() { if (newSelected >= 0 && newSelected < _participants.size()) { ParticipantData *data = _participantsData[newSelected]; if (data && data->cankick) { - int32 top = partfrom + newSelected * _pHeight + (_pHeight - st::linkFont->height) / 2; + int32 top = partfrom + newSelected * _pHeight + st::profileListNameTop; if ((lp.x() >= _left + _width - _kickWidth) && (lp.x() < _left + _width) && (lp.y() >= top) && (lp.y() < top + st::linkFont->height)) { newKickOver = _participants[newSelected]; } @@ -804,11 +822,14 @@ void ProfileInner::resizeEvent(QResizeEvent *e) { top += st::profilePhotoSize; top += st::profileButtonTop; + _uploadPhoto.setGeometry(_left, top, btnWidth, _uploadPhoto.height()); - _sendMessage.setGeometry(_left, top, btnWidth, _sendMessage.height()); _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()); + top += _shareContact.height(); // about diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 8a747f9c3..26df903eb 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.8.25 + 0.8.26 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) CFBundleSignature diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 71bbeee31..0e839beed 100644 Binary files a/Telegram/Telegram.rc and b/Telegram/Telegram.rc differ diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 732355afa..1591fadb1 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1703,7 +1703,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.25; + CURRENT_PROJECT_VERSION = 0.8.26; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1721,7 +1721,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.8.25; + CURRENT_PROJECT_VERSION = 0.8.26; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1747,10 +1747,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.25; + CURRENT_PROJECT_VERSION = 0.8.26; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 0.8; - DYLIB_CURRENT_VERSION = 0.8.25; + DYLIB_CURRENT_VERSION = 0.8.26; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1890,10 +1890,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.8.25; + CURRENT_PROJECT_VERSION = 0.8.26; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.8; - DYLIB_CURRENT_VERSION = 0.8.25; + DYLIB_CURRENT_VERSION = 0.8.26; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; diff --git a/Telegram/Version.sh b/Telegram/Version.sh index bb92da942..f09f13f19 100755 --- a/Telegram/Version.sh +++ b/Telegram/Version.sh @@ -1,2 +1,2 @@ -echo 8025 0.8.25 1 +echo 8026 0.8.26 1 # AppVersion AppVersionStr DevChannel