Message

Send a message

Future<String?> sendTextEvent(String message,
      {String? txid,
      Event? inReplyTo,
      String? editEventId,
      bool parseMarkdown = true,
      bool parseCommands = true,
      String msgtype = MessageTypes.Text,
      String? threadRootEventId,
      String? threadLastEventId})

Input Parameters:

Name
Type
Description
Required

message

String

message

True

txid

String

txid

False

inReplyTo

String

inReplyTo

False

threadRootEventId

String

threadRootEventId

False

threadLastEventId

String

threadLastEventId

False

Receive a message

late final Future<Timeline> _timelineFuture;
  final GlobalKey<AnimatedListState> _listKey = GlobalKey<AnimatedListState>();

  @override
  void initState() {
    _timelineFuture = widget.room.getTimeline(onChange: (i) {
      print('on change! $i');
      _listKey.currentState?.setState(() {});
    }, onInsert: (i) {
      print('on insert! $i');
      _listKey.currentState?.insertItem(i);
    }, onRemove: (i) {
      print('On remove $i');
      _listKey.currentState?.removeItem(i, (_, __) => const ListTile());
    }, onUpdate: () {
      print('On update');
    });
    super.initState();
  }

Send live location message

sendLiveLocation(beaconInfoEventId: String, latitude: Double, longitude: Double, uncertainty: Double?): Cancelable
Name
Type
Description
Required

beaconInfoEventId

String

event id of the initial beacon info state event

true

latitude

Double

latitude of the location

True

longitude

Double

longitude of the location

True

uncertainty

Double

Accuracy of the location in meters

False

Set Notification State

enum class RoomNotificationState {   
    ALL_MESSAGES_NOISY,
    ALL_MESSAGES,
    MENTIONS_ONLY,
    MUTE
}

suspend fun setRoomNotificationState(roomNotificationState: RoomNotificationState)
Name
Description

ALL_MESSAGES_NOISY

All the messages will trigger a noisy notification.

ALL_MESSAGES

All the messages will trigger a notification.

MENTIONS_ONLY

Only the messages with user display name / user name will trigger notifications.

MUTE

No notifications.

Send media message

fun sendMedia(
        attachment: ContentAttachmentData,
        compressBeforeSending: Boolean,
        roomIds: Set<String>,
        rootThreadEventId: String? = null,
        relatesTo: RelationDefaultContent? = null,
        additionalContent: Content? = null,
): Cancelable
Name
Type
Description
Required

attachment

String

the media to send

true

compressBeforeSending

String

set to true to compress images before sending them

True

roomIds

String

set of roomIds to where the media will be sent. The current roomId will be add to this set if not present.

True

rootThreadEventId

String

when this param is not null, the Media will be sent in this specific thread

True

relatesTo

String

add a relation content to the media event

True

additionalContent

String

additional content to put in the event content

True

Output parameters

Cancelable

Last updated