Class EditMessageHandler
-
- All Implemented Interfaces:
public class EditMessageHandlerData 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
-
-
Field Summary
Fields Modifier and Type Field Description public final static DataKey<List<Message>>KEY_ON_MESSAGE_MODIFIEDpublic final static DataKey<Message>KEY_ON_MESSAGE_REFRESHpublic final static DataKey<EditMessageConfig>KEY_INPUT_PANEL_GET_DRAFT
-
Constructor Summary
Constructors Constructor Description EditMessageHandler()
-
Method Summary
Modifier and Type Method Description voidstop()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. voidupdateReferenceView(List<Message> messages, List<UiMessage> uiMessageList)Updates the reference view after receiving message-edit events. voidrefreshReferenceMessage(String editMsgUid, ChannelIdentifier identifier)Refreshes the reference message status for the given message UID. voidsaveEditedMessageDraft(ChannelIdentifier id, EditMessageConfig config)Saves edit-message state to both local cache and BaseChannel.editedMessageDraft. voidcheckEditedMessageDraftStatus(ChannelIdentifier id)Checks edit-message draft status; called by InputPanel to decide whether to load a regular draft. voidresumeEditMode(ChannelIdentifier id, ActiveType type)Resumes the edit-message input UI. voidclearEditedMessageDraft(ChannelIdentifier id)Clears edit draft from both local cache and BaseChannel.editedMessageDraft. -
-
Method Detail
-
stop
void stop()
-
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 messagesuiMessageList- 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 messagestatus- 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 messagesstatus- 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 messagesuiMessageList- 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 UIDidentifier- 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.
-
-
-
-