]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/ChatLog.php
track twitch category where chats were sent in
[alttp.git] / app / Models / ChatLog.php
index c28a0724685320254e122e3e727a5755a56134b6..41bdcc506653a1727e7e13af8f4cafab2df617be 100644 (file)
@@ -106,6 +106,9 @@ class ChatLog extends Model {
                $channel = Channel::firstWhere('twitch_chat', '=', $cname);
                if (!is_null($channel)) {
                        $this->channel()->associate($channel);
+                       if (now()->sub(5, 'minute')->isBefore($this->created_at)) {
+                               $this->twitch_category = $channel->twitch_category;
+                       }
                }
        }