Java Code Examples for org.telegram.ui.ChatActivity#getCurrentUser()

The following examples show how to use org.telegram.ui.ChatActivity#getCurrentUser() . 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: ChatAttachAlert.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
private void sendPressed(boolean notify, int scheduleDate) {
    if (buttonPressed) {
        return;
    }
    if (baseFragment instanceof ChatActivity) {
        ChatActivity chatActivity = (ChatActivity) baseFragment;
        TLRPC.Chat chat = chatActivity.getCurrentChat();
        TLRPC.User user = chatActivity.getCurrentUser();
        if (user != null || ChatObject.isChannel(chat) && chat.megagroup || !ChatObject.isChannel(chat)) {
            MessagesController.getNotificationsSettings(currentAccount).edit().putBoolean("silent_" + chatActivity.getDialogId(), !notify).commit();
        }
    }
    applyCaption();
    buttonPressed = true;
    delegate.didPressedButton(7, true, notify, scheduleDate);
}
 
Example 2
Source File: ChatAttachAlert.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
private void sendPressed(boolean notify, int scheduleDate) {
    if (buttonPressed) {
        return;
    }
    if (baseFragment instanceof ChatActivity) {
        ChatActivity chatActivity = (ChatActivity) baseFragment;
        TLRPC.Chat chat = chatActivity.getCurrentChat();
        TLRPC.User user = chatActivity.getCurrentUser();
        if (user != null || ChatObject.isChannel(chat) && chat.megagroup || !ChatObject.isChannel(chat)) {
            MessagesController.getNotificationsSettings(currentAccount).edit().putBoolean("silent_" + chatActivity.getDialogId(), !notify).commit();
        }
    }
    applyCaption();
    buttonPressed = true;
    delegate.didPressedButton(7, true, notify, scheduleDate);
}