mirror of https://github.com/procxx/kepka.git
Support custom forwarded text in url auth button.
This commit is contained in:
parent
db66e93258
commit
65a36e49bd
|
@ -733,9 +733,11 @@ HistoryMessageMarkupButton::HistoryMessageMarkupButton(
|
||||||
Type type,
|
Type type,
|
||||||
const QString &text,
|
const QString &text,
|
||||||
const QByteArray &data,
|
const QByteArray &data,
|
||||||
|
const QString &forwardText,
|
||||||
int32 buttonId)
|
int32 buttonId)
|
||||||
: type(type)
|
: type(type)
|
||||||
, text(text)
|
, text(text)
|
||||||
|
, forwardText(forwardText)
|
||||||
, data(data)
|
, data(data)
|
||||||
, buttonId(buttonId) {
|
, buttonId(buttonId) {
|
||||||
}
|
}
|
||||||
|
@ -806,6 +808,7 @@ void HistoryMessageReplyMarkup::createFromButtonRows(
|
||||||
Type::Auth,
|
Type::Auth,
|
||||||
qs(data.vtext),
|
qs(data.vtext),
|
||||||
qba(data.vurl),
|
qba(data.vurl),
|
||||||
|
data.has_fwd_text() ? qs(data.vfwd_text) : QString(),
|
||||||
data.vbutton_id.v);
|
data.vbutton_id.v);
|
||||||
}, [&](const MTPDinputKeyboardButtonUrlAuth &data) {
|
}, [&](const MTPDinputKeyboardButtonUrlAuth &data) {
|
||||||
LOG(("API Error: inputKeyboardButtonUrlAuth received."));
|
LOG(("API Error: inputKeyboardButtonUrlAuth received."));
|
||||||
|
@ -866,10 +869,14 @@ void HistoryMessageReplyMarkup::create(
|
||||||
const auto newType = (button.type != Type::SwitchInlineSame)
|
const auto newType = (button.type != Type::SwitchInlineSame)
|
||||||
? button.type
|
? button.type
|
||||||
: Type::SwitchInline;
|
: Type::SwitchInline;
|
||||||
|
const auto text = button.forwardText.isEmpty()
|
||||||
|
? button.text
|
||||||
|
: button.forwardText;
|
||||||
row.emplace_back(
|
row.emplace_back(
|
||||||
newType,
|
newType,
|
||||||
button.text,
|
text,
|
||||||
button.data,
|
button.data,
|
||||||
|
QString(),
|
||||||
button.buttonId);
|
button.buttonId);
|
||||||
}
|
}
|
||||||
if (!row.empty()) {
|
if (!row.empty()) {
|
||||||
|
|
|
@ -171,6 +171,7 @@ struct HistoryMessageMarkupButton {
|
||||||
Type type,
|
Type type,
|
||||||
const QString &text,
|
const QString &text,
|
||||||
const QByteArray &data = QByteArray(),
|
const QByteArray &data = QByteArray(),
|
||||||
|
const QString &forwardText = QString(),
|
||||||
int32 buttonId = 0);
|
int32 buttonId = 0);
|
||||||
|
|
||||||
static HistoryMessageMarkupButton *Get(
|
static HistoryMessageMarkupButton *Get(
|
||||||
|
@ -179,7 +180,7 @@ struct HistoryMessageMarkupButton {
|
||||||
int column);
|
int column);
|
||||||
|
|
||||||
Type type;
|
Type type;
|
||||||
QString text;
|
QString text, forwardText;
|
||||||
QByteArray data;
|
QByteArray data;
|
||||||
int32 buttonId = 0;
|
int32 buttonId = 0;
|
||||||
mutable mtpRequestId requestId = 0;
|
mutable mtpRequestId requestId = 0;
|
||||||
|
|
Loading…
Reference in New Issue