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


Java TLRPC.TL_chatFull方法代码示例

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


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

示例1: checkBotCommands

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void checkBotCommands() {
    URLSpanBotCommand.enabled = false;
    if (currentUser != null && currentUser.bot) {
        URLSpanBotCommand.enabled = true;
    } else if (info instanceof TLRPC.TL_chatFull) {
        for (int a = 0; a < info.participants.participants.size(); a++) {
            TLRPC.ChatParticipant participant = info.participants.participants.get(a);
            TLRPC.User user = MessagesController.getInstance().getUser(participant.user_id);
            if (user != null && user.bot) {
                URLSpanBotCommand.enabled = true;
                break;
            }
        }
    } else if (info instanceof TLRPC.TL_channelFull) {
        URLSpanBotCommand.enabled = !info.bot_info.isEmpty();
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:18,代码来源:ChatActivity.java

示例2: updateOnlineCount

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void updateOnlineCount() {
    onlineCount = 0;
    TLRPC.ChatFull info = parentFragment.getCurrentChatInfo();
    if (info == null) {
        return;
    }
    int currentTime = ConnectionsManager.getInstance().getCurrentTime();
    if (info instanceof TLRPC.TL_chatFull || info instanceof TLRPC.TL_channelFull && info.participants_count <= 200 && info.participants != null) {
        for (int a = 0; a < info.participants.participants.size(); a++) {
            TLRPC.ChatParticipant participant = info.participants.participants.get(a);
            TLRPC.User user = MessagesController.getInstance().getUser(participant.user_id);
            if (user != null && user.status != null && (user.status.expires > currentTime || user.id == UserConfig.getClientUserId()) && user.status.expires > 10000) {
                onlineCount++;
            }
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:18,代码来源:ChatAvatarContainer.java

示例3: checkBotCommands

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void checkBotCommands() {
    URLSpanBotCommand.enabled = false;
    if (currentUser != null && currentUser.bot) {
        URLSpanBotCommand.enabled = true;
    } else if (info instanceof TLRPC.TL_chatFull) {
        for (int a = 0; a < info.participants.participants.size(); a++) {
            TLRPC.ChatParticipant participant = info.participants.participants.get(a);
            TLRPC.User user = MessagesController.getInstance().getUser(participant.user_id);
            if (user != null && user.bot) {
                URLSpanBotCommand.enabled = true;
                break;
            }
        }
    } else if (info instanceof TLRPC.TL_channelFull) {
        URLSpanBotCommand.enabled = !info.bot_info.isEmpty();
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:18,代码来源:ChatActivity.java

示例4: openAddMember

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void openAddMember() {
    Bundle args = new Bundle();
    args.putBoolean("onlyUsers", true);
    args.putBoolean("destroyAfterSelect", true);
    args.putBoolean("returnAsResult", true);
    args.putBoolean("needForwardCount", !ChatObject.isChannel(currentChat));
    //args.putBoolean("allowUsernameSearch", false);
    if (chat_id > 0) {
        if (currentChat.creator) {
            args.putInt("chat_id", currentChat.id);
        }
        args.putString("selectAlertString", LocaleController.getString("AddToTheGroup", R.string.AddToTheGroup));
    }
    ContactsActivity fragment = new ContactsActivity(args);
    fragment.setDelegate(new ContactsActivity.ContactsActivityDelegate() {
        @Override
        public void didSelectContact(TLRPC.User user, String param) {
            MessagesController.getInstance().addUserToChat(chat_id, user, info, param != null ? Utilities.parseInt(param) : 0, null, ChatActivity.this);
        }
    });
    if (info instanceof TLRPC.TL_chatFull) {
        HashMap<Integer, TLRPC.User> users = new HashMap<>();
        for (int a = 0; a < info.participants.participants.size(); a++) {
            users.put(info.participants.participants.get(a).user_id, null);
        }
        fragment.setIgnoreUsers(users);
    }
    presentFragment(fragment);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:30,代码来源:ChatActivity.java

示例5: updateOnlineCount

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateOnlineCount() {
    onlineCount = 0;
    int currentTime = ConnectionsManager.getInstance().getCurrentTime();
    sortedUsers.clear();
    if (info instanceof TLRPC.TL_chatFull || info instanceof TLRPC.TL_channelFull && info.participants_count <= 200 && info.participants != null) {
        for (int a = 0; a < info.participants.participants.size(); a++) {
            TLRPC.ChatParticipant participant = info.participants.participants.get(a);
            TLRPC.User user = MessagesController.getInstance().getUser(participant.user_id);
            if (user != null && user.status != null && (user.status.expires > currentTime || user.id == UserConfig.getClientUserId()) && user.status.expires > 10000) {
                onlineCount++;
            }
            sortedUsers.add(a);
        }

        try {
            Collections.sort(sortedUsers, new Comparator<Integer>() {
                @Override
                public int compare(Integer lhs, Integer rhs) {
                    TLRPC.User user1 = MessagesController.getInstance().getUser(info.participants.participants.get(rhs).user_id);
                    TLRPC.User user2 = MessagesController.getInstance().getUser(info.participants.participants.get(lhs).user_id);
                    int status1 = 0;
                    int status2 = 0;
                    if (user1 != null && user1.status != null) {
                        if (user1.id == UserConfig.getClientUserId()) {
                            status1 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
                        } else {
                            status1 = user1.status.expires;
                        }
                    }
                    if (user2 != null && user2.status != null) {
                        if (user2.id == UserConfig.getClientUserId()) {
                            status2 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
                        } else {
                            status2 = user2.status.expires;
                        }
                    }
                    if (status1 > 0 && status2 > 0) {
                        if (status1 > status2) {
                            return 1;
                        } else if (status1 < status2) {
                            return -1;
                        }
                        return 0;
                    } else if (status1 < 0 && status2 < 0) {
                        if (status1 > status2) {
                            return 1;
                        } else if (status1 < status2) {
                            return -1;
                        }
                        return 0;
                    } else if (status1 < 0 && status2 > 0 || status1 == 0 && status2 != 0) {
                        return -1;
                    } else if (status2 < 0 && status1 > 0 || status2 == 0 && status1 != 0) {
                        return 1;
                    }
                    return 0;
                }
            });
        } catch (Exception e) {
            FileLog.e("tmessages", e);
        }

        if (listAdapter != null) {
            listAdapter.notifyItemRangeChanged(emptyRowChat2 + 1, sortedUsers.size());
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:68,代码来源:ProfileActivity.java

示例6: updateOnlineCount

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateOnlineCount() {
    onlineCount = 0;
    int currentTime = ConnectionsManager.getInstance().getCurrentTime();
    sortedUsers.clear();
    if (info instanceof TLRPC.TL_chatFull || info instanceof TLRPC.TL_channelFull && info.participants_count <= 200 && info.participants != null) {
        for (int a = 0; a < info.participants.participants.size(); a++) {
            TLRPC.ChatParticipant participant = info.participants.participants.get(a);
            TLRPC.User user = MessagesController.getInstance().getUser(participant.user_id);
            if (user != null && user.status != null && (user.status.expires > currentTime || user.id == UserConfig.getClientUserId()) && user.status.expires > 10000) {
                onlineCount++;
            }
            sortedUsers.add(a);
            if (participant instanceof TLRPC.TL_chatParticipantCreator) {
                creatorID = participant.user_id;
            }
        }
    }

    try {
        Collections.sort(sortedUsers, new Comparator<Integer>() {
            @Override
            public int compare(Integer lhs, Integer rhs) {
                TLRPC.User user1 = MessagesController.getInstance().getUser(info.participants.participants.get(rhs).user_id);
                TLRPC.User user2 = MessagesController.getInstance().getUser(info.participants.participants.get(lhs).user_id);
                int status1 = 0;
                int status2 = 0;
                if (user1 != null && user1.status != null) {
                    if (user1.id == UserConfig.getClientUserId()) {
                        status1 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
                    } else {
                        status1 = user1.status.expires;
                    }
                    //Telegram admin
                    if (user1.id == creatorID) {
                        status1 = ConnectionsManager.getInstance().getCurrentTime() + 50000 - 100;
                    }
                }
                if (user2 != null && user2.status != null) {
                    if (user2.id == UserConfig.getClientUserId()) {
                        status2 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
                    } else {
                        status2 = user2.status.expires;
                    }
                    //Telegram admin
                    if (user2.id == creatorID) {
                        status2 = ConnectionsManager.getInstance().getCurrentTime() + 50000 - 100;
                    }
                }
                if (status1 > 0 && status2 > 0) {
                    if (status1 > status2) {
                        return 1;
                    } else if (status1 < status2) {
                        return -1;
                    }
                    return 0;
                } else if (status1 < 0 && status2 < 0) {
                    if (status1 > status2) {
                        return 1;
                    } else if (status1 < status2) {
                        return -1;
                    }
                    return 0;
                } else if (status1 < 0 && status2 > 0 || status1 == 0 && status2 != 0) {
                    return -1;
                } else if (status2 < 0 && status1 > 0 || status2 == 0 && status1 != 0) {
                    return 1;
                }
                return 0;
            }
        });
    } catch (Exception e) {
        FileLog.e("tmessages", e);
    }

    if (listAdapter != null) {
        listAdapter.notifyItemRangeChanged(emptyRowChat2 + 1, sortedUsers.size());
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:79,代码来源:ProfileActivity.java


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