Java Code Examples for org.telegram.tgnet.TLRPC#TL_channelParticipantsAdmins

The following examples show how to use org.telegram.tgnet.TLRPC#TL_channelParticipantsAdmins . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChannelAdminLogActivity.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private void loadAdmins() {
    TLRPC.TL_channels_getParticipants req = new TLRPC.TL_channels_getParticipants();
    req.channel = MessagesController.getInputChannel(currentChat);
    req.filter = new TLRPC.TL_channelParticipantsAdmins();
    req.offset = 0;
    req.limit = 200;
    int reqId = ConnectionsManager.getInstance(currentAccount).sendRequest(req, new RequestDelegate() {
        @Override
        public void run(final TLObject response, final TLRPC.TL_error error) {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public void run() {
                    if (error == null) {
                        TLRPC.TL_channels_channelParticipants res = (TLRPC.TL_channels_channelParticipants) response;
                        MessagesController.getInstance(currentAccount).putUsers(res.users, false);
                        admins = res.participants;
                        if (visibleDialog instanceof AdminLogFilterAlert) {
                            ((AdminLogFilterAlert) visibleDialog).setCurrentAdmins(admins);
                        }
                    }
                }
            });
        }
    });
    ConnectionsManager.getInstance(currentAccount).bindRequestToGuid(reqId, classGuid);
}
 
Example 2
Source File: ChannelAdminLogActivity.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private void loadAdmins() {
    TLRPC.TL_channels_getParticipants req = new TLRPC.TL_channels_getParticipants();
    req.channel = MessagesController.getInputChannel(currentChat);
    req.filter = new TLRPC.TL_channelParticipantsAdmins();
    req.offset = 0;
    req.limit = 200;
    int reqId = ConnectionsManager.getInstance(currentAccount).sendRequest(req, new RequestDelegate() {
        @Override
        public void run(final TLObject response, final TLRPC.TL_error error) {
            AndroidUtilities.runOnUIThread(new Runnable() {
                @Override
                public void run() {
                    if (error == null) {
                        TLRPC.TL_channels_channelParticipants res = (TLRPC.TL_channels_channelParticipants) response;
                        MessagesController.getInstance(currentAccount).putUsers(res.users, false);
                        admins = res.participants;
                        if (visibleDialog instanceof AdminLogFilterAlert) {
                            ((AdminLogFilterAlert) visibleDialog).setCurrentAdmins(admins);
                        }
                    }
                }
            });
        }
    });
    ConnectionsManager.getInstance(currentAccount).bindRequestToGuid(reqId, classGuid);
}
 
Example 3
Source File: ChannelAdminLogActivity.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
private void loadAdmins() {
    TLRPC.TL_channels_getParticipants req = new TLRPC.TL_channels_getParticipants();
    req.channel = MessagesController.getInputChannel(currentChat);
    req.filter = new TLRPC.TL_channelParticipantsAdmins();
    req.offset = 0;
    req.limit = 200;
    int reqId = ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
        if (error == null) {
            TLRPC.TL_channels_channelParticipants res = (TLRPC.TL_channels_channelParticipants) response;
            MessagesController.getInstance(currentAccount).putUsers(res.users, false);
            admins = res.participants;
            if (visibleDialog instanceof AdminLogFilterAlert) {
                ((AdminLogFilterAlert) visibleDialog).setCurrentAdmins(admins);
            }
        }
    }));
    ConnectionsManager.getInstance(currentAccount).bindRequestToGuid(reqId, classGuid);
}
 
Example 4
Source File: ChannelAdminLogActivity.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
private void loadAdmins() {
    TLRPC.TL_channels_getParticipants req = new TLRPC.TL_channels_getParticipants();
    req.channel = MessagesController.getInputChannel(currentChat);
    req.filter = new TLRPC.TL_channelParticipantsAdmins();
    req.offset = 0;
    req.limit = 200;
    int reqId = ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> AndroidUtilities.runOnUIThread(() -> {
        if (error == null) {
            TLRPC.TL_channels_channelParticipants res = (TLRPC.TL_channels_channelParticipants) response;
            MessagesController.getInstance(currentAccount).putUsers(res.users, false);
            admins = res.participants;
            if (visibleDialog instanceof AdminLogFilterAlert) {
                ((AdminLogFilterAlert) visibleDialog).setCurrentAdmins(admins);
            }
        }
    }));
    ConnectionsManager.getInstance(currentAccount).bindRequestToGuid(reqId, classGuid);
}