Skip to content

Commit

Permalink
Feat: MadelineProto v7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed Dec 11, 2021
1 parent d2b66ea commit f66f26d
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 123 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"amphp/websocket-client": "^1",
"amphp/http-client": "^4",
"vlucas/phpdotenv": "^4",
"danog/madelineproto":"dev-ipc_off",
"danog/madelineproto":"master",
"amphp/http-server-form-parser": "^1.1"
},
"require-dev": {
Expand Down
246 changes: 124 additions & 122 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions server.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use TelegramApiServer\Config;
use TelegramApiServer\Files;
use TelegramApiServer\Migrations\SessionsMigration;
use TelegramApiServer\Migrations\StartUpFixes;
use TelegramApiServer\Migrations\SwooleToAmpMigration;
use TelegramApiServer\Server\Fork;
use TelegramApiServer\Server\HealthCheck;
Expand Down Expand Up @@ -69,6 +70,7 @@

SessionsMigration::move();
SwooleToAmpMigration::check();
StartUpFixes::fix();
$mainProcessPid = getmypid();

if (Config::getInstance()->get('health_check.enabled')) {
Expand Down
11 changes: 11 additions & 0 deletions src/Migrations/StartUpFixes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace TelegramApiServer\Migrations;

class StartUpFixes
{
public static function fix(): void
{
define('MADELINE_WORKER_TYPE', 'madeline-ipc');
}
}

0 comments on commit f66f26d

Please sign in to comment.