Changeset View
Changeset View
Standalone View
Standalone View
host/pluginmanager.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 118 | if (!plugin->isLoaded()) { | |||
---|---|---|---|---|---|
119 | return; | 119 | return; | ||
120 | } | 120 | } | ||
121 | 121 | | |||
122 | const QString event = json.value(QStringLiteral("event")).toString(); | 122 | const QString event = json.value(QStringLiteral("event")).toString(); | ||
123 | if (event.isEmpty()) { | 123 | if (event.isEmpty()) { | ||
124 | return; | 124 | return; | ||
125 | } | 125 | } | ||
126 | 126 | | |||
127 | const QJsonValue requestSerialVariant = json.value(QStringLiteral("serial")); | ||||
128 | if (!requestSerialVariant.isUndefined()) { | ||||
129 | const int requestSerial = requestSerialVariant.toInt(); | ||||
130 | | ||||
131 | const auto reply = plugin->handleData(requestSerial, event, json); | ||||
132 | if (!reply.isEmpty()) { | ||||
fvogt: Might be useful to always reply as ack? | |||||
133 | plugin->sendReply(requestSerial, reply); | ||||
134 | } | ||||
135 | } else { | ||||
127 | //design question, should we have a JSON of subsystem, event, payload, or have all data at the root level? | 136 | //design question, should we have a JSON of subsystem, event, payload, or have all data at the root level? | ||
128 | plugin->handleData(event, json); | 137 | plugin->handleData(event, json); | ||
129 | } | 138 | } | ||
139 | } |
Might be useful to always reply as ack?