callCover property

  1. @override
UserCallCover? get callCover
override

Returns an actual UserCallCover of this RxChat.

Implementation

@override
UserCallCover? get callCover {
  Log.debug('get callCover', '$runtimeType($id)');

  UserCallCover? callCover;

  switch (chat.value.kind) {
    case ChatKind.monolog:
      callCover = members.values.firstOrNull?.user.user.value.callCover;
      break;

    case ChatKind.dialog:
      callCover =
          members.values
              .firstWhereOrNull((e) => e.user.id != me)
              ?.user
              .user
              .value
              .callCover;
      break;

    case ChatKind.group:
    case ChatKind.artemisUnknown:
      return null;
  }

  callCover ??= chat.value.getCallCover(me);
  return callCover;
}