2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +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

@@ -91,7 +91,15 @@ void ContactsInner::onPeerNameChanged(PeerData *peer, const PeerData::Names &old
}
void ContactsInner::onAddBot() {
App::main()->addParticipants(_addToChat, QVector<UserData*>(1, _bot));
if (_bot->botInfo && !_bot->botInfo->startGroupToken.isEmpty()) {
uint64 randomId = MTP::nonce<uint64>();
MTP::send(MTPmessages_StartBot(_bot->inputUser, MTP_int(App::chatFromPeer(_addToChat->id)), MTP_long(randomId), MTP_string(_bot->botInfo->startGroupToken)), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::addParticipantFail, _bot));
App::wnd()->hideLayer();
App::main()->showPeer(_addToChat->id, 0, false);
} else {
App::main()->addParticipants(_addToChat, QVector<UserData*>(1, _bot));
}
}
void ContactsInner::peerUpdated(PeerData *peer) {
@@ -738,7 +746,10 @@ ContactsInner::~ContactsInner() {
for (ContactsData::iterator i = _contactsData.begin(), e = _contactsData.end(); i != e; ++i) {
delete *i;
}
if (_bot) delete _contacts;
if (_bot) {
delete _contacts;
if (_bot->botInfo) _bot->botInfo->startGroupToken = QString();
}
}
void ContactsInner::resizeEvent(QResizeEvent *e) {