2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 15:15:13 +00:00

Check actual socket path length rather than InSnap/InFlatpak

This commit is contained in:
Ilya Fedin
2020-10-12 17:17:57 +04:00
committed by John Preston
parent 143b9682a4
commit f58874572d

View File

@@ -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;
}
}