14 changed files with 189 additions and 44 deletions
-
3CHANGELOG.md
-
2app/Identity.php
-
35app/Info.php
-
1app/Post.php
-
5app/Presence.php
-
6app/Widgets/Chat/chat.css
-
23database/migrations/20250813153534_add_lang_name_to_identities_table.php
-
17doap.xml
-
12src/Moxl/Stanza/Disco.php
-
9src/Moxl/Stanza/Presence.php
-
75src/Moxl/Utils.php
-
18src/Moxl/Xec/Action/Disco/Request.php
-
24src/Moxl/Xec/Payload/Caps.php
-
3src/Moxl/Xec/Payload/DiscoInfo.php
@ -0,0 +1,23 @@ |
|||
<?php |
|||
|
|||
use Movim\Migration; |
|||
use Illuminate\Database\Schema\Blueprint; |
|||
|
|||
class AddLangNameToIdentitiesTable extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->schema->table('identities', function (Blueprint $table) { |
|||
$table->string('lang')->nullable(); |
|||
$table->string('name')->nullable(); |
|||
}); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->schema->table('identities', function (Blueprint $table) { |
|||
$table->dropColumn('lang'); |
|||
$table->dropColumn('name'); |
|||
}); |
|||
} |
|||
} |
@ -1,24 +0,0 @@ |
|||
<?php |
|||
|
|||
namespace Moxl\Xec\Payload; |
|||
|
|||
use Moxl\Xec\Action\Disco\Request; |
|||
use App\Info; |
|||
|
|||
class Caps extends Payload |
|||
{ |
|||
public function handle(?\SimpleXMLElement $stanza = null, ?\SimpleXMLElement $parent = null) |
|||
{ |
|||
$node = $stanza->attributes()->node.'#'.$stanza->attributes()->ver; |
|||
$to = (string)$parent->attributes()->from; |
|||
$info = Info::where('node', $node)->first(); |
|||
|
|||
if ((!$info || $info->isEmptyFeatures()) |
|||
&& $parent->getName() != 'streamfeatures') { |
|||
$d = new Request; |
|||
$d->setTo($to) |
|||
->setNode($node) |
|||
->request(); |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue