Change mqtt channel for rider app #617

This commit is contained in:
Kendrick Chan 2021-08-22 00:32:09 +08:00
parent cf12d09ee5
commit b433722764

View file

@ -72,6 +72,8 @@ class MQTTClient
if ($rider == null) if ($rider == null)
return; return;
/*
// NOTE: this is for the old rider app
// check if rider has sessions // check if rider has sessions
$sessions = $rider->getSessions(); $sessions = $rider->getSessions();
if (count($sessions) == 0) if (count($sessions) == 0)
@ -84,5 +86,9 @@ class MQTTClient
$channel = self::RIDER_PREFIX . $sess_id; $channel = self::RIDER_PREFIX . $sess_id;
$this->publish($channel, json_encode($payload)); $this->publish($channel, json_encode($payload));
} }
*/
// NOTE: this is for the new rider app
$this->publish('rider/' . $rider->getID(), json_encode($payload));
} }
} }