Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetOptions() hangs when updating online status #65

Closed
DopeforHope opened this issue Jan 7, 2020 · 1 comment
Closed

SetOptions() hangs when updating online status #65

DopeforHope opened this issue Jan 7, 2020 · 1 comment

Comments

@DopeforHope
Copy link
Contributor

DopeforHope commented Jan 7, 2020

Hello,

so I want to set the Online Status to online for using secret chats.

Therefore I firstly call the setOption function (link: https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1set_option.html) as described in this issue from TDlib tdlib/td#714.

I'm using the newest version of TDlib (compiled by my own)

So my code after login:

### Yomam
tg = Telegram(
    api_id=XXXX,
    api_hash=XXXX,
    phone=XXXX,
    database_encryption_key=XXXX,
    library_path="XXXX/tdlib/lib/libtdjson.so.1.5.4"
)

tg.login()


#Set online status
data = {
    '@type': 'setOption',
    'name': 'online',
    'value': {
        '@type': 'optionValueBoolean',
        'value': True,
    },
}

result = tg._send_data(data)
result.wait()
print(result.update)

result = tg.call_method("getOption", params={'name':'online'})
result.wait()
print(result.update)

tg.idle()

Output is:

...
XXXX [INFO] telegram.client: Completing auth process

And then it hangs...

So any ideas how to handle this?

@DopeforHope DopeforHope changed the title Is it possible to retrieve the returned function pointer of setOptions()? SetOptions() hangs when updating online status Jan 7, 2020
@DopeforHope
Copy link
Contributor Author

So the problem is that result.wait() waits indefinitely.
setOptions should return a function pointer to update the status.

Nevertheless it seems like the App shows the person as online. So i guess there one doesn't need the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant