0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2024-12-22 21:53:31 -05:00
LibreWolf/patches/dbus_name.patch

87 lines
4.3 KiB
Diff
Raw Normal View History

--- a/toolkit/components/remote/nsDBusRemoteClient.cpp
+++ b/toolkit/components/remote/nsDBusRemoteClient.cpp
2023-11-23 14:00:06 -05:00
@@ -73,7 +73,7 @@ bool nsDBusRemoteClient::GetRemoteDestinationName(const char* aProgram,
2022-07-02 09:52:10 -05:00
mozilla::XREAppData::SanitizeNameForDBus(profileName);
aDestinationName =
- nsPrintfCString("org.mozilla.%s.%s", aProgram, profileName.get());
+ nsPrintfCString("io.gitlab.%s.%s", aProgram, profileName.get());
if (aDestinationName.Length() > DBUS_MAXIMUM_NAME_LENGTH)
aDestinationName.Truncate(DBUS_MAXIMUM_NAME_LENGTH);
2023-11-23 14:00:06 -05:00
@@ -87,7 +87,7 @@ bool nsDBusRemoteClient::GetRemoteDestinationName(const char* aProgram,
if (!sDBusValidateBusName(aDestinationName.get(), nullptr)) {
// We don't have a valid busName yet - try to create a default one.
aDestinationName =
- nsPrintfCString("org.mozilla.%s.%s", aProgram, "default");
+ nsPrintfCString("io.gitlab.%s.%s", aProgram, "default");
if (!sDBusValidateBusName(aDestinationName.get(), nullptr)) {
// We failed completelly to get a valid bus name - just quit
// to prevent crash at dbus_bus_request_name().
2023-11-23 14:00:06 -05:00
@@ -115,7 +115,7 @@ nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProgram,
2022-07-02 09:52:10 -05:00
}
nsAutoCString pathName;
- pathName = nsPrintfCString("/org/mozilla/%s/Remote", appName.get());
+ pathName = nsPrintfCString("/io/gitlab/%s/Remote", appName.get());
static auto sDBusValidatePathName = (bool (*)(const char*, DBusError*))dlsym(
RTLD_DEFAULT, "dbus_validate_path");
2023-11-23 14:00:06 -05:00
@@ -126,7 +126,7 @@ nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProgram,
}
nsAutoCString remoteInterfaceName;
- remoteInterfaceName = nsPrintfCString("org.mozilla.%s", appName.get());
+ remoteInterfaceName = nsPrintfCString("io.gitlab.%s", appName.get());
2022-07-02 09:52:10 -05:00
LOG(" DBus destination: %s\n", destinationName.get());
LOG(" DBus path: %s\n", pathName.get());
--- a/toolkit/components/remote/nsDBusRemoteServer.cpp
+++ b/toolkit/components/remote/nsDBusRemoteServer.cpp
@@ -28,7 +28,7 @@ static const char* introspect_template =
"1.0//EN\"\n"
"\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
"<node>\n"
- " <interface name=\"org.mozilla.%s\">\n"
+ " <interface name=\"io.gitlab.%s\">\n"
" <method name=\"OpenURL\">\n"
" <arg name=\"url\" direction=\"in\" type=\"ay\"/>\n"
" </method>\n"
@@ -38,7 +38,7 @@ static const char* introspect_template =
bool nsDBusRemoteServer::HandleOpenURL(const gchar* aInterfaceName,
const gchar* aMethodName,
2024-04-18 10:45:23 -05:00
const gchar* aParam) {
- nsPrintfCString ourInterfaceName("org.mozilla.%s", mAppName.get());
+ nsPrintfCString ourInterfaceName("io.gitlab.%s", mAppName.get());
if ((strcmp("OpenURL", aMethodName) != 0) ||
(strcmp(ourInterfaceName.get(), aInterfaceName) != 0)) {
@@ -129,7 +129,7 @@ static const GDBusInterfaceVTable gInterfaceVTable = {
HandleMethodCall, HandleGetProperty, HandleSetProperty};
void nsDBusRemoteServer::OnBusAcquired(GDBusConnection* aConnection) {
- mPathName = nsPrintfCString("/org/mozilla/%s/Remote", mAppName.get());
+ mPathName = nsPrintfCString("/io/gitlab/%s/Remote", mAppName.get());
static auto sDBusValidatePathName = (bool (*)(const char*, DBusError*))dlsym(
RTLD_DEFAULT, "dbus_validate_path");
if (!sDBusValidatePathName ||
2023-11-23 14:00:06 -05:00
@@ -202,8 +202,7 @@ nsresult nsDBusRemoteServer::Startup(const char* aAppName,
mozilla::XREAppData::SanitizeNameForDBus(profileName);
- nsPrintfCString busName("org.mozilla.%s.%s", mAppName.get(),
- profileName.get());
+ nsPrintfCString busName("io.gitlab.%s.%s", mAppName.get(), profileName.get());
if (busName.Length() > DBUS_MAXIMUM_NAME_LENGTH) {
busName.Truncate(DBUS_MAXIMUM_NAME_LENGTH);
}
@@ -217,7 +216,7 @@ nsresult nsDBusRemoteServer::Startup(const char* aAppName,
// We don't have a valid busName yet - try to create a default one.
if (!sDBusValidateBusName(busName.get(), nullptr)) {
- busName = nsPrintfCString("org.mozilla.%s.%s", mAppName.get(), "default");
+ busName = nsPrintfCString("io.gitlab.%s.%s", mAppName.get(), "default");
if (!sDBusValidateBusName(busName.get(), nullptr)) {
// We failed completelly to get a valid bus name - just quit
// to prevent crash at dbus_bus_request_name().