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

The following examples show how to use org.telegram.tgnet.TLRPC#TL_channelParticipantAdmin . 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: ProfileActivity.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private boolean isParticipantAdmin(TLRPC.ChatParticipant participant)
{
    if (participant instanceof TLRPC.TL_chatChannelParticipant)
    {
        TLRPC.ChannelParticipant channelParticipant = ((TLRPC.TL_chatChannelParticipant) participant).channelParticipant;
        return channelParticipant instanceof TLRPC.TL_channelParticipantCreator || channelParticipant instanceof TLRPC.TL_channelParticipantAdmin;
    }
    else
    {
        return participant instanceof TLRPC.TL_chatParticipantCreator || (currentChat != null &&
                currentChat.admins_enabled && participant instanceof TLRPC.TL_chatParticipantAdmin);
    }
}
 
Example 2
Source File: ChannelUsersActivity.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private int getChannelAdminParticipantType(TLRPC.ChannelParticipant participant) {
    if (participant instanceof TLRPC.TL_channelParticipantCreator || participant instanceof TLRPC.TL_channelParticipantSelf) {
        return 0;
    } else if (participant instanceof TLRPC.TL_channelParticipantAdmin) {
        return 1;
    }  else {
        return 2;
    }
}
 
Example 3
Source File: ProfileActivity.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private boolean isParticipantAdmin(TLRPC.ChatParticipant participant)
{
    if (participant instanceof TLRPC.TL_chatChannelParticipant)
    {
        TLRPC.ChannelParticipant channelParticipant = ((TLRPC.TL_chatChannelParticipant) participant).channelParticipant;
        return channelParticipant instanceof TLRPC.TL_channelParticipantCreator || channelParticipant instanceof TLRPC.TL_channelParticipantAdmin;
    }
    else
    {
        return participant instanceof TLRPC.TL_chatParticipantCreator || (currentChat != null &&
                currentChat.admins_enabled && participant instanceof TLRPC.TL_chatParticipantAdmin);
    }
}
 
Example 4
Source File: ChannelUsersActivity.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private int getChannelAdminParticipantType(TLRPC.ChannelParticipant participant) {
    if (participant instanceof TLRPC.TL_channelParticipantCreator || participant instanceof TLRPC.TL_channelParticipantSelf) {
        return 0;
    } else if (participant instanceof TLRPC.TL_channelParticipantAdmin) {
        return 1;
    }  else {
        return 2;
    }
}
 
Example 5
Source File: ChatUsersActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
private int getChannelAdminParticipantType(TLObject participant) {
    if (participant instanceof TLRPC.TL_channelParticipantCreator || participant instanceof TLRPC.TL_channelParticipantSelf) {
        return 0;
    } else if (participant instanceof TLRPC.TL_channelParticipantAdmin || participant instanceof TLRPC.TL_channelParticipant) {
        return 1;
    }  else {
        return 2;
    }
}
 
Example 6
Source File: ChatUsersActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private int getChannelAdminParticipantType(TLObject participant) {
    if (participant instanceof TLRPC.TL_channelParticipantCreator || participant instanceof TLRPC.TL_channelParticipantSelf) {
        return 0;
    } else if (participant instanceof TLRPC.TL_channelParticipantAdmin || participant instanceof TLRPC.TL_channelParticipant) {
        return 1;
    }  else {
        return 2;
    }
}