Add isMethodSupported handler

Summary: Allows plugin to check if something is supported by that app, for example an extension command or a new feature, before trying to use it.

Reviewed By: passy

Differential Revision: D14225957

fbshipit-source-id: 3c5a29a06b56fe5f1da772824232547447872344
This commit is contained in:
John Knox
2019-02-26 10:00:57 -08:00
committed by Facebook Github Bot
parent dbb4fa1191
commit 40ada838d7
3 changed files with 24 additions and 1 deletions

View File

@@ -53,6 +53,13 @@ class FlipperConnectionImpl : public FlipperConnection {
receivers_[method] = receiver;
}
/**
Runtime check which receivers are supported for this app
*/
bool hasReceiver(const std::string& method) {
return receivers_.find(method) != receivers_.end();
}
private:
FlipperConnectionManager* socket_;
std::string name_;