2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

version 0.8.27.dev ready

This commit is contained in:
John Preston
2015-06-17 22:43:03 +03:00
parent 52ea153c31
commit c291bf0861
26 changed files with 480 additions and 155 deletions

View File

@@ -1977,12 +1977,15 @@ namespace App {
void feedReplyMarkup(MsgId msgId, const MTPReplyMarkup &markup) {
ReplyMarkup data;
ReplyMarkup::Commands &commands(data.commands);
switch (markup.type()) {
case mtpc_replyKeyboardMarkup: {
const MTPDreplyKeyboardMarkup &d(markup.c_replyKeyboardMarkup());
data.flags = d.vflags.v;
const QVector<MTPKeyboardButtonRow> &v(d.vrows.c_vector().v);
if (!v.isEmpty()) {
data.reserve(v.size());
commands.reserve(v.size());
for (int32 i = 0, l = v.size(); i < l; ++i) {
switch (v.at(i).type()) {
case mtpc_keyboardButtonRow: {
@@ -1998,12 +2001,12 @@ namespace App {
} break;
}
}
if (!btns.isEmpty()) data.push_back(btns);
if (!btns.isEmpty()) commands.push_back(btns);
}
} break;
}
}
if (!data.isEmpty()) {
if (!commands.isEmpty()) {
replyMarkups.insert(msgId, data);
}
}
@@ -2016,7 +2019,7 @@ namespace App {
}
const ReplyMarkup &replyMarkup(MsgId msgId) {
static ReplyMarkup zeroMarkup;
static ReplyMarkup zeroMarkup(MTPDreplyKeyboardMarkup_flag_ZERO);
ReplyMarkups::const_iterator i = replyMarkups.constFind(msgId);
if (i == replyMarkups.cend()) return zeroMarkup;
return i.value();
@@ -2046,15 +2049,21 @@ namespace App {
}
}
void insertBotCommand(const QString &cmd) {
if (App::main()) {
App::main()->insertBotCommand(cmd);
}
}
void searchByHashtag(const QString &tag) {
if (App::main()) {
App::main()->searchMessages(tag + ' ');
}
}
void openUserByName(const QString &username, bool toProfile, const QString &start, const QString &startToken) {
void openUserByName(const QString &username, bool toProfile, const QString &startToken) {
if (App::main()) {
App::main()->openUserByName(username, toProfile, start, startToken);
App::main()->openUserByName(username, toProfile, startToken);
}
}