applyReference

public MessageContent applyReference(TextMessage textMessage)

Merges the pending TextMessage with the current reference.

If a reference message exists (reference bar shown above the input), fills the text and MentionedInfo from textMessage into ReferenceMessage, hides the reference bar, and returns the ReferenceMessage; otherwise returns textMessage as-is.

Return

a ReferenceMessage with the reference, or the original textMessage if none

Parameters

textMessage

the plain text message constructed from the input field