up
This commit is contained in:
@@ -514,6 +514,17 @@ class WhatsAppService
|
||||
'created_at' => date('Y-m-d H:i:s')
|
||||
];
|
||||
|
||||
// Si es reply (context)
|
||||
if (isset($data['context']['message_id'])) {
|
||||
$messageData['reply_to_message_id'] = is_numeric($data['context']['message_id']) ? intval($data['context']['message_id']) : null;
|
||||
}
|
||||
|
||||
// Si es reaction
|
||||
if ($data['type'] === 'reaction' && isset($data['reaction'])) {
|
||||
$messageData['reaction_to_message_id'] = is_numeric($data['reaction']['message_id'] ?? null) ? intval($data['reaction']['message_id']) : null;
|
||||
$messageData['reaction_emoji'] = $data['reaction']['emoji'] ?? null;
|
||||
}
|
||||
|
||||
$this->db->insert('conversations', $messageData);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user