diff options
Diffstat (limited to 'common/listener.cpp')
-rw-r--r-- | common/listener.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/listener.cpp b/common/listener.cpp index c9fd9d3..c6747cd 100644 --- a/common/listener.cpp +++ b/common/listener.cpp | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "common/revisionupdate_generated.h" | 33 | #include "common/revisionupdate_generated.h" |
34 | #include "common/notification_generated.h" | 34 | #include "common/notification_generated.h" |
35 | #include "common/revisionreplayed_generated.h" | 35 | #include "common/revisionreplayed_generated.h" |
36 | #include "common/secret_generated.h" | ||
36 | 37 | ||
37 | #include <QLocalServer> | 38 | #include <QLocalServer> |
38 | #include <QLocalSocket> | 39 | #include <QLocalSocket> |
@@ -240,6 +241,17 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c | |||
240 | } | 241 | } |
241 | break; | 242 | break; |
242 | } | 243 | } |
244 | case Sink::Commands::SecretCommand: { | ||
245 | flatbuffers::Verifier verifier((const uint8_t *)commandBuffer.constData(), commandBuffer.size()); | ||
246 | if (Sink::Commands::VerifySecretBuffer(verifier)) { | ||
247 | auto buffer = Sink::Commands::GetSecret(commandBuffer.constData()); | ||
248 | loadResource().setSecret(QString{buffer->secret()->c_str()}); | ||
249 | } else { | ||
250 | SinkWarning() << "received invalid command"; | ||
251 | } | ||
252 | break; | ||
253 | } | ||
254 | |||
243 | case Sink::Commands::SynchronizeCommand: | 255 | case Sink::Commands::SynchronizeCommand: |
244 | case Sink::Commands::InspectionCommand: | 256 | case Sink::Commands::InspectionCommand: |
245 | case Sink::Commands::DeleteEntityCommand: | 257 | case Sink::Commands::DeleteEntityCommand: |