ServiceChat.php 572 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Easemob\Agora;
  3. /**
  4. * @ignore
  5. */
  6. class ServiceChat extends Service
  7. {
  8. const SERVICE_TYPE = 5;
  9. const PRIVILEGE_USER = 1;
  10. const PRIVILEGE_APP = 2;
  11. public $userId;
  12. public function __construct($userId = "")
  13. {
  14. parent::__construct(self::SERVICE_TYPE);
  15. $this->userId = $userId;
  16. }
  17. public function pack()
  18. {
  19. return parent::pack() . Util::packString($this->userId);
  20. }
  21. public function unpack(&$data)
  22. {
  23. parent::unpack($data);
  24. $this->userId = Util::unpackString($data);
  25. }
  26. }