Package-level declarations

Types

Link copied to clipboard
typealias ContentBuilder = suspend ContentBuilderInfo.() -> MessageEventContent?
Link copied to clipboard
data class ContentBuilderInfo(val relatesTo: RelatesTo?, val mentions: Mentions?, val newContentMentions: Mentions?)
Link copied to clipboard
class MessageBuilder(val roomId: RoomId, val roomService: RoomService, val mediaService: MediaService, val ownUserId: UserId)
Link copied to clipboard
data class RoomMessageBuilderInfo(val body: String, val format: String?, val formattedBody: String?, val relatesTo: RelatesTo?, val mentions: Mentions?)

Functions

Link copied to clipboard
suspend fun MessageBuilder.audio(body: String, audio: ByteArrayFlow, format: String? = null, formattedBody: String? = null, fileName: String? = null, type: ContentType? = null, size: Long? = null, duration: Long? = null)
Link copied to clipboard
fun MessageBuilder.emote(body: String, format: String? = null, formattedBody: String? = null)
Link copied to clipboard
suspend fun MessageBuilder.file(body: String, file: ByteArrayFlow, format: String? = null, formattedBody: String? = null, fileName: String? = null, type: ContentType? = null, size: Long? = null)
Link copied to clipboard
suspend fun MessageBuilder.image(body: String, image: ByteArrayFlow, format: String? = null, formattedBody: String? = null, fileName: String? = null, type: ContentType? = null, size: Long? = null, height: Int? = null, width: Int? = null)
Link copied to clipboard
fun MessageBuilder.mentions(vararg users: UserId, room: Boolean? = mentions?.room)

fun MessageBuilder.mentions(users: Set<UserId>? = null, room: Boolean? = mentions?.room)

Add mentions to the message. Can be called multiple times and adds new mentions each time.

Link copied to clipboard
Link copied to clipboard
fun MessageBuilder.notice(body: String, format: String? = null, formattedBody: String? = null)
Link copied to clipboard
fun MessageBuilder.react(eventId: EventId, key: String)
fun MessageBuilder.react(event: ClientEvent.RoomEvent.MessageEvent<*>, key: String)
Link copied to clipboard
fun MessageBuilder.replace(eventId: EventId)
fun MessageBuilder.replace(event: ClientEvent.RoomEvent.MessageEvent<*>)
Link copied to clipboard
suspend fun MessageBuilder.reply(event: TimelineEvent)
suspend fun MessageBuilder.reply(event: ClientEvent.RoomEvent.MessageEvent<*>)

suspend fun MessageBuilder.reply(eventId: EventId, eventRelatesTo: RelatesTo?)

Important: eventRelatesTo should be set from the event, that is replied. Otherwise, thread support is dropped.

Link copied to clipboard
fun MessageBuilder.roomMessageBuilder(body: String, format: String?, formattedBody: String?, builder: RoomMessageBuilderInfo.() -> RoomMessageEventContent)
Link copied to clipboard
fun MessageBuilder.text(body: String, format: String? = null, formattedBody: String? = null)
Link copied to clipboard
fun MessageBuilder.thread(event: TimelineEvent, reply: Boolean = false)
fun MessageBuilder.thread(event: ClientEvent.RoomEvent.MessageEvent<*>, reply: Boolean = false)

event must be the last known event of a thread.

fun MessageBuilder.thread(eventId: EventId, eventRelatesTo: RelatesTo? = null, reply: Boolean = false)

eventId and eventRelatesTo must be from the last known event of a thread.

Link copied to clipboard
suspend fun MessageBuilder.video(body: String, video: ByteArrayFlow, format: String? = null, formattedBody: String? = null, fileName: String? = null, type: ContentType? = null, size: Long? = null, height: Int? = null, width: Int? = null, duration: Long? = null)