Tdesktop: [Feature request] Multiple accounts support

Created on 30 Dec 2017  ·  110Comments  ·  Source: telegramdesktop/tdesktop

Steps to reproduce

Nothing.

Expected behaviour

There is menu to login into (three?) different accounts just like in Telegram v4.7 for Android, so I don't have to open multiple Telegram Desktop windows and messing with launcher script or config directory, etc.

Actual behaviour

I can now login into multiple accounts by issuing -workdir or -many -workdir, but this is an inconvenient process because I have to open multiple Telegram Desktop windows and provide many config directories.

Configuration

Operating system: Debian Sid 64 bit
Version of Telegram Desktop: 1.2.6 alpha
Used theme: Default

Logs:
Insert logs here (if necessary)


enhancement

Most helpful comment

Try Franz, it's not perfect but it's something.

I'd love to have it implemented natively, too 👍

All 110 comments

Try Franz, it's not perfect but it's something.

I'd love to have it implemented natively, too 👍

I knew about Franz, Rambox, Wavebox or just the new Firefox Quantum multi container. But that all just a Telegram web (wrapper), which mean it's limited in features and resource hungry. I hope for a native implementation.

533

@cobalto Multiple instances != Multiple accounts in once instance.

@stek29 disagree.
They asked for multiple instances to have multiple accounts at the same machine when "multiple accounts" wasnt a feature of telegram. Now it is and now you can ask for it.

So, I think its for the same use, that's why I quoted the other one here.

But I probably should have done the opposite, but now both are linked and that's what I wanted. Not gonna fix that now ^^'

Would love to see this.

I need this too

I really need this feature.

Needed badly here too.

_Yes yes same here_

I claimed my heart reaction too, kind heart-reaction stranger. Now deliver

hope it will be implemented soon. So we can easily switch between account for family and work.

+1

waiting for it

+1

+1

Stop with the +1s, reactions are there for a reason. +1s are just useless noise

@john-preston, did you have plan for this issue?

@Kirill At the moment I don’t :(

Hi, guys)

Any updates?

waiting for implementation.

+1

It's available on Android since Pleistocene, why it takes so long to do the same thing on the desktop client?

Hope this gets added soon

Very need this function.
It is very important to separate the work account and the personal.

Any updates on this feature? :disappointed:

Steps to reproduce

Nothing.

Expected behaviour

There is menu to login into (three?) different accounts just like in Telegram v4.7 for Android, so I don't have to open multiple Telegram Desktop windows and messing with launcher script or config directory, etc.

Actual behaviour

I can now login into multiple accounts by issuing -workdir or -many -workdir, but this is an inconvenient process because I have to open multiple Telegram Desktop windows and provide many config directories.

Configuration

Operating system: Debian Sid 64 bit
Version of Telegram Desktop: 1.2.6 alpha
Used theme: Default
Logs:
Insert logs here (if necessary)

first go there and download it for you system. 1)TelegramForcePortable https://imgur.com/a/VUGxOrU 2 method) On macOS, just use -workdir parameter, it won’t work if you add many -workdir

Subscribing to this, guess tdesktop is the only remaining client between both official clients and unofficial that still don't have it. Hope it gets implemented soon :)

I don't know about windows. But on OSX and Linux you can use the -workdir argument to create more instances.

I do know this is inconvenient for some people and that this issue exists for over a year now and there is still no way in the client itself to switch accounts with a few mouse clicks. But neither have I seen some guide to use this feature so here it is. I hope it helps you out.

:exclamation: replace words in {{}} with your own username and such (without the brackets).

Linux
MacOSX
Windows

Linux

  • Create a folder here ~/.local/share/TelegramDesktop/{{MyUsername}}
  • Create a new .desktop file here ~/.local/share/applications/telegramdesktop-{{myusername}}.desktop.
  • Put in your data in here
[Desktop Entry]
Version=1.0
Name=Telegram MyUsername
Comment=Official desktop application for the Telegram messaging service
TryExec=/opt/Telegram/Telegram
Exec=/opt/Telegram/Telegram -workdir /home/{{your_user}}/.local/share/TelegramDesktop/{{MyUsername}} -- %u
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;
Keywords=tg;chat;im;messaging;messenger;sms;tdesktop;
X-GNOME-UsesNotifications=true
X-Desktop-File-Install-Version=0.23

MacOSX

  • Create a folder here: ~/.local/share/TelegramDesktop/{{MyUsername}}
  • Open Automator
  • Create a new Application
    image
  • Add an apple script by drag & drop from the left-hand side
  • Add the following text:
do shell script "Applications/Telegram.app/Contents/MacOS/Telegram -workdir '/Users/{{your_user}}/.local/share/TelegramDesktop/{{MyUsername}}'"

image

  • Save to /Applications/Telegram {{MyUsername}}.app
  • Now lastly if you want the have the same icon for your new app, open the file info of both apps (the original telegram and yours) with CMD+I and click on the icon in the top left of the original application. Hit copy CMD+C, click on yours and hit past CMD+V.

Windows

  • Create a folder here: C:\Users\{{your_user}}\AppData\Roaming\Telegram Desktop\{{MyUsername}}
  • Rightclick on your desktop and create a new shortcut
  • Put this in the location field
"C:\Users\{{your_user}}\AppData\Roaming\Telegram Desktop\Telegram.exe" -workdir "C:\Users\{{your_user}}\AppData\Roaming\Telegram Desktop\{{MyUsername}}"
  • Click next and type in a name for the shortcut, usually something like Telegram {{MyUsername}}
  • Lastly, to find the application via the start menu you have to copy the link in here
C:\Users\{{your_user}}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Telegram Desktop

https://gist.github.com/Nachtalb/ec590dc974f6ba4674972d4937b230be

There should not need to be a workaround for this, this should be implemented directly into the client.

@ShadowJonathan I think so too. But it is not implemented yet and I don't know C++ and so cannot make a PR. For the time being, until someone implements it, this is the best solution we've got IMHO.

@ShadowJonathan I think so too. But it is not implemented yet and I don't know C++ and so cannot make a PR. For the time being, until someone implements it, this is the best solution we've got IMHO.

exactly so i dont even know or see the reason to down vote my solution for this. people are just ungraceful

@ShadowJonathan Multiple instances and multiple accounts are definitely different things, and look at
the "actual behaviour" part

@hexauniverse in this case, a strategy with multiple instances has to be used to have telegram work with multiple accounts at once, it is a workaround

Telegram Mobile Android also now implements this natively, before this, only Telegram X did.

I think it's time for telegram desktop to also have this feature, to normalize the features all across the native clients, what do you think, @john-preston?

I can't understand, why it's still not implemented. It's pretty important feature for a lot of people and the official android app supports it, so the devs ignoring this seems strange.

UNIGRAM

@fredboy simply because it's hard to implement it

@RememberTheAir is it? Just create separate config folders and make a UI for it. Even if it's not that simple, you have a lot of examples how to do it. I don't think that's the problem here

@fredboy it's not just a matter of creating different dirs and configs and copying code from other softwares lol. TDesktop is a quiet big C++ codebase which has not been written with multiple accounts in mind and, for what I know, a lot of parts of the app (especially messages and media storage) would have to be rewritten to handle properly the activity of multiple accounts. That's not something trivial you do in a week, especially if you consider the frequency at which Telegram releases new features. The fact that adding multi-accounts support is not a trivial task at all and would require a major rewrite of the app has been stated by the dev somewhere around this issues tracker, iirc

@RememberTheAir damn, i'm stupid. Anyway, easy or not, I hope they're working on it, cause it's quite useful and demanded feature.

I hope this task will be closed soon.

Just do it! :D
Please.

@stek29 @john-preston

Guys, why are PC users second-class citizens compared to mobile device users nowadays?

We shouldn't be waiting two years to get this basic feature in the official Telegram desktop client. Also, not even acknowledging this feature request officially for two years, and setting a milestone for it or closing it as "won't fix" if you don't intend to follow up is plain rude.

In my opinion the easiest way to implement it would be to change the list of chats into a tree with accounts represented as collapsible/expandable root nodes and chats as their leaf nodes so you can be logged in into more than one account at the same time from a single Telegram instance and window.

I tried https://github.com/UnigramDev/Unigram and realized it was kind of unstable and slow despite my decent system specs, so I used the power of GitHub and noticed there are THOUSANDS of forks of this project. https://github.com/Forkgram/tdesktop worked fine for my 2nd account. Certainly easier than trying to do command line arguments and run multiple instance of TDesktop (with the same icon, etc). https://github.com/kotatogram/kotatogram-desktop looked similar. There's A LOT out there.

@ScottRFrost No Linux support for Forkgram? It appears Linux users are third-class citizens.

@amirashabani ...or maybe its developer is a Windows users and he's building that client based on his needs, which appears to be the case. I don't see any issue asking for Linux support, maybe you can try to ask to its dev if he's available to build for linux too

@amirashabani - If you're on ChromeOS (which is what I assume you mean by desktop linux) then you can just use the Android Telegram X, which support multiple accounts.

If you mean old school try-hard KDE or something, then you're out of luck, but you're probably used very few apps working if you're running old school desktop Linux. Re-roll to Windows or Hackintosh.

@ScottRFrost Am I missing something? I can't find multi-account feature in Forkgram.

@dausruddin there isn't. He's suggesting to use different forks each one with its own account. Actually you can use tdesktop to do this, it can be launched multiple times using different working directories where config files are stored independently (see the OP)

@RememberTheAir oh. I am quite dissapointed. Thanks. I guess I'll stick to Unigram for now even I got error popping up sometimes.

@ScottRFrost Since when "KDE or something" is old school? Anyway, I'm using Arch Linux with Cinnamon as DE. But that's irrelevant; If they add this feature to the desktop client, I'll be able to use it, just like I'm using this desktop client perfectly fine right now.

+1 support multiple account it would be nice

+1 Needed function

@john-preston Please pay attention and answer the open issue.

A whole year has passed, there is a desire to do this? 😉

@MairwunNx There is a desire, there is no time :(

+1 multiple accounts feature

+1 truly needed feature

+1 multiple accounts feature

Telefeul (an unofficial Telegram client geared towards professionals & power users) recently announced support for multiple Telegram accounts in their web and desktop apps (Mac, Windows, and Linux):

https://www.telefuel.com/blog/multiple-account-support

Could you shut up and stop advertising your proprietary garbage?

@VanToai no one here supporting OPEN SOURCE Telegram wants to pay $10/mo for your proprietary, closed source knock-off.

Click his username then on the left column, click Block or report user, then Report Abuse and in the comment mention he's spamming his commercial product.

Hi @lastweakness @ScottRFrost - I apologize that my message offended you (I've deleted it, for good measure).

Our genuine intention with Telefuel is to create new, _unique_ value for our users and for the broader Telegram ecosystem. We are working hard to do just that, with no malevolent intent.

You are not my enemy. I hope I am not yours. I wish you all the best.

+1 Very useful feature. I look forward to the implementation.

Contributing guidelines tell:

Unfortunately we do not merge any pull requests that have new feature implementations, translations to new languages and those which introduce any new user interface elements.

If someone PRs this feature, will it be merged? I'm quite interested in this right now.

@B1Z0N preston stated multiple times memory leaks needs to be fixed 1st.

@B1Z0N I don't think anyone will PR this, because it is too huge of a task.

@john-preston , if no one will PR this, then how are we going to close the issue?

@Aokromes , oops, sorry. I haven't seen that.

@john-preston , if no one will PR this, then how are we going to close the issue?

Wait for Telegram to implement it

preston stated multiple times memory leaks needs to be fixed 1st.

I don't think anyone will PR this, because it is too huge of a task.

Is multiple account support possible? And if so, is there demand for it? And if that's true, how high is it on the priority list according to that demand?
Because these last two replies are contradicting eachother while assuming different answers of those questions.

Is multiple account support possible?

I guess so, probably after a major refactoring of tdesktop's storage management, I assume based on what has been said by the developer until now

And if so, is there demand for it?

Definitely

And if that's true, how high is it on the priority list according to that demand?

Probably lower than people would expect since there's a workaround to use multiple accounts on the same machine and (I guess) keeping up with the mobile and wallet updates has higher priority than this. Don't quote me on that. Just guessing

Because these last two replies are contradicting eachother while assuming different answers of those questions.

The original question was whether tdesktop would accept a PR implementing multiple accounts support or not. This is a pretty huge task, as said by Preston, so a PR fixing the memory leaks problems and implementing multiple accounts is highly unlikely to come. I would say that, if done right, they would accept it, but I'm pretty sure no one will submit it. So the only way to close this issue, that is, having multiple accounts support on tdesktop, is to wait for Telegram to put some resources on this task

Please !!

@RememberTheAir

The original question was whether tdesktop would accept a PR implementing multiple accounts support or not. This is a pretty huge task, as said by Preston, so a PR fixing the memory leaks problems and implementing multiple accounts is highly unlikely to come. I would say that, if done right, they would accept it, but I'm pretty sure no one will submit it. So the only way to close this issue, that is, having multiple accounts support on tdesktop, is to wait for Telegram to put some resources on this task

It seems a job for @23rd and ForkGram (@23rd it's one of the most contributor of this repo)

I solved multiple accounts for myself on ubuntu distro (linux):
At the first create workdirs for each user accounts:

$ mkdir /home/<User>/Telegram/USER1
$ mkdir /home/<User>/Telegram/USER2

Then open ~/.bashrc and set alias for each user accounts and save it.

alias telegram_user1='/PATH/TO/SOURCE/Telegram -workdir /home/<User>/Telegram/USER1/ -- %u'
alias telegram_user2='/PATH/TO/SOURCE/Telegram -workdir /home/<User>/Telegram/USER2/ -- %u'

Now you can run multiple telegram account by terminal command:

$ telegram_user1
$ telegram_user2

+1 truly needed feature

+1 for this one. It'd be really useful :)

+1 would love to see this feature on windows client

I love to be notified by comments that can just be a 👍 reaction to the OP and add nothing to the conversation

It's a more active lobbying

It's a more active lobbying

In my experience, it doesn't matter. You can look at Microsoft's product issue, for example: https://github.com/microsoft/vscode/issues/519

4 years from the start, top-3 issue by 👍 reaction on the OP, hundreds of comments, and… nothing.

Such products have closed road-maps and plans. For example, Telegram is releasing new polls right now. For Telegram, it matters more than this issue. Developers of Telegram Desktop are busy for in-time release. So… They know about your wish, here are comments from maintainers, but there is no time unfortunately for implementing.

I just gave up and started using Unigram. It's not as polished but it's not the buggy mess it used to be, plus I get the added bonus of desktop access to Instant View and Secret Chats.

I just gave up and started using Unigram. It's not as polished but it's not the buggy mess it used to be, plus I get the added bonus of desktop access to Instant View and Secret Chats.

Well, on Windows is possible. Not everyone use windows :wink:

+1 just do it

wait for a long time

still waiting....

I am using 2 accounts in 2 different instances of telegram-desktop on Ubuntu.

  1. Installed via snap snap install telegram-desktop --edge
  2. Downloaded tsetup binary from releases.

Works fine for me.

However you will have duplicated resource usage (which is the same problem with profiles also) while the Android client runs just one instance which I would expect Telegram desktop to also do.

must have

This is so frustrating. It's a core feature of TG messenger. Why do ignore this issue so long?

This is so frustrating. It's a core feature of TG messenger. Why do ignore this issue so long?

https://github.com/telegramdesktop/tdesktop/issues/4261#issuecomment-557918018

This is so frustrating. It's a core feature of TG messenger. Why do ignore this issue so long?

#4261 (comment)

It's a normal for telegram, they don't just implement features, they think how it would be better to implement them. We waited a pinned chats, limit since 2017 and they made a "groups". I think they have some internal management that decides what is critical and what is not. (or maybe its their business plan to make people wait)

Since telegram is a free service, I don't think that it is acceptable to demand anything from the devs.

It _is_ an open source project so anyone could add this feature. git clone and off you go

Since telegram is a free service, I don't think that it is acceptable to demand anything from the devs.

It _is_ an open source project so anyone could add this feature. git clone and off you go

"open source" is a wall between server side limits and users.

It is an opensource project so anyone could add this feature. git clone and off you go

Thanks. I now have the source locally. I just need to learn how to code. Really helpful :D

@dausruddin well you can always hire someone to do what you can't or won't do.

@Hypfer Oh. I thought anyone could do this. Thanks. I will consider :)

This is so frustrating. It's a core feature of TG messenger. Why do ignore this issue so long?

#4261 (comment)

It's a normal for telegram, they don't just implement features, they think how it would be better to implement them. We waited a pinned chats, limit since 2017 and they made a "groups". I think they have some internal management that decides what is critical and what is not. (or maybe its their business plan to make people wait)

https://github.com/telegramdesktop/tdesktop/issues/4261#issuecomment-544142079
https://github.com/telegramdesktop/tdesktop/issues/4261#issuecomment-557921243

This is so frustrating that this feature is not available after these many requests.
+1

read the message over your message.

Oh boy.
Who said dreams don't come true (sometimes)? 🙃

@Aokromes closed this 34 minutes ago

Sorry, but why? I don't see real code changes for multi-accounts.

@Aokromes closed this 34 minutes ago

Sorry, but why? I don't see real code changes for multi-accounts.

https://github.com/telegramdesktop/tdesktop/commit/b6ac4a0233cfc8ff6bda8f4aa8cd6463e38be9e7 (ofc that's only the final commit of the work on multiaccount)

Maybe this should've been closed only once the release is ready. Is it going to be released soon? Since there's a closed alpha, there's still tests going on and maybe we will get it in the next days only

b6ac4a0

I saw it, but there is "6 changed files with 15 additions and 19 deletions". It doesn't seem like real multi-account support.

(ofc that's only the final commit of the work on multiaccount)

OK, then thank you all very much!

Maybe this should've been closed only once the release is ready. Is it going to be released soon? Since there's a closed alpha, there's still tests going on and maybe we will get it in the next days only

There are a few different strategies for closing issues in project. As I've understand, in this project issues closed when merged in a main branch. So, let's just wait for a release.

miracle

b6ac4a0

I saw it, but there is "6 changed files with 15 additions and 19 deletions". It doesn't seem like real multi-account support.

Yeah, it's normal, this is the "Closed Alpha", with this commit we can see that they're working on :3

b6ac4a0

I saw it, but there is "6 changed files with 15 additions and 19 deletions". It doesn't seem like real multi-account support.

Yeah, it's normal, this is the "Closed Alpha", with this commit we can see that they're working on :3

not anymore closed alpha. it was pushed to dev branch, so public.

b6ac4a0

I saw it, but there is "6 changed files with 15 additions and 19 deletions". It doesn't seem like real multi-account support.

Yeah, it's normal, this is the "Closed Alpha", with this commit we can see that they're working on :3

not anymore closed alpha. it was pushed to dev branch, so public.

How can this be tested?

b6ac4a0

I saw it, but there is "6 changed files with 15 additions and 19 deletions". It doesn't seem like real multi-account support.

Yeah, it's normal, this is the "Closed Alpha", with this commit we can see that they're working on :3

not anymore closed alpha. it was pushed to dev branch, so public.

How can this be tested?

compiling yourself or waiting for release on the next few hours-days.

Does work on https://web.telegram.org/ also?

Was this page helpful?
0 / 5 - 0 ratings