Java Code Examples for org.telegram.messenger.MessagesController#getDialogs()

The following examples show how to use org.telegram.messenger.MessagesController#getDialogs() . 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: ShareAlert.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private ArrayList<TLRPC.TL_dialog> getDialogs()
{
    if (changed || dialogsList == null)
    {
        changed = false;
        dialogsList = new ArrayList<>();

        ArrayList<TLRPC.TL_dialog> dialogs = MessagesController.getDialogs(currentAccount, dialogsType);
        for (TLRPC.TL_dialog dialog : dialogs)
        {
            int lower_id = (int) dialog.id;
            int high_id = (int) (dialog.id >> 32);
            if (lower_id != 0 && high_id != 1)
            {
                if (lower_id > 0)
                {
                    dialogsList.add(dialog);
                }
                else
                {
                    TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-lower_id);
                    if (!(chat == null || ChatObject.isNotInChat(chat) || ChatObject.isChannel(chat) && !chat.creator &&
                            (chat.admin_rights == null || !chat.admin_rights.post_messages) && !chat.megagroup))
                    {
                        dialogsList.add(dialog);
                    }
                }
            }
        }
    }

    return dialogsList;
}
 
Example 2
Source File: ShareAlert.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private ArrayList<TLRPC.TL_dialog> getDialogs()
{
    if (changed || dialogsList == null)
    {
        changed = false;
        dialogsList = new ArrayList<>();

        ArrayList<TLRPC.TL_dialog> dialogs = MessagesController.getDialogs(currentAccount, dialogsType);
        for (TLRPC.TL_dialog dialog : dialogs)
        {
            int lower_id = (int) dialog.id;
            int high_id = (int) (dialog.id >> 32);
            if (lower_id != 0 && high_id != 1)
            {
                if (lower_id > 0)
                {
                    dialogsList.add(dialog);
                }
                else
                {
                    TLRPC.Chat chat = MessagesController.getInstance(currentAccount).getChat(-lower_id);
                    if (!(chat == null || ChatObject.isNotInChat(chat) || ChatObject.isChannel(chat) && !chat.creator &&
                            (chat.admin_rights == null || !chat.admin_rights.post_messages) && !chat.megagroup))
                    {
                        dialogsList.add(dialog);
                    }
                }
            }
        }
    }

    return dialogsList;
}
 
Example 3
Source File: DialogsAdapter.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
public ArrayList<TLRPC.TL_dialog> getDialogsArray()
{
    return MessagesController.getDialogs(currentAccount, dialogsType);
}
 
Example 4
Source File: DialogCell.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
private ArrayList<TLRPC.TL_dialog> getDialogsArray()
{
    return MessagesController.getDialogs(currentAccount, dialogsType);
}
 
Example 5
Source File: DialogsAdapter.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
public ArrayList<TLRPC.TL_dialog> getDialogsArray()
{
    return MessagesController.getDialogs(currentAccount, dialogsType);
}
 
Example 6
Source File: DialogCell.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
private ArrayList<TLRPC.TL_dialog> getDialogsArray()
{
    return MessagesController.getDialogs(currentAccount, dialogsType);
}