relationshipType property

String? relationshipType

Get the relationship type of an event. null if there is none

Implementation

String? get relationshipType {
  final mRelatesTo = content.tryGetMap<String, Object?>('m.relates_to');
  if (mRelatesTo == null) {
    return null;
  }
  final relType = mRelatesTo.tryGet<String>('rel_type');
  if (relType == RelationshipTypes.thread) {
    return RelationshipTypes.thread;
  }

  if (mRelatesTo.containsKey('m.in_reply_to')) {
    return RelationshipTypes.reply;
  }
  return relType;
}