SendService

interface SendService

This interface defines methods to send events in a room. It's implemented at the room level.

Functions

Link copied to clipboard

Cancel all failed messages.

Link copied to clipboard
abstract fun cancelSend(eventId: String)

Cancel sending a specific event. It has to be in one of the sending states.

Link copied to clipboard
abstract fun deleteFailedEcho(localEcho: TimelineEvent)

Remove this failed message from the timeline.

Link copied to clipboard
abstract fun endPoll(pollEventId: String, additionalContent: Content? = null): Cancelable

End a poll in the room.

Link copied to clipboard
abstract fun redactEvent(event: Event, reason: String?, withRelTypes: List<String>? = null, additionalContent: Content? = null): Cancelable

Redact (delete) the given event.

Link copied to clipboard

Resend all failed messages one by one (and keep order).

Link copied to clipboard
abstract fun resendMediaMessage(localEcho: TimelineEvent): Cancelable

Schedule this message to be resent.

Link copied to clipboard
abstract fun resendTextMessage(localEcho: TimelineEvent): Cancelable

Schedule this message to be resent.

Link copied to clipboard
abstract fun sendEvent(eventType: String, content: Content?): Cancelable

Method to send a generic event asynchronously. If you want to send a state event, please use StateService instead.

Link copied to clipboard
abstract fun sendFormattedTextMessage(text: String, formattedText: String, msgType: String = MessageType.MSGTYPE_TEXT, additionalContent: Content? = null): Cancelable

Method to send a text message with a formatted body.

Link copied to clipboard
abstract fun sendMedia(attachment: ContentAttachmentData, compressBeforeSending: Boolean, roomIds: Set<String>, rootThreadEventId: String? = null, relatesTo: RelationDefaultContent? = null, additionalContent: Content? = null): Cancelable

Method to send a media asynchronously.

Link copied to clipboard
abstract fun sendMedias(attachments: List<ContentAttachmentData>, compressBeforeSending: Boolean, roomIds: Set<String>, rootThreadEventId: String? = null, additionalContent: Content? = null): Cancelable

Method to send a list of media asynchronously.

Link copied to clipboard
abstract fun sendPoll(pollType: PollType, question: String, options: List<String>, additionalContent: Content? = null): Cancelable

Send a poll to the room.

Link copied to clipboard
abstract fun sendQuotedTextMessage(quotedEvent: TimelineEvent, text: String, formattedText: String? = null, autoMarkdown: Boolean, rootThreadEventId: String? = null, additionalContent: Content? = null): Cancelable

Method to quote an events content.

Link copied to clipboard
abstract fun sendTextMessage(text: CharSequence, msgType: String = MessageType.MSGTYPE_TEXT, autoMarkdown: Boolean = false, additionalContent: Content? = null): Cancelable

Method to send a text message asynchronously. The text to send can be a Spannable and contains special spans (MatrixItemSpan) that will be translated by the sdk into pills.

Link copied to clipboard
abstract fun voteToPoll(pollEventId: String, answerId: String, additionalContent: Content? = null): Cancelable

Method to send a poll response.