Giter Site home page Giter Site logo

Comments (21)

danog avatar danog commented on August 21, 2024 1

@vahidvdn 1) No, it runs only when an authorization key is generated
2) No, telegram needs two keys for each datacenter (10 keys (temporary-permanent pair) if you connect to every datacenter)

from madelineproto.

danog avatar danog commented on August 21, 2024 1

Not exactly, the key sometimes has to be regenerated.

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024 1

@Max93 Welcome.

from madelineproto.

danog avatar danog commented on August 21, 2024

The prime module has to run twice (or even more if errors occurred) for every datacenter, if you're connecting to 3 datacenter it is run 6 times.
Have you pulled the latest version and did you run composer update?

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

@danog I updated to the last version, and again the same problem. It's very fast in local, but very slow in the host.

From your readme:

Also note that MadelineProto will perform better if a big math extension like gmp or bcmath is installed.

In my host, gmp is not installed, only bcmath is installed. Is it ok? Or maybe the problem is here? (both is installed in local)

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

I deactived gmp extension in local. So it became very slow.

I searched into your code, first you try to use gmp , then if not exist, use bcmath.
Performance of gmp is much more better than bcmath.

from madelineproto.

danog avatar danog commented on August 21, 2024

Hey, since you implemented Pollard Brent factorization in PHP, would you mind sending a pull request with it to https://github.com/danog/PrimeModule?
That'd be real nice.

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

@danog I sent a pull request. Please check it.

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

@danog Does prime factorization run on every single request (method)? As I understood, it does.
But as I know, telegram only requires it on auth key, Isn't it?

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

@danog Oh yes. We instantiate MadelineProto class only when an authorization key is generated by:

new \danog\MadelineProto\API($settings);

Then we just use deserialize for calling other methods and this does not need factorization module. Am I right?

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

@danog This works fine in cpanel. But I have some issues in directAdmin web host.

Of course maybe there is nothing about MadelineProto, but maybe there are something not installed in my server. When I run, it takes too long and finally gives me 500 internal error. Error log file says:

Script timed out before returning headers

Note: Php 7 is running and gmp is installed. (tested)
Is there anything more than these two that I must install in my server? (local and cpanel works fine)

from madelineproto.

danog avatar danog commented on August 21, 2024

Can you please provide logs?
(It might be due to datacenter 4, where calls were activated, not responding to req_pq)

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

No more logs is provided. I even asked from server providers. Just mentioned log.

(It might be due to datacenter 4, where calls were activated, not responding to req_pq)

Do you mean telegram's voice call? So because of that ,not responding to req_pq?

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

@danog Yes, you are right. Other methods works fine. Because I get AUTH_KEY_UNREGISTERED response message. It seems that's about responding problem to req_pq.

Why this happen? Any way to solve it?

from madelineproto.

Max93 avatar Max93 commented on August 21, 2024

@vahidvdn have u resolve ? i have the same issue. Let me know, thanks.

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

I have the same issue

What is your issue? Please explain more.

from madelineproto.

Max93 avatar Max93 commented on August 21, 2024

@vahidvdn i hope this is clear :neckbeard:
I have created a simple app. Login by phone number was successful, this is the code.

use danog\MadelineProto\Api;

$settings = json_decode(
    '{
        "app_info":{
            "api_id": *,
            "api_hash":"*"
        },
        "connection_settings":{
            "all":{"test_mode":true}
        }
    }', true) ?: [];

$MadelineProto = new Api($settings);

$sentCode = $MadelineProto->phone_login('+39 XXXXXXX');

$code = '';

for ($x = 0; $x < $sentCode['type']['length']; $x++) {
    $code .= fgetc(STDIN);
}

$MadelineProto->complete_phone_login($code);

When I try to do any operations, like send an invite or create a channel, $MadelineProto response with error:

CallHandler:    	An error occurred while calling method auth.sendInvites: AUTH_KEY_UNREGISTERED in ResponseHandler on line 343. Recreating connection and retrying to call method...
Exception:      	An error occurred while calling method auth.sendInvites (AUTH_KEY_UNREGISTERED in ResponseHandler on line 343). in CallHandler.php:191

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

@Max93 You get this exception from telegram:

AUTH_KEY_UNREGISTERED

This is not related to MadelineProto. It means you are not logged in into telegram.
You must whether use MadelineProto session management (to keep user logged in) or call any method immediately like the following:

$MadelineProto->complete_phone_login($code);
$MadelineProto->methodName();

from madelineproto.

Max93 avatar Max93 commented on August 21, 2024

@vahidvdn i call immediately the complete_phone_login whit successful result. When I try to do any operations, like send an invite or create a channel, $MadelineProto response with error AUTH_KEY_UNREGISTERED.

from madelineproto.

vahidvdn avatar vahidvdn commented on August 21, 2024

@Max93 Maybe 2fa is enabled in your telegram account.

from madelineproto.

Max93 avatar Max93 commented on August 21, 2024

@vahidvdn I don’t know why, but it works 😝. I used the web app for 2 step configuration and it worked πŸŽ†. Thanks for the support!

from madelineproto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.