public void on()

in sdk/communication/azure-communication-chat/src/main/java/com/azure/android/communication/chat/implementation/notifications/signaling/CommunicationSignalingClient.java [164:193]


    public void on(ChatEventType chatEventType, RealTimeNotificationCallback listener) {
        CommunicationListener communicationListener = new CommunicationListener(chatEventType, listener);
        String loggingName = CommunicationSignalingClient.class.getName();
        if (!trouterListeners.containsKey(listener)) {
            if (ChatEventType.CHAT_MESSAGE_RECEIVED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/chatMessageReceived", loggingName);
            } else if (ChatEventType.TYPING_INDICATOR_RECEIVED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/typingIndicatorReceived", loggingName);
            } else if (ChatEventType.READ_RECEIPT_RECEIVED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/readReceiptReceived", loggingName);
            } else if (ChatEventType.CHAT_MESSAGE_EDITED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/chatMessageEdited", loggingName);
            } else if (ChatEventType.CHAT_MESSAGE_DELETED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/chatMessageDeleted", loggingName);
            } else if (ChatEventType.CHAT_THREAD_CREATED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/chatThreadCreated", loggingName);
            } else if (ChatEventType.CHAT_THREAD_PROPERTIES_UPDATED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/chatThreadPropertiesUpdated", loggingName);
            } else if (ChatEventType.CHAT_THREAD_DELETED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/chatThreadDeleted", loggingName);
            } else if (ChatEventType.PARTICIPANTS_ADDED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/participantsAdded", loggingName);
            } else if (ChatEventType.PARTICIPANTS_REMOVED.equals(chatEventType)) {
                trouter.registerListener(communicationListener, "/participantsRemoved", loggingName);
            } else {
                return;
            }
            trouterListeners.put(listener, communicationListener);
        }
    }