123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?php
- defined('GNUSOCIAL') || die();
- use XMPPHP\XMPP;
- class QueuedXMPP extends XMPP
- {
-
- public $plugin;
-
- public function __construct($plugin, $host, $port, $user, $password, $resource, $server = null, $printlog = false, $loglevel = null)
- {
- $this->plugin = $plugin;
- parent::__construct($host, $port, $user, $password, $resource, $server, $printlog, $loglevel);
-
-
-
-
- if (!$server) {
- $server = $this->host;
- }
- $this->basejid = $this->user . '@' . $server;
-
-
- $this->fulljid = "{$this->basejid}/{$this->resource}";
- }
-
- public function send(string $msg, ?int $timeout = null)
- {
- @$this->plugin->enqueueOutgoingRaw($msg);
- }
-
-
- public function connect(bool $persistent = false, bool $send_init = true, int $timeout = 30): void
- {
-
- throw new Exception('Cannot connect to server from fake XMPP.');
- }
- public function disconnect(): void
- {
-
- throw new Exception('Cannot connect to server from fake XMPP.');
- }
- public function process(): void
- {
-
- throw new Exception('Cannot read stream from fake XMPP.');
- }
- public function processUntil($event, int $timeout = -1): array
- {
-
- throw new Exception('Cannot read stream from fake XMPP.');
- }
- public function read(): bool
- {
-
- throw new Exception('Cannot read stream from fake XMPP.');
- }
- public function readyToProcess(): bool
- {
-
- throw new Exception('Cannot read stream from fake XMPP.');
- }
-
- }
|