本文整理汇总了C++中rpcDone函数的典型用法代码示例。如果您正苦于以下问题:C++ rpcDone函数的具体用法?C++ rpcDone怎么用?C++ rpcDone使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rpcDone函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: rpcDone
void ApiWrap::requestFullPeer(PeerData *peer) {
if (!peer || _fullPeerRequests.contains(peer)) return;
mtpRequestId req;
if (peer->chat) {
req = MTP::send(MTPmessages_GetFullChat(MTP_int(App::chatFromPeer(peer->id))), rpcDone(&ApiWrap::gotChatFull, peer), rpcFail(&ApiWrap::gotPeerFullFailed, peer));
} else {
req = MTP::send(MTPusers_GetFullUser(peer->asUser()->inputUser), rpcDone(&ApiWrap::gotUserFull, peer), rpcFail(&ApiWrap::gotPeerFullFailed, peer));
}
_fullPeerRequests.insert(peer, req);
}
开发者ID:behnaaz,项目名称:tdesktop,代码行数:11,代码来源:apiwrap.cpp
示例2: rpcDone
void ApiWrap::requestFullPeer(PeerData *peer) {
if (!peer || _fullPeerRequests.contains(peer)) return;
mtpRequestId req = 0;
if (peer->isUser()) {
req = MTP::send(MTPusers_GetFullUser(peer->asUser()->inputUser), rpcDone(&ApiWrap::gotUserFull, peer), rpcFail(&ApiWrap::gotPeerFullFailed, peer));
} else if (peer->isChat()) {
req = MTP::send(MTPmessages_GetFullChat(peer->asChat()->inputChat), rpcDone(&ApiWrap::gotChatFull, peer), rpcFail(&ApiWrap::gotPeerFullFailed, peer));
} else if (peer->isChannel()) {
req = MTP::send(MTPchannels_GetFullChannel(peer->asChannel()->inputChannel), rpcDone(&ApiWrap::gotChatFull, peer), rpcFail(&ApiWrap::gotPeerFullFailed, peer));
}
if (req) _fullPeerRequests.insert(peer, req);
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:13,代码来源:apiwrap.cpp
示例3: fullNumber
void PhoneWidget::submit() {
if (_sentRequest || isHidden()) return;
const auto phone = fullNumber();
if (!AllowPhoneAttempt(phone)) {
showPhoneError(langFactory(lng_bad_phone));
_phone->setFocus();
return;
}
hidePhoneError();
_checkRequest->start(1000);
_sentPhone = phone;
Core::App().mtp()->setUserPhone(_sentPhone);
//_sentRequest = MTP::send(MTPauth_CheckPhone(MTP_string(_sentPhone)), rpcDone(&PhoneWidget::phoneCheckDone), rpcFail(&PhoneWidget::phoneSubmitFail));
_sentRequest = MTP::send(
MTPauth_SendCode(
MTP_string(_sentPhone),
MTP_int(ApiId),
MTP_string(ApiHash),
MTP_codeSettings(
MTP_flags(0),
MTPstring())),
rpcDone(&PhoneWidget::phoneSubmitDone),
rpcFail(&PhoneWidget::phoneSubmitFail));
}
开发者ID:JuanPotato,项目名称:tdesktop,代码行数:28,代码来源:introphone.cpp
示例4: unixtime
void ApiWrap::resolveWebPages() {
QVector<MTPint> ids;
const WebPageItems &items(App::webPageItems());
ids.reserve(_webPagesPending.size());
int32 t = unixtime(), m = INT_MAX;
for (WebPagesPending::const_iterator i = _webPagesPending.cbegin(), e = _webPagesPending.cend(); i != e; ++i) {
if (i.value()) continue;
if (i.key()->pendingTill <= t) {
WebPageItems::const_iterator j = items.constFind(i.key());
if (j != items.cend() && !j.value().isEmpty()) {
ids.push_back(MTP_int(j.value().begin().key()->id));
}
} else {
m = qMin(m, i.key()->pendingTill - t);
}
}
if (!ids.isEmpty()) {
mtpRequestId req = MTP::send(MTPmessages_GetMessages(MTP_vector<MTPint>(ids)), rpcDone(&ApiWrap::gotWebPages));
for (WebPagesPending::iterator i = _webPagesPending.begin(); i != _webPagesPending.cend(); ++i) {
if (i.value()) continue;
if (i.key()->pendingTill <= t) {
i.value() = req;
}
}
}
if (m < INT_MAX) _webPagesTimer.start(m * 1000);
}
开发者ID:behnaaz,项目名称:tdesktop,代码行数:27,代码来源:apiwrap.cpp
示例5: requestPeers
void ApiWrap::requestPeers(const QList<PeerData*> &peers) {
QVector<MTPint> chats;
QVector<MTPInputUser> users;
chats.reserve(peers.size());
users.reserve(peers.size());
for (QList<PeerData*>::const_iterator i = peers.cbegin(), e = peers.cend(); i != e; ++i) {
if (!*i || _fullPeerRequests.contains(*i) || _peerRequests.contains(*i)) continue;
if ((*i)->chat) {
chats.push_back(MTP_int(App::chatFromPeer((*i)->id)));
} else {
users.push_back((*i)->asUser()->inputUser);
}
}
if (!chats.isEmpty()) MTP::send(MTPmessages_GetChats(MTP_vector<MTPint>(chats)), rpcDone(&ApiWrap::gotChats));
if (!users.isEmpty()) MTP::send(MTPusers_GetUsers(MTP_vector<MTPInputUser>(users)), rpcDone(&ApiWrap::gotUsers));
}
开发者ID:noikiy,项目名称:tdesktop,代码行数:16,代码来源:apiwrap.cpp
示例6: showPhoneError
void PhoneWidget::submit() {
if (_sentRequest || isHidden()) return;
if (!App::isValidPhone(fullNumber())) {
showPhoneError(langFactory(lng_bad_phone));
_phone->setFocus();
return;
}
hidePhoneError();
_checkRequest->start(1000);
_sentPhone = fullNumber();
Messenger::Instance().mtp()->setUserPhone(_sentPhone);
//_sentRequest = MTP::send(MTPauth_CheckPhone(MTP_string(_sentPhone)), rpcDone(&PhoneWidget::phoneCheckDone), rpcFail(&PhoneWidget::phoneSubmitFail));
_sentRequest = MTP::send(
MTPauth_SendCode(
MTP_flags(0),
MTP_string(_sentPhone),
MTPBool(),
MTP_int(ApiId),
MTP_string(ApiHash)),
rpcDone(&PhoneWidget::phoneSubmitDone),
rpcFail(&PhoneWidget::phoneSubmitFail));
}
开发者ID:aykutalparslan,项目名称:tdesktop,代码行数:26,代码来源:introphone.cpp
示例7: rpcDone
void SessionsBox::onAllTerminated() {
MTP::send(MTPaccount_GetAuthorizations(), rpcDone(&SessionsBox::gotAuthorizations));
if (_shortPollRequest) {
MTP::cancel(_shortPollRequest);
_shortPollRequest = 0;
}
}
开发者ID:absalan,项目名称:tdesktop,代码行数:7,代码来源:sessions_box.cpp
示例8: collectMessageIds
void ApiWrap::resolveReplyTo() {
if (_replyToRequests.isEmpty() && _channelReplyToRequests.isEmpty()) return;
MessageIds ids = collectMessageIds(_replyToRequests);
if (!ids.isEmpty()) {
mtpRequestId req = MTP::send(MTPmessages_GetMessages(MTP_vector<MTPint>(ids)), rpcDone(&ApiWrap::gotReplyTo, (ChannelData*)0), RPCFailHandlerPtr(), 0, 5);
for (ReplyToRequests::iterator i = _replyToRequests.begin(); i != _replyToRequests.cend(); ++i) {
if (i.value().req > 0) continue;
i.value().req = req;
}
}
for (ChannelReplyToRequests::iterator j = _channelReplyToRequests.begin(); j != _channelReplyToRequests.cend();) {
if (j->isEmpty()) {
j = _channelReplyToRequests.erase(j);
continue;
}
MessageIds ids = collectMessageIds(j.value());
if (!ids.isEmpty()) {
mtpRequestId req = MTP::send(MTPchannels_GetMessages(j.key()->inputChannel, MTP_vector<MTPint>(ids)), rpcDone(&ApiWrap::gotReplyTo, j.key()), RPCFailHandlerPtr(), 0, 5);
for (ReplyToRequests::iterator i = j->begin(); i != j->cend(); ++i) {
if (i.value().req > 0) continue;
i.value().req = req;
}
}
++j;
}
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:27,代码来源:apiwrap.cpp
示例9: TWidget
IntroWidget::IntroWidget(QWidget *parent) : TWidget(parent)
, _a_stage(animation(this, &IntroWidget::step_stage))
, _a_show(animation(this, &IntroWidget::step_show))
, _back(this, st::setClose) {
setGeometry(QRect(0, st::titleHeight, App::wnd()->width(), App::wnd()->height() - st::titleHeight));
connect(&_back, SIGNAL(clicked()), this, SLOT(onBack()));
_back.hide();
_countryForReg = psCurrentCountry();
MTP::send(MTPhelp_GetNearestDc(), rpcDone(&IntroWidget::gotNearestDC));
_stepHistory.push_back(new IntroStart(this));
_back.raise();
connect(parent, SIGNAL(resized(const QSize&)), this, SLOT(onParentResize(const QSize&)));
show();
setFocus();
cSetPasswordRecovered(false);
_back.move(st::setClosePos.x(), st::setClosePos.y());
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
Sandbox::startUpdateCheck();
#endif
}
开发者ID:OpenGelo,项目名称:tdesktop,代码行数:29,代码来源:introwidget.cpp
示例10: rpcDone
void MTProtoConfigLoader::load() {
if (loadingConfig) return;
loadingConfig = true;
MTP::send(MTPhelp_GetConfig(), rpcDone(configLoaded), rpcFail(configFailed));
_enumDCTimer.start(MTPEnumDCTimeout);
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:8,代码来源:mtpDC.cpp
示例11: MTP_string
void ConfirmPhoneBox::onCallStatusTimer() {
if (_callStatus.state == CallState::Waiting) {
if (--_callStatus.timeout <= 0) {
_callStatus.state = CallState::Calling;
_callTimer->stop();
MTP::send(MTPauth_ResendCode(MTP_string(_phone), MTP_string(_phoneHash)), rpcDone(&ConfirmPhoneBox::callDone));
}
}
update();
}
开发者ID:Drru97,项目名称:tdesktop,代码行数:10,代码来源:confirmphonebox.cpp
示例12: getName
void UsernameBox::onCheck() {
if (_checkRequest) {
MTP::cancel(_checkRequest);
}
QString name = getName();
if (name.size() >= MinUsernameLength) {
_checkUsername = getName();
_checkRequest = MTP::send(MTPaccount_CheckUsername(MTP_string(name)), rpcDone(&UsernameBox::onCheckDone), rpcFail(&UsernameBox::onCheckFail));
}
}
开发者ID:09120898371,项目名称:tdesktop,代码行数:10,代码来源:usernamebox.cpp
示例13: _bgCount
BackgroundInner::BackgroundInner() :
_bgCount(0), _rows(0), _over(-1), _overDown(-1) {
if (App::cServerBackgrounds().isEmpty()) {
resize(BackgroundsInRow * (st::backgroundSize.width() + st::backgroundPadding) + st::backgroundPadding, 2 * (st::backgroundSize.height() + st::backgroundPadding) + st::backgroundPadding);
MTP::send(MTPaccount_GetWallPapers(), rpcDone(&BackgroundInner::gotWallpapers));
} else {
updateWallpapers();
}
setMouseTracking(true);
}
开发者ID:noscripter,项目名称:tdesktop,代码行数:10,代码来源:backgroundbox.cpp
示例14: _loaded
StickerSetInner::StickerSetInner(const MTPInputStickerSet &set) :
_loaded(false), _setId(0), _setAccess(0), _setCount(0), _setHash(0), _setFlags(0), _bottom(0),
_input(set), _installRequest(0), _panel(0) {
switch (set.type()) {
case mtpc_inputStickerSetID: _setId = set.c_inputStickerSetID().vid.v; _setAccess = set.c_inputStickerSetID().vaccess_hash.v; break;
case mtpc_inputStickerSetShortName: _setShortName = qs(set.c_inputStickerSetShortName().vshort_name); break;
}
MTP::send(MTPmessages_GetStickerSet(_input), rpcDone(&StickerSetInner::gotSet), rpcFail(&StickerSetInner::failedSet));
cSetLastStickersUpdate(0);
App::main()->updateStickers();
}
开发者ID:noscripter,项目名称:tdesktop,代码行数:11,代码来源:stickersetbox.cpp
示例15: lang
void SessionsBox::Inner::onTerminateAll() {
if (_terminateBox) _terminateBox->deleteLater();
_terminateBox = Ui::show(Box<ConfirmBox>(lang(lng_settings_reset_sure), lang(lng_settings_reset_button), st::attentionBoxButton, base::lambda_guarded(this, [this] {
if (_terminateBox) {
_terminateBox->closeBox();
_terminateBox = nullptr;
}
MTP::send(MTPauth_ResetAuthorizations(), rpcDone(&Inner::terminateAllDone), rpcFail(&Inner::terminateAllFail));
emit terminateAll();
})), LayerOption::KeepOther);
}
开发者ID:absalan,项目名称:tdesktop,代码行数:11,代码来源:sessions_box.cpp
示例16: mtpLogoutOtherDCs
void mtpLogoutOtherDCs() {
QList<int32> dcs;
{
QMutexLocker lock(&_keysMapForWriteMutex);
dcs = _keysMapForWrite.keys();
}
for (int32 i = 0, cnt = dcs.size(); i != cnt; ++i) {
if (dcs[i] != MTP::maindc()) {
logoutGuestMap.insert(MTP::lgt + dcs[i], MTP::send(MTPauth_LogOut(), rpcDone(&logoutDone), rpcFail(&logoutDone), MTP::lgt + dcs[i]));
}
}
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:12,代码来源:mtpDC.cpp
示例17: rpcDone
void IntroPwdCheck::onSubmitPwd(bool force) {
if (sentRequest) return;
if (_pwdField.isHidden()) {
if (!force && !_codeField.isEnabled()) return;
QString code = _codeField.text().trimmed();
if (code.isEmpty()) {
_codeField.notaBene();
return;
}
sentRequest = MTP::send(MTPauth_RecoverPassword(MTP_string(code)), rpcDone(&IntroPwdCheck::pwdSubmitDone, true), rpcFail(&IntroPwdCheck::codeSubmitFail));
} else {
if (!force && !_pwdField.isEnabled()) return;
_pwdField.setDisabled(true);
setFocus();
showError("");
QByteArray pwdData = _salt + _pwdField.text().toUtf8() + _salt, pwdHash(32, Qt::Uninitialized);
hashSha256(pwdData.constData(), pwdData.size(), pwdHash.data());
sentRequest = MTP::send(MTPauth_CheckPassword(MTP_string(pwdHash)), rpcDone(&IntroPwdCheck::pwdSubmitDone, false), rpcFail(&IntroPwdCheck::pwdSubmitFail));
}
}
开发者ID:0ps,项目名称:telegram,代码行数:24,代码来源:intropwdcheck.cpp
示例18: showPhoneError
void PhoneWidget::submit() {
if (_sentRequest || isHidden()) return;
if (!App::isValidPhone(fullNumber())) {
showPhoneError(langFactory(lng_bad_phone));
_phone->setFocus();
return;
}
hidePhoneError();
_checkRequest->start(1000);
_sentPhone = fullNumber();
_sentRequest = MTP::send(MTPauth_CheckPhone(MTP_string(_sentPhone)), rpcDone(&PhoneWidget::phoneCheckDone), rpcFail(&PhoneWidget::phoneSubmitFail));
}
开发者ID:absalan,项目名称:tdesktop,代码行数:16,代码来源:introphone.cpp
示例19: showError
void IntroPhone::onSubmitPhone() {
if (sentRequest || isHidden()) return;
if (!App::isValidPhone(fullNumber())) {
showError(lang(lng_bad_phone));
phone.setFocus();
return;
}
disableAll();
showError(QString());
checkRequest.start(1000);
sentPhone = fullNumber();
sentRequest = MTP::send(MTPauth_CheckPhone(MTP_string(sentPhone)), rpcDone(&IntroPhone::phoneCheckDone), rpcFail(&IntroPhone::phoneSubmitFail));
}
开发者ID:4ker,项目名称:tdesktop,代码行数:17,代码来源:introphone.cpp
示例20: QWidget
IntroWidget::IntroWidget(Window *window) : QWidget(window),
wnd(window), cacheForHideInd(0), cacheForShowInd(0), _callTimeout(60),
steps(new IntroSteps(this)), phone(0), code(0), signup(0), current(0), moving(0), visibilityChanging(0) {
setGeometry(QRect(0, st::titleHeight, wnd->width(), wnd->height() - st::titleHeight));
countryForReg = psCurrentCountry();
MTP::send(MTPhelp_GetNearestDc(), rpcDone(gotNearestDC));
signalEmitOn = this;
stages[0] = steps;
memset(stages + 1, 0, sizeof(QWidget*) * 3);
connect(window, SIGNAL(resized(const QSize &)), this, SLOT(onParentResize(const QSize &)));
show();
setFocus();
}
开发者ID:Freyja-Folkvangr,项目名称:tdesktop,代码行数:18,代码来源:intro.cpp
注:本文中的rpcDone函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论