mapToGroupEvent static method
dynamic
mapToGroupEvent(
- dynamic eventType,
- dynamic incomingData,
- bool includeRaw
)
Implementation
static dynamic mapToGroupEvent(eventType, incomingData, bool includeRaw) {
final metaAndRaw = buildChatGroupEventMetaAndRaw(incomingData, includeRaw);
final groupEvent = {
'event': eventType,
'origin': incomingData['messageOrigin'],
'timestamp': incomingData['timestamp'],
'chatId': incomingData['chatId'],
'from': incomingData['from'],
'meta': metaAndRaw['meta'],
};
if (includeRaw) {
groupEvent['raw'] = metaAndRaw['raw'];
}
return groupEvent;
}