Skip to content

Commit f301d4e

Browse files
committed
remove RPC method "getAvailableMethods"
1 parent 6111ecb commit f301d4e

3 files changed

Lines changed: 0 additions & 44 deletions

File tree

docs/JSON-RPC.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,6 @@ Results:
9595
| result | string | "ok" on success |
9696

9797

98-
### jamulus/getAvailableMethods
99-
100-
Returns all available rpc methods.
101-
102-
Parameters:
103-
104-
| Name | Type | Description |
105-
| --- | --- | --- |
106-
| params | object | No parameters (empty object). |
107-
108-
Results:
109-
110-
| Name | Type | Description |
111-
| --- | --- | --- |
112-
| result.methods | array | All available methods. |
113-
114-
11598
### jamulus/getMode
11699

117100
Returns the current mode, i.e. whether Jamulus is running as a server or client.

src/rpcserver.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,6 @@ CRpcServer::CRpcServer ( QObject* parent, QString strBindIP, int iPort, QString
6666
response["result"] = result;
6767
Q_UNUSED ( params );
6868
} );
69-
70-
/// @rpc_method jamulus/getAvailableMethods
71-
/// @brief Returns all available rpc methods.
72-
/// @param {object} params - No parameters (empty object).
73-
/// @result {array} result.methods - All available methods.
74-
HandleMethod ( "jamulus/getAvailableMethods", [=] ( const QJsonObject& params, QJsonObject& response ) {
75-
QJsonObject result = getAvailableMethods();
76-
response["result"] = result;
77-
Q_UNUSED ( params );
78-
} );
7969
}
8070

8171
CRpcServer::~CRpcServer()
@@ -234,22 +224,6 @@ void CRpcServer::HandleApiAuth ( QTcpSocket* pSocket, const QJsonObject& params,
234224

235225
void CRpcServer::HandleMethod ( const QString& strMethod, CRpcHandler pHandler ) { mapMethodHandlers[strMethod] = pHandler; }
236226

237-
QJsonObject CRpcServer::getAvailableMethods()
238-
{
239-
QJsonArray methods;
240-
QMapIterator<QString, CRpcHandler> i ( mapMethodHandlers );
241-
242-
while ( i.hasNext() )
243-
{
244-
i.next();
245-
methods.append ( i.key() );
246-
}
247-
QJsonObject result{
248-
{ "methods", methods },
249-
};
250-
return result;
251-
}
252-
253227
void CRpcServer::ProcessMessage ( QTcpSocket* pSocket, QJsonObject message, QJsonObject& response )
254228
{
255229
if ( !message["method"].isString() )

src/rpcserver.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class CRpcServer : public QObject
7272
bool Start();
7373
void HandleMethod ( const QString& strMethod, CRpcHandler pHandler );
7474
void BroadcastNotification ( const QString& strMethod, const QJsonObject& aParams );
75-
QJsonObject getAvailableMethods();
7675

7776
static QJsonObject CreateJsonRpcError ( int code, QString message );
7877

0 commit comments

Comments
 (0)