Class EditMessageHandler

  • All Implemented Interfaces:

    
    public class EditMessageHandler
    
                        

    Data handler for message editing operations.

    Observes message-modification events from the SDK, processes edited messages and their associated reference messages, and exposes data keys for observers to consume.

    Since:

    5.26.0

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void stop()
      List<UiMessage> processMessageEditStatusAndReferMsgStatus(List<Message> editMessageList, List<UiMessage> uiMessageList) Processes the edit status of messages and updates any reference messages that quote them.
      List<UiMessage> processMessageReferMsgStatus(Message message, ReferenceMessageStatus status, List<UiMessage> uiMessageList) Updates the reference-message status for messages that quote the given message.
      List<UiMessage> processMessageReferMsgStatus(Array<Message> messages, ReferenceMessageStatus status, List<UiMessage> uiMessageList) Updates the reference-message status for messages that quote any of the given messages.
      void updateReferenceView(List<Message> messages, List<UiMessage> uiMessageList) Updates the reference view after receiving message-edit events.
      void refreshReferenceMessage(String editMsgUid, ChannelIdentifier identifier) Refreshes the reference message status for the given message UID.
      void saveEditedMessageDraft(ChannelIdentifier id, EditMessageConfig config) Saves edit-message state to both local cache and BaseChannel.editedMessageDraft.
      void checkEditedMessageDraftStatus(ChannelIdentifier id) Checks edit-message draft status; called by InputPanel to decide whether to load a regular draft.
      void resumeEditMode(ChannelIdentifier id, ActiveType type) Resumes the edit-message input UI.
      void clearEditedMessageDraft(ChannelIdentifier id) Clears edit draft from both local cache and BaseChannel.editedMessageDraft.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EditMessageHandler

        EditMessageHandler()
    • Method Detail

      • processMessageEditStatusAndReferMsgStatus

         List<UiMessage> processMessageEditStatusAndReferMsgStatus(List<Message> editMessageList, List<UiMessage> uiMessageList)

        Processes the edit status of messages and updates any reference messages that quote them.

        Parameters:
        editMessageList - list of edited messages
        uiMessageList - the current UI message list
        Returns:

        updated UI message list for refreshing the screen

      • processMessageReferMsgStatus

         List<UiMessage> processMessageReferMsgStatus(Message message, ReferenceMessageStatus status, List<UiMessage> uiMessageList)

        Updates the reference-message status for messages that quote the given message.

        Parameters:
        message - the source message
        status - reference message status (recalled or deleted)
        uiMessageList - the current UI message list
        Returns:

        updated UI message list for refreshing the screen

      • processMessageReferMsgStatus

         List<UiMessage> processMessageReferMsgStatus(Array<Message> messages, ReferenceMessageStatus status, List<UiMessage> uiMessageList)

        Updates the reference-message status for messages that quote any of the given messages.

        Parameters:
        messages - the source messages
        status - reference message status (recalled or deleted)
        uiMessageList - the current UI message list
        Returns:

        updated UI message list for refreshing the screen

      • updateReferenceView

         void updateReferenceView(List<Message> messages, List<UiMessage> uiMessageList)

        Updates the reference view after receiving message-edit events.

        Parameters:
        messages - the edited messages
        uiMessageList - the current UI message list
      • refreshReferenceMessage

         void refreshReferenceMessage(String editMsgUid, ChannelIdentifier identifier)

        Refreshes the reference message status for the given message UID.

        Parameters:
        editMsgUid - message UID
        identifier - channel identifier
      • saveEditedMessageDraft

         void saveEditedMessageDraft(ChannelIdentifier id, EditMessageConfig config)

        Saves edit-message state to both local cache and BaseChannel.editedMessageDraft.

      • checkEditedMessageDraftStatus

         void checkEditedMessageDraftStatus(ChannelIdentifier id)

        Checks edit-message draft status; called by InputPanel to decide whether to load a regular draft.

      • resumeEditMode

         void resumeEditMode(ChannelIdentifier id, ActiveType type)

        Resumes the edit-message input UI.

      • clearEditedMessageDraft

         void clearEditedMessageDraft(ChannelIdentifier id)

        Clears edit draft from both local cache and BaseChannel.editedMessageDraft.