当前位置: 首页>>代码示例>>Java>>正文


Java TLRPC.TL_account_updateProfile方法代码示例

本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_account_updateProfile方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_account_updateProfile方法的具体用法?Java TLRPC.TL_account_updateProfile怎么用?Java TLRPC.TL_account_updateProfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.telegram.tgnet.TLRPC的用法示例。


在下文中一共展示了TLRPC.TL_account_updateProfile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveName

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void saveName() {
    TLRPC.User currentUser = UserConfig.getCurrentUser();
    if (currentUser == null || lastNameField.getText() == null || firstNameField.getText() == null) {
        return;
    }
    String newFirst = firstNameField.getText().toString();
    String newLast = lastNameField.getText().toString();
    if (currentUser.first_name != null && currentUser.first_name.equals(newFirst) && currentUser.last_name != null && currentUser.last_name.equals(newLast)) {
        return;
    }
    TLRPC.TL_account_updateProfile req = new TLRPC.TL_account_updateProfile();
    req.flags = 3;
    currentUser.first_name = req.first_name = newFirst;
    currentUser.last_name = req.last_name = newLast;
    TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId());
    if (user != null) {
        user.first_name = req.first_name;
        user.last_name = req.last_name;
    }
    UserConfig.saveConfig(true);
    NotificationCenter.getInstance().postNotificationName(NotificationCenter.mainUserInfoChanged);
    NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, MessagesController.UPDATE_MASK_NAME);
    ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
        @Override
        public void run(TLObject response, TLRPC.TL_error error) {

        }
    });
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:30,代码来源:ChangeNameActivity.java

示例2: saveAbout

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void saveAbout() {
    TLRPC.User currentUser = UserConfig.getCurrentUser();
    String about = MessagesController.getInstance().getUserAbout(currentUser.id);
    if (aboutField.getText() == null) {
        return;
    }
    String newAbout = aboutField.getText().toString();
    if (about != null && about.equals(newAbout)) {
        return;
    }
    TLRPC.TL_account_updateProfile req = new TLRPC.TL_account_updateProfile();
    req.flags |= 4;
    req.about = newAbout;

    ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
        @Override
        public void run(TLObject response, TLRPC.TL_error error) {
            if(error != null){
                Log.e("ChangeNameAbout","error " + error.toString());
            }
            if(response != null){
                Log.e("ChangeNameAbout","response " + response.toString());
                MessagesController.getInstance().loadFullUser(UserConfig.getCurrentUser(), classGuid, true);
                AndroidUtilities.runOnUIThread(new Runnable() {
                    @Override
                    public void run() {
                        NotificationCenter.getInstance().postNotificationName(NotificationCenter.userInfoDidLoaded, UserConfig.getCurrentUser().id);
                        UserConfig.saveConfig(true);
                    }
                });
            }
        }
    });
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:35,代码来源:ChangeAboutActivity.java

示例3: saveName

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void saveName() {
    TLRPC.User currentUser = UserConfig.getCurrentUser();
    if (currentUser == null || lastNameField.getText() == null || firstNameField.getText() == null) {
        return;
    }
    String newFirst = firstNameField.getText().toString();
    String newLast = lastNameField.getText().toString();
    if (currentUser.first_name != null && currentUser.first_name.equals(newFirst) && currentUser.last_name != null && currentUser.last_name.equals(newLast)) {
        return;
    }
    TLRPC.TL_account_updateProfile req = new TLRPC.TL_account_updateProfile();
    req.flags = 7;//3;
    currentUser.first_name = req.first_name = newFirst;
    currentUser.last_name = req.last_name = newLast;
    //req.about = "Esto es un test desde HastiGram";
    req.about = "This is a test from HastiGram";
    TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId());
    if (user != null) {
        user.first_name = req.first_name;
        user.last_name = req.last_name;
    }
    UserConfig.saveConfig(true);
    NotificationCenter.getInstance().postNotificationName(NotificationCenter.mainUserInfoChanged);
    NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, MessagesController.UPDATE_MASK_NAME);
    ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
        @Override
        public void run(TLObject response, TLRPC.TL_error error) {
            if(response != null) Log.e("saveName","response " + response.toString());
            if(error != null)Log.e("saveName","error " + error.text);
        }
    });
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:33,代码来源:ChangeNameActivity.java


注:本文中的org.telegram.tgnet.TLRPC.TL_account_updateProfile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。