mapToJoinGroupEvent static method

dynamic mapToJoinGroupEvent(
  1. dynamic data,
  2. bool includeRaw
)

Implementation

static mapToJoinGroupEvent(data, bool includeRaw) {
  final baseEventData = {
    'origin': data['messageOrigin'],
    'timestamp': data['timestamp'],
    'chatId': data['chatId'],
    'from': data['from'],
    'to': data['to'],
    'event': GroupEventType.joinGroup,
  };

  return includeRaw
      ? {
          ...baseEventData,
          'raw': {'verificationProof': data['verificationProof']},
        }
      : baseEventData;
}