From f58874572da95eb6aadb25623c6b86648f8c94bf Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 12 Oct 2020 17:17:57 +0400 Subject: [PATCH] Check actual socket path length rather than InSnap/InFlatpak --- Telegram/SourceFiles/platform/linux/specific_linux.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 179785e545..753b61e2fe 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -799,10 +799,15 @@ QString AppRuntimeDirectory() { } QString SingleInstanceLocalServerName(const QString &hash) { - if (InFlatpak() || InSnap()) { + const auto idealSocketPath = AppRuntimeDirectory() + + hash + + '-' + + cGUIDStr(); + + if (idealSocketPath.size() > 108) { return AppRuntimeDirectory() + hash; } else { - return AppRuntimeDirectory() + hash + '-' + cGUIDStr(); + return idealSocketPath; } }