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


Java TLRPC.TL_config方法代码示例

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


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

示例1: updateConfig

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void updateConfig(final TLRPC.TL_config config) {
    AndroidUtilities.runOnUIThread(new Runnable() {
        @Override
        public void run() {
            //maxBroadcastCount = config.broadcast_size_max;
            maxMegagroupCount = config.megagroup_size_max;
            maxGroupCount = config.chat_size_max;
            groupBigSize = config.chat_big_size;
            disabledFeatures = config.disabled_features;
            maxEditTime = config.edit_time_limit;
            ratingDecay = config.rating_e_decay;

            SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
            SharedPreferences.Editor editor = preferences.edit();
            editor.putInt("maxGroupCount", maxGroupCount);
            //editor.putInt("maxBroadcastCount", maxBroadcastCount);
            editor.putInt("maxMegagroupCount", maxMegagroupCount);
            editor.putInt("groupBigSize", groupBigSize);
            editor.putInt("maxEditTime", maxEditTime);
            editor.putInt("ratingDecay", ratingDecay);
            try {
                SerializedData data = new SerializedData();
                data.writeInt32(disabledFeatures.size());
                for (TLRPC.TL_disabledFeature disabledFeature : disabledFeatures) {
                    disabledFeature.serializeToStream(data);
                }
                String string = Base64.encodeToString(data.toByteArray(), Base64.DEFAULT);
                if (string.length() != 0) {
                    editor.putString("disabledFeatures", string);
                }
            } catch (Exception e) {
                editor.remove("disabledFeatures");
                FileLog.e("tmessages", e);
            }
            editor.commit();
        }
    });
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:39,代码来源:MessagesController.java

示例2: updateConfig

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void updateConfig(final TLRPC.TL_config config) {
    AndroidUtilities.runOnUIThread(new Runnable() {
        @Override
        public void run() {
            //maxBroadcastCount = config.broadcast_size_max;
            maxMegagroupCount = config.megagroup_size_max;
            maxGroupCount = config.chat_size_max;
            groupBigSize = config.chat_big_size;
            disabledFeatures = config.disabled_features;
            maxEditTime = config.edit_time_limit;
            ratingDecay = config.rating_e_decay;
            maxRecentGifsCount = config.saved_gifs_limit;
            maxRecentStickersCount = config.stickers_recent_limit;

            SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
            SharedPreferences.Editor editor = preferences.edit();
            editor.putInt("maxGroupCount", maxGroupCount);
            //editor.putInt("maxBroadcastCount", maxBroadcastCount);
            editor.putInt("maxMegagroupCount", maxMegagroupCount);
            editor.putInt("groupBigSize", groupBigSize);
            editor.putInt("maxEditTime", maxEditTime);
            editor.putInt("ratingDecay", ratingDecay);
            editor.putInt("maxRecentGifsCount", maxRecentGifsCount);
            editor.putInt("maxRecentStickersCount", maxRecentStickersCount);
            try {
                SerializedData data = new SerializedData();
                data.writeInt32(disabledFeatures.size());
                for (TLRPC.TL_disabledFeature disabledFeature : disabledFeatures) {
                    disabledFeature.serializeToStream(data);
                }
                String string = Base64.encodeToString(data.toByteArray(), Base64.DEFAULT);
                if (string.length() != 0) {
                    editor.putString("disabledFeatures", string);
                }
            } catch (Exception e) {
                editor.remove("disabledFeatures");
                FileLog.e("tmessages", e);
            }
            editor.commit();
        }
    });
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:43,代码来源:MessagesController.java


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