d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
538 stars 41 forks source link

[Feature Request] Custom server for new account #72

Closed steven9463912 closed 1 year ago

steven9463912 commented 1 year ago

Feature request: when adding a new account, let the user choose the ip/url of the endpoint of the telegram server, that way it will work also on custom servers

d99kris commented 1 year ago

Hi, I never heard about custom Telegram servers before. Any idea how to get access to such a server to test it, in case this feature is implemented?

Note though that this does not sound like a typical use-case to me, so I'm a little hesitant to add this support.

If after all it's added, I think it'll be a "hidden" feature, by setting some env variable or something, so not to confuse the 99.9% normal users who don't want to use a custom server. 🙂

steven9463912 commented 1 year ago

There's a lot of them, as github repository. I don't know if all of them are 100% functional and if they have implemented all APIs, but it's really useful for them to have a client to test their server with or to give users to install

  1. https://github.com/aykutalparslan/Ferrite
  2. https://github.com/teamgram/teamgram-server

You can find more here https://github.com/search?q=telegram+server

steven9463912 commented 1 year ago

I 100% agree with you to hide the possibility very well in order to not confuse any user

d99kris commented 1 year ago

I've done a little research and I couldn't find any API in tdlib (the official Telegram client library, that nchat uses) for using custom server hosts. Based on this and the fact that testing this feature would be cumbersome, I think I'll have have to consider this out of scope for nchat.

Will proceed to close this issue.

steven9463912 commented 1 year ago

This is not a tdlib api or feature, it's you who customize the endpoints

But that's okay, it's your call

d99kris commented 1 year ago

Yeah, maybe I can clarify a bit - so nchat is a fairly small project < 10 kLOC and it's built upon other libraries providing the actual protocol support; tdlib ~520 kLOC for Telegram, whatsmeow ~35 kLOC for WhatsApp. And there could be other libraries for new chat/IM protocols in the future.

In any case, I don't want nchat to deviate too much from upstream dependency libs to minimize work. Therefore it's not an option for me to introduce features requiring (substantial) modifications to those upstream libraries. Had there been available APIs to achieve requested functionality, it would be a different question.

Hope this clarifies my previous response.

steven9463912 commented 1 year ago

Yeah I see, thanks