本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_account_getPassword方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_account_getPassword方法的具体用法?Java TLRPC.TL_account_getPassword怎么用?Java TLRPC.TL_account_getPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_account_getPassword方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadPasswordInfo
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void loadPasswordInfo(final boolean silent) {
if (!silent) {
loading = true;
}
TLRPC.TL_account_getPassword req = new TLRPC.TL_account_getPassword();
ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
@Override
public void run(final TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
loading = false;
if (error == null) {
if (!silent) {
passwordEntered = currentPassword != null || response instanceof TLRPC.TL_account_noPassword;
}
currentPassword = (TLRPC.account_Password) response;
waitingForEmail = currentPassword.email_unconfirmed_pattern.length() > 0;
byte[] salt = new byte[currentPassword.new_salt.length + 8];
Utilities.random.nextBytes(salt);
System.arraycopy(currentPassword.new_salt, 0, salt, 0, currentPassword.new_salt.length);
currentPassword.new_salt = salt;
}
if (type == 0 && !destroyed && shortPollRunnable == null) {
shortPollRunnable = new Runnable() {
@Override
public void run() {
if (shortPollRunnable == null) {
return;
}
loadPasswordInfo(true);
shortPollRunnable = null;
}
};
AndroidUtilities.runOnUIThread(shortPollRunnable, 5000);
}
updateRows();
}
});
}
}, ConnectionsManager.RequestFlagFailOnServerErrors | ConnectionsManager.RequestFlagWithoutLogin);
}