TL;DR
snap install telegram-desktop
Telegram is probably one of the more widely used software in Ubuntu that since the constant updates isn’t convenient to use from repositories.
We already have telegram snaps, but they all are based on binaries distributed upstream, so not something is actually upstreamable, nor it allows easy improvements to get the best integration.
So, the I wanted a version that was generated from upstream code potentially without modifications. tdesktop also has a quite complex build system which needs various upstream libraries (some of them in static form) with specific versions including slightly patched Qt 5.6.2 and gyp, so it was fun to test it with the power of snapcraft.
I did a previous snap version like this already more than an year ago and worked fine but not having a system able to build this automatically in a proper way as build.snapcraft.io does today was a bit a blocker (as travis was always taking way more time than a free instance can provide).
In the mean time their code got even a bit more complicated to get compiled as now it requires gcc-7 (which is not in xenial), but snapcraft scriptlets + plugins are enough to get all the things I needed setup (so congrats to all the guys who did the snapcraft and builders job).
Anyway, lots of speaking, but it would be much appreciated if you could test it, just do:
snap install telegram-desktop
This will install the latest stable, but if you want to run the latest git revision, just use the edge
channel (that will be automatically updated at any change, so limited responsability).
Snapcraft code is at https://github.com/3v1n0/telegram-snap While builds are at https://build.snapcraft.io/user/3v1n0/telegram-snap
What you should expect is a quite native experience, in fact I also included some patches (all proposed upstream) to get Telegram feel more at home in sandboxes, to support better Ubuntu in GNOME and I’ve taken the occasion to fix libunity to handle better snapped apps without having the need to change them in order to get the Unity or Gnome Dock emblems integration (so, you should get numbers in your dock!).
Since I was there I also fixed telegram to compile properly in armhf (I hated the red light on b.s.i!), and then if you have any hardware with such arch handy and a graphic session, please test it too.
So, test and let me know!
PS: unity launcher / GNOME dock integration works, but having other .desktop
files around in your systems (like the ones that the official build generates) could cause a wrong matching, so in that case, just get rid of ~/.local/share/applications/telegramdesktop.desktop