0.8.26.dev version with fixed schema

This commit is contained in:
John Preston 2015-06-17 00:01:43 +03:00
parent 5fadfed47a
commit 05ac97526e
23 changed files with 186 additions and 46 deletions

View file

@ -1,9 +1,9 @@
@echo OFF @echo OFF
set "AppVersion=8025" set "AppVersion=8026"
set "AppVersionStrSmall=0.8.25" set "AppVersionStrSmall=0.8.26"
set "AppVersionStr=0.8.25" set "AppVersionStr=0.8.26"
set "AppVersionStrFull=0.8.25.0" set "AppVersionStrFull=0.8.26.0"
set "DevChannel=1" set "DevChannel=1"
if %DevChannel% neq 0 goto preparedev if %DevChannel% neq 0 goto preparedev

View file

@ -70,8 +70,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
"lng_status_service_notifications" = "service notifications"; "lng_status_service_notifications" = "service notifications";
"lng_status_bot" = "bot"; "lng_status_bot" = "bot";
"lng_status_bot_reads_all" = "sees all messages"; "lng_status_bot_reads_all" = "has access to messages";
"lng_status_bot_not_reads_all" = "only sees messages starting with /"; "lng_status_bot_not_reads_all" = "has no access to messages";
"lng_status_offline" = "last seen a long time ago"; "lng_status_offline" = "last seen a long time ago";
"lng_status_recently" = "last seen recently"; "lng_status_recently" = "last seen recently";
"lng_status_last_week" = "last seen within a week"; "lng_status_last_week" = "last seen within a week";

View file

@ -1197,6 +1197,7 @@ btnShareContact: flatButton(btnDefNext, btnDefBig) {
font: font(17px); font: font(17px);
overFont: font(17px); overFont: font(17px);
} }
profileMinBtnPadding: 10px;
forwardWidth: 364px; forwardWidth: 364px;
forwardMargins: margins(30px, 10px, 30px, 10px); forwardMargins: margins(30px, 10px, 30px, 10px);

View file

@ -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()) { if (App::main()) {
App::main()->openUserByName(username, toProfile); App::main()->openUserByName(username, toProfile, start, startToken);
} }
} }

View file

@ -235,7 +235,7 @@ namespace App {
void sendBotCommand(const QString &cmd, MsgId replyTo = 0); void sendBotCommand(const QString &cmd, MsgId replyTo = 0);
void searchByHashtag(const QString &tag); 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 joinGroupByHash(const QString &hash);
void stickersBox(const QString &name); void stickersBox(const QString &name);
void openLocalUrl(const QString &url); void openLocalUrl(const QString &url);

View file

@ -640,8 +640,8 @@ void Application::checkMapVersion() {
psRegisterCustomScheme(); psRegisterCustomScheme();
if (Local::oldMapVersion()) { if (Local::oldMapVersion()) {
QString versionFeatures; QString versionFeatures;
if (DevChannel && Local::oldMapVersion() < 8025) { if (DevChannel && Local::oldMapVersion() < 8026) {
versionFeatures = QString::fromUtf8("\xe2\x80\x94 IPv6 connections support\n\xe2\x80\x94 Bug fixes and minor stuff");// .replace('@', qsl("@") + QChar(0x200D)); 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) { } 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(); versionFeatures = lng_new_version_text(lt_blog_link, qsl("https://telegram.org/blog/bot-revolution"));// lang(lng_new_version_text).trimmed();
} }

View file

@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
*/ */
#pragma once #pragma once
static const int32 AppVersion = 8025; static const int32 AppVersion = 8026;
static const wchar_t *AppVersionStr = L"0.8.25"; static const wchar_t *AppVersionStr = L"0.8.26";
static const bool DevChannel = true; static const bool DevChannel = true;
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";

View file

@ -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), FlatButton::FlatButton(QWidget *parent, const QString &text, const style::flatButton &st) : Button(parent),
_text(text), _text(text),
_st(st), _st(st), _autoFontPadding(0),
a_bg(st.bgColor->c), a_text(st.color->c), _opacity(1) { a_bg(st.bgColor->c), a_text(st.color->c), _opacity(1) {
if (_st.width < 0) { if (_st.width < 0) {
_st.width = textWidth() - _st.width; _st.width = textWidth() - _st.width;
@ -52,10 +52,35 @@ void FlatButton::setWidth(int32 w) {
resize(_st.width, height()); 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 { int32 FlatButton::textWidth() const {
return _st.font->m.width(_text); 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) { bool FlatButton::animStep(float64 ms) {
float64 dt = ms / _st.duration; float64 dt = ms / _st.duration;
bool res = true; bool res = true;
@ -95,12 +120,15 @@ void FlatButton::paintEvent(QPaintEvent *e) {
p.setOpacity(_opacity); p.setOpacity(_opacity);
p.fillRect(r, a_bg.current()); 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.setRenderHint(QPainter::TextAntialiasing);
p.setPen(a_text.current()); p.setPen(a_text.current());
r.setTop((_state & StateOver) ? ((_state & StateDown) ? _st.downTextTop : _st.overTextTop) : _st.textTop); int32 top = (_state & StateOver) ? ((_state & StateDown) ? _st.downTextTop : _st.overTextTop) : _st.textTop;
p.drawText(r, _text, QTextOption(Qt::AlignHCenter)); 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) { BottomButton::BottomButton(QWidget *w, const QString &t, const style::flatButton &s) : FlatButton(w, t, s) {

View file

@ -29,12 +29,15 @@ public:
FlatButton(QWidget *parent, const QString &text, const style::flatButton &st); FlatButton(QWidget *parent, const QString &text, const style::flatButton &st);
void resizeEvent(QResizeEvent *e);
bool animStep(float64 ms); bool animStep(float64 ms);
void paintEvent(QPaintEvent *e); void paintEvent(QPaintEvent *e);
void setOpacity(float64 o); void setOpacity(float64 o);
void setText(const QString &text); void setText(const QString &text);
void setWidth(int32 w); void setWidth(int32 w);
void setAutoFontSize(int32 padding, const QString &txt);
int32 textWidth() const; int32 textWidth() const;
@ -47,12 +50,14 @@ public slots:
private: private:
QString _text; QString _text, _textForAutoSize;
int32 _textWidth; int32 _textWidth;
style::flatButton _st; style::flatButton _st;
anim::cvalue a_bg, a_text; anim::cvalue a_bg, a_text;
int32 _autoFontPadding;
style::font _autoFont;
float64 _opacity; float64 _opacity;
}; };

View file

@ -61,6 +61,10 @@ namespace style {
return _flags; return _flags;
} }
uint32 FontData::family() const {
return _family;
}
Font FontData::otherFlagsFont(uint32 flag, bool set) const { Font FontData::otherFlagsFont(uint32 flag, bool set) const {
int32 newFlags = set ? (_flags | flag) : (_flags & ~flag); int32 newFlags = set ? (_flags | flag) : (_flags & ~flag);
if (!modified[newFlags].v()) { if (!modified[newFlags].v()) {

View file

@ -104,6 +104,7 @@ namespace style {
Font underline(bool set = true) const; Font underline(bool set = true) const;
uint32 flags() const; uint32 flags() const;
uint32 family() const;
QFont f; QFont f;
QFontMetrics m; QFontMetrics m;

View file

@ -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 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); QRegularExpressionMatch telegramMeStickers = QRegularExpression(qsl("^https?://telegram\\.me/addstickers/([a-zA-Z0-9\\.\\_]+)(\\?|$)"), QRegularExpression::CaseInsensitiveOption).match(url);
if (telegramMeUser.hasMatch()) { 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()) { } else if (telegramMeGroup.hasMatch()) {
App::joinGroupByHash(telegramMeGroup.captured(1)); App::joinGroupByHash(telegramMeGroup.captured(1));
} else if (telegramMeStickers.hasMatch()) { } else if (telegramMeStickers.hasMatch()) {

View file

@ -2533,24 +2533,25 @@ bool MainWidget::started() {
void MainWidget::openLocalUrl(const QString &url) { void MainWidget::openLocalUrl(const QString &url) {
QString u(url.trimmed()); QString u(url.trimmed());
if (u.startsWith(QLatin1String("tg://resolve"), Qt::CaseInsensitive)) { 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()) { 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)) { } 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()) { if (m.hasMatch()) {
joinGroupByHash(m.captured(1)); joinGroupByHash(m.captured(1));
} }
} else if (u.startsWith(QLatin1String("tg://addstickers"), Qt::CaseInsensitive)) { } 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()) { if (m.hasMatch()) {
stickersBox(MTP_inputStickerSetShortName(MTP_string(m.captured(1)))); 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(); App::wnd()->hideMediaview();
UserData *user = App::userByName(username); UserData *user = App::userByName(username);

View file

@ -187,7 +187,7 @@ public:
void start(const MTPUser &user); void start(const MTPUser &user);
void openLocalUrl(const QString &str); 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 joinGroupByHash(const QString &hash);
void stickersBox(const MTPInputStickerSet &set); void stickersBox(const MTPInputStickerSet &set);

View file

@ -40,7 +40,7 @@ enum {
MTPDuser_flag_bot_cant_join = (1 << 16), MTPDuser_flag_bot_cant_join = (1 << 16),
}; };
static const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_vector<MTPKeyboardButtonRow>(0)); static const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_int(0), MTP_vector<MTPKeyboardButtonRow>(0));
#include "mtproto/mtpPublicRSA.h" #include "mtproto/mtpPublicRSA.h"
#include "mtproto/mtpAuthKey.h" #include "mtproto/mtpAuthKey.h"

View file

@ -4351,7 +4351,8 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP
to.add("\n").addSpaces(lev); to.add("\n").addSpaces(lev);
} }
switch (stage) { 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
} }
break; break;
@ -5560,6 +5561,22 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP
} }
break; 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: case mtpc_messages_getChats:
if (stage) { if (stage) {
to.add(",\n").addSpaces(lev); to.add(",\n").addSpaces(lev);

View file

@ -384,7 +384,7 @@ enum {
mtpc_botInfo = 0x9cf585d, mtpc_botInfo = 0x9cf585d,
mtpc_keyboardButton = 0xa2fa4880, mtpc_keyboardButton = 0xa2fa4880,
mtpc_keyboardButtonRow = 0x77608b83, mtpc_keyboardButtonRow = 0x77608b83,
mtpc_replyKeyboardMarkup = 0xd59bfc31, mtpc_replyKeyboardMarkup = 0x3502758c,
mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsg = 0xcb9f372d,
mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_invokeAfterMsgs = 0x3dc4b4f0,
mtpc_auth_checkPhone = 0x6fe51dfb, mtpc_auth_checkPhone = 0x6fe51dfb,
@ -511,7 +511,8 @@ enum {
mtpc_messages_importChatInvite = 0x6c50051c, mtpc_messages_importChatInvite = 0x6c50051c,
mtpc_messages_getStickerSet = 0x2619a90e, mtpc_messages_getStickerSet = 0x2619a90e,
mtpc_messages_installStickerSet = 0xefbbfae9, mtpc_messages_installStickerSet = 0xefbbfae9,
mtpc_messages_uninstallStickerSet = 0xf96e55de mtpc_messages_uninstallStickerSet = 0xf96e55de,
mtpc_messages_startBot = 0x1b3e0ffc
}; };
// Type forward declarations // Type forward declarations
@ -8005,7 +8006,7 @@ public:
private: private:
explicit MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data); explicit MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data);
friend MTPreplyMarkup MTP_replyKeyboardMarkup(const MTPVector<MTPKeyboardButtonRow> &_rows); friend MTPreplyMarkup MTP_replyKeyboardMarkup(MTPint _flags, const MTPVector<MTPKeyboardButtonRow> &_rows);
}; };
typedef MTPBoxed<MTPreplyMarkup> MTPReplyMarkup; typedef MTPBoxed<MTPreplyMarkup> MTPReplyMarkup;
@ -11259,9 +11260,10 @@ class MTPDreplyKeyboardMarkup : public mtpDataImpl<MTPDreplyKeyboardMarkup> {
public: public:
MTPDreplyKeyboardMarkup() { MTPDreplyKeyboardMarkup() {
} }
MTPDreplyKeyboardMarkup(const MTPVector<MTPKeyboardButtonRow> &_rows) : vrows(_rows) { MTPDreplyKeyboardMarkup(MTPint _flags, const MTPVector<MTPKeyboardButtonRow> &_rows) : vflags(_flags), vrows(_rows) {
} }
MTPint vflags;
MTPVector<MTPKeyboardButtonRow> vrows; MTPVector<MTPKeyboardButtonRow> 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<MTPmessages_startBot> {
public:
MTPmessages_StartBot() {
}
MTPmessages_StartBot(const MTPmessages_startBot &v) : MTPBoxed<MTPmessages_startBot>(v) {
}
MTPmessages_StartBot(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed<MTPmessages_startBot>(from, end, cons) {
}
MTPmessages_StartBot(const MTPInputUser &_bot, MTPint _chat_id, const MTPlong &_random_id, const MTPstring &_start_param) : MTPBoxed<MTPmessages_startBot>(MTPmessages_startBot(_bot, _chat_id, _random_id, _start_param)) {
}
};
// Inline methods definition // Inline methods definition
inline MTPresPQ::MTPresPQ() : mtpDataOwner(new MTPDresPQ()) { inline MTPresPQ::MTPresPQ() : mtpDataOwner(new MTPDresPQ()) {
@ -25869,7 +25919,7 @@ inline MTPreplyMarkup::MTPreplyMarkup() : mtpDataOwner(new MTPDreplyKeyboardMark
inline uint32 MTPreplyMarkup::innerLength() const { inline uint32 MTPreplyMarkup::innerLength() const {
const MTPDreplyKeyboardMarkup &v(c_replyKeyboardMarkup()); const MTPDreplyKeyboardMarkup &v(c_replyKeyboardMarkup());
return v.vrows.innerLength(); return v.vflags.innerLength() + v.vrows.innerLength();
} }
inline mtpTypeId MTPreplyMarkup::type() const { inline mtpTypeId MTPreplyMarkup::type() const {
return mtpc_replyKeyboardMarkup; return mtpc_replyKeyboardMarkup;
@ -25879,16 +25929,18 @@ inline void MTPreplyMarkup::read(const mtpPrime *&from, const mtpPrime *end, mtp
if (!data) setData(new MTPDreplyKeyboardMarkup()); if (!data) setData(new MTPDreplyKeyboardMarkup());
MTPDreplyKeyboardMarkup &v(_replyKeyboardMarkup()); MTPDreplyKeyboardMarkup &v(_replyKeyboardMarkup());
v.vflags.read(from, end);
v.vrows.read(from, end); v.vrows.read(from, end);
} }
inline void MTPreplyMarkup::write(mtpBuffer &to) const { inline void MTPreplyMarkup::write(mtpBuffer &to) const {
const MTPDreplyKeyboardMarkup &v(c_replyKeyboardMarkup()); const MTPDreplyKeyboardMarkup &v(c_replyKeyboardMarkup());
v.vflags.write(to);
v.vrows.write(to); v.vrows.write(to);
} }
inline MTPreplyMarkup::MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data) : mtpDataOwner(_data) { inline MTPreplyMarkup::MTPreplyMarkup(MTPDreplyKeyboardMarkup *_data) : mtpDataOwner(_data) {
} }
inline MTPreplyMarkup MTP_replyKeyboardMarkup(const MTPVector<MTPKeyboardButtonRow> &_rows) { inline MTPreplyMarkup MTP_replyKeyboardMarkup(MTPint _flags, const MTPVector<MTPKeyboardButtonRow> &_rows) {
return MTPreplyMarkup(new MTPDreplyKeyboardMarkup(_rows)); return MTPreplyMarkup(new MTPDreplyKeyboardMarkup(_flags, _rows));
} }
// Human-readable text serialization // Human-readable text serialization

View file

@ -602,7 +602,7 @@ keyboardButton#a2fa4880 text:string = KeyboardButton;
keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow; keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
replyKeyboardMarkup#d59bfc31 rows:Vector<KeyboardButtonRow> = ReplyMarkup; replyKeyboardMarkup#3502758c flags:# rows:Vector<KeyboardButtonRow> = ReplyMarkup;
---functions--- ---functions---
@ -766,3 +766,4 @@ messages.importChatInvite#6c50051c hash:string = Updates;
messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet; messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
messages.installStickerSet#efbbfae9 stickerset:InputStickerSet = Bool; messages.installStickerSet#efbbfae9 stickerset:InputStickerSet = Bool;
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool; messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates;

View file

@ -101,6 +101,24 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, const Pee
_invitationLink.setAcceptBoth(true); _invitationLink.setAcceptBoth(true);
updateInvitationLink(); 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(&_botSettings, SIGNAL(clicked()), this, SLOT(onBotSettings()));
connect(&_botHelp, SIGNAL(clicked()), this, SLOT(onBotHelp())); connect(&_botHelp, SIGNAL(clicked()), this, SLOT(onBotHelp()));
@ -633,7 +651,7 @@ void ProfileInner::paintEvent(QPaintEvent *e) {
} else { } else {
p.setPen(st::btnDefLink.color->p); 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; top += fullCnt * _pHeight;
@ -685,7 +703,7 @@ void ProfileInner::updateSelected() {
if (newSelected >= 0 && newSelected < _participants.size()) { if (newSelected >= 0 && newSelected < _participants.size()) {
ParticipantData *data = _participantsData[newSelected]; ParticipantData *data = _participantsData[newSelected];
if (data && data->cankick) { 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)) { if ((lp.x() >= _left + _width - _kickWidth) && (lp.x() < _left + _width) && (lp.y() >= top) && (lp.y() < top + st::linkFont->height)) {
newKickOver = _participants[newSelected]; newKickOver = _participants[newSelected];
} }
@ -804,11 +822,14 @@ void ProfileInner::resizeEvent(QResizeEvent *e) {
top += st::profilePhotoSize; top += st::profilePhotoSize;
top += st::profileButtonTop; top += st::profileButtonTop;
_uploadPhoto.setGeometry(_left, top, btnWidth, _uploadPhoto.height()); _uploadPhoto.setGeometry(_left, top, btnWidth, _uploadPhoto.height());
_sendMessage.setGeometry(_left, top, btnWidth, _sendMessage.height());
_addParticipant.setGeometry(_left + _width - btnWidth, top, btnWidth, _addParticipant.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()); _shareContact.setGeometry(_left + _width - btnWidth, top, btnWidth, _shareContact.height());
_inviteToGroup.setGeometry(_left + _width - btnWidth, top, btnWidth, _inviteToGroup.height()); _inviteToGroup.setGeometry(_left + _width - btnWidth, top, btnWidth, _inviteToGroup.height());
top += _shareContact.height(); top += _shareContact.height();
// about // about

View file

@ -11,7 +11,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>0.8.25</string> <string>0.8.26</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string> <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>

Binary file not shown.

View file

@ -1703,7 +1703,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.25; CURRENT_PROJECT_VERSION = 0.8.26;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
@ -1721,7 +1721,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 0.8.25; CURRENT_PROJECT_VERSION = 0.8.26;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = fast; GCC_OPTIMIZATION_LEVEL = fast;
GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h;
@ -1747,10 +1747,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.25; CURRENT_PROJECT_VERSION = 0.8.26;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 0.8; DYLIB_COMPATIBILITY_VERSION = 0.8;
DYLIB_CURRENT_VERSION = 0.8.25; DYLIB_CURRENT_VERSION = 0.8.26;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
@ -1890,10 +1890,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = ""; CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.8.25; CURRENT_PROJECT_VERSION = 0.8.26;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 0.8; DYLIB_COMPATIBILITY_VERSION = 0.8;
DYLIB_CURRENT_VERSION = 0.8.25; DYLIB_CURRENT_VERSION = 0.8.26;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES;

View file

@ -1,2 +1,2 @@
echo 8025 0.8.25 1 echo 8026 0.8.26 1
# AppVersion AppVersionStr DevChannel # AppVersion AppVersionStr DevChannel