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

Use UserData::isBot where applicable.

This commit is contained in:
John Preston
2019-07-18 10:51:11 +02:00
parent a7d9aa947b
commit 873b77cf40
29 changed files with 105 additions and 95 deletions

View File

@@ -58,10 +58,10 @@ void ShareBotGame(not_null<UserData*> bot, not_null<PeerData*> chat) {
}
void AddBotToGroup(not_null<UserData*> bot, not_null<PeerData*> chat) {
if (bot->botInfo && !bot->botInfo->startGroupToken.isEmpty()) {
Auth().api().sendBotStart(bot, chat);
if (bot->isBot() && !bot->botInfo->startGroupToken.isEmpty()) {
chat->session().api().sendBotStart(bot, chat);
} else {
Auth().api().addChatParticipants(chat, { 1, bot });
chat->session().api().addChatParticipants(chat, { 1, bot });
}
Ui::hideLayer();
Ui::showPeerHistory(chat, ShowAtUnreadMsgId);
@@ -474,7 +474,7 @@ bool AddBotToGroupBoxController::needToCreateRow(
}
bool AddBotToGroupBoxController::SharingBotGame(not_null<UserData*> bot) {
auto &info = bot->botInfo;
const auto &info = bot->botInfo;
return (info && !info->shareGameShortName.isEmpty());
}