mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Add convenience method in FileProvider to send a message to a given file provider domain
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
0a5df3ba66
commit
292ff9b3bc
@ -39,6 +39,9 @@ public:
|
||||
|
||||
static bool fileProviderAvailable();
|
||||
|
||||
public slots:
|
||||
void sendMessageToDomain(const QString &domainIdentifier, const QString &message);
|
||||
|
||||
private slots:
|
||||
void configureXPC();
|
||||
|
||||
|
||||
@ -12,13 +12,15 @@
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include "fileprovider.h"
|
||||
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include "configfile.h"
|
||||
#include "libsync/configfile.h"
|
||||
#include "gui/macOS/fileprovidersocketcontroller.h"
|
||||
|
||||
#include "fileprovider.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
namespace OCC {
|
||||
|
||||
@ -95,5 +97,16 @@ void FileProvider::configureXPC()
|
||||
}
|
||||
}
|
||||
|
||||
void FileProvider::sendMessageToDomain(const QString &domainIdentifier, const QString &message)
|
||||
{
|
||||
const auto domainSocketController = _socketServer->socketControllerForDomain(domainIdentifier);
|
||||
if (!domainSocketController) {
|
||||
qCWarning(lcMacFileProvider) << "Could not find socket controller for domain identifier" << domainIdentifier;
|
||||
return;
|
||||
}
|
||||
|
||||
domainSocketController->sendMessage(message);
|
||||
}
|
||||
|
||||
} // namespace Mac
|
||||
} // namespace OCC
|
||||
|
||||
Loading…
Reference in New Issue
Block a user