mapToRequestEvent static method

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

Implementation

static dynamic mapToRequestEvent(data, bool includeRaw) {
  final eventData = {
    'origin': data['messageOrigin'],
    'timestamp': data['timestamp'],
    'chatId': data['chatId'],
    'from': data['from'],
    'to': data['to'],
    'event': MessageEventType.request,
    'meta': {
      'group': data['isGroup'] ?? false,
    },
  };

  if (includeRaw) {
    eventData['raw'] = {'verificationProof': data['verificationProof']};
  }
  return eventData;
}