Java Code Examples for org.telegram.messenger.NotificationCenter#chatInfoDidLoad()

The following examples show how to use org.telegram.messenger.NotificationCenter#chatInfoDidLoad() . 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: GroupInviteActivity.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull info = (TLRPC.ChatFull) args[0];
        int guid = (int) args[1];
        if (info.id == chat_id && guid == classGuid) {
            invite = MessagesController.getInstance(currentAccount).getExportedInvite(chat_id);
            if (!(invite instanceof TLRPC.TL_chatInviteExported)) {
                generateLink(false);
            } else {
                loading = false;
                if (listAdapter != null) {
                    listAdapter.notifyDataSetChanged();
                }
            }
        }
    }
}
 
Example 2
Source File: ChatLinkActivity.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        if (chatFull.id == currentChatId) {
            info = chatFull;
            loadChats();
            updateRows();
        } else if (waitingForFullChat != null && waitingForFullChat.id == chatFull.id) {
            try {
                waitingForFullChatProgressAlert.dismiss();
            } catch (Throwable ignore) {

            }
            waitingForFullChatProgressAlert = null;
            showLinkAlert(waitingForFullChat, false);
            waitingForFullChat = null;
        }
    }
}
 
Example 3
Source File: GroupStickersActivity.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.stickersDidLoad) {
        if ((Integer) args[0] == MediaDataController.TYPE_IMAGE) {
            updateRows();
        }
    } else if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        if (chatFull.id == chatId) {
            if (info == null && chatFull.stickerset != null) {
                selectedStickerSet = MediaDataController.getInstance(currentAccount).getGroupStickerSetById(chatFull.stickerset);
            }
            info = chatFull;
            updateRows();
        }
    } else if (id == NotificationCenter.groupStickersDidLoad) {
        long setId = (Long) args[0];
        if (info != null && info.stickerset != null && info.stickerset.id == id) {
            updateRows();
        }
    }
}
 
Example 4
Source File: GroupInviteActivity.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull info = (TLRPC.ChatFull) args[0];
        int guid = (int) args[1];
        if (info.id == chat_id && guid == classGuid) {
            invite = MessagesController.getInstance(currentAccount).getExportedInvite(chat_id);
            if (!(invite instanceof TLRPC.TL_chatInviteExported)) {
                generateLink(false);
            } else {
                loading = false;
                if (listAdapter != null) {
                    listAdapter.notifyDataSetChanged();
                }
            }
        }
    }
}
 
Example 5
Source File: ChatLinkActivity.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        if (chatFull.id == currentChatId) {
            info = chatFull;
            loadChats();
            updateRows();
        } else if (waitingForFullChat != null && waitingForFullChat.id == chatFull.id) {
            try {
                waitingForFullChatProgressAlert.dismiss();
            } catch (Throwable ignore) {

            }
            waitingForFullChatProgressAlert = null;
            showLinkAlert(waitingForFullChat, false);
            waitingForFullChat = null;
        }
    }
}
 
Example 6
Source File: GroupStickersActivity.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.stickersDidLoad) {
        if ((Integer) args[0] == MediaDataController.TYPE_IMAGE) {
            updateRows();
        }
    } else if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        if (chatFull.id == chatId) {
            if (info == null && chatFull.stickerset != null) {
                selectedStickerSet = MediaDataController.getInstance(currentAccount).getGroupStickerSetById(chatFull.stickerset);
            }
            info = chatFull;
            updateRows();
        }
    } else if (id == NotificationCenter.groupStickersDidLoad) {
        long setId = (Long) args[0];
        if (info != null && info.stickerset != null && info.stickerset.id == id) {
            updateRows();
        }
    }
}
 
Example 7
Source File: ChatEditActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        if (chatFull.id == chatId) {
            if (info == null && descriptionTextView != null) {
                descriptionTextView.setText(chatFull.about);
            }
            info = chatFull;
            historyHidden = !ChatObject.isChannel(currentChat) || info.hidden_prehistory;
            updateFields(false);
        }
    }
}
 
Example 8
Source File: ChatEditTypeActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        if (chatFull.id == chatId) {
            info = chatFull;
            invite = chatFull.exported_invite;
            updatePrivatePublic();
        }
    }
}
 
Example 9
Source File: ChatUsersActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        boolean byChannelUsers = (Boolean) args[2];
        if (chatFull.id == chatId && (!byChannelUsers || !ChatObject.isChannel(currentChat))) {
            boolean hadInfo = info != null;
            info = chatFull;
            if (!hadInfo) {
                selectedSlowmode = initialSlowmode = getCurrentSlowmode();
            }
            AndroidUtilities.runOnUIThread(() -> loadChatParticipants(0, 200));
        }
    }
}
 
Example 10
Source File: ChatEditActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        if (chatFull.id == chatId) {
            if (info == null && descriptionTextView != null) {
                descriptionTextView.setText(chatFull.about);
            }
            info = chatFull;
            historyHidden = !ChatObject.isChannel(currentChat) || info.hidden_prehistory;
            updateFields(false);
        }
    }
}
 
Example 11
Source File: ChatEditTypeActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        if (chatFull.id == chatId) {
            info = chatFull;
            invite = chatFull.exported_invite;
            updatePrivatePublic();
        }
    }
}
 
Example 12
Source File: ChatUsersActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void didReceivedNotification(int id, int account, Object... args) {
    if (id == NotificationCenter.chatInfoDidLoad) {
        TLRPC.ChatFull chatFull = (TLRPC.ChatFull) args[0];
        boolean byChannelUsers = (Boolean) args[2];
        if (chatFull.id == chatId && (!byChannelUsers || !ChatObject.isChannel(currentChat))) {
            boolean hadInfo = info != null;
            info = chatFull;
            if (!hadInfo) {
                selectedSlowmode = initialSlowmode = getCurrentSlowmode();
            }
            AndroidUtilities.runOnUIThread(() -> loadChatParticipants(0, 200));
        }
    }
}