Browse Source

Fix #1172

pull/1185/head
Timothée Jaussoin 3 years ago
parent
commit
09a8463c42
  1. 5
      app/Reaction.php
  2. 4
      app/widgets/Chat/Chat.php

5
app/Reaction.php

@ -8,6 +8,11 @@ class Reaction extends Model
{
protected $primaryKey = 'message_mid';
protected $casts = [
'created_at' => 'datetime:Y-m-d H:i:s',
'updated_at' => 'datetime:Y-m-d H:i:s',
];
public function message()
{
return $this->belongsTo('App\Message');

4
app/widgets/Chat/Chat.php

@ -729,11 +729,15 @@ class Chat extends \Movim\Widget\Base
// This reaction was not published yet
if ($emojis->where('emoji', $emoji)->count() == 0) {
$now = \Carbon\Carbon::now();
$reaction = new Reaction;
$reaction->message_mid = $parentMessage->mid;
$reaction->jidfrom = ($parentMessage->isMuc())
? $this->user->session->username
: $this->user->id;
$reaction->created_at = $now;
$reaction->updated_at = $now;
$reaction->emoji = $emoji;
if (!$parentMessage->isMuc()) {

Loading…
Cancel
Save