Only sending a message if we have the API id

develop
Nelson R. Perez 2018-06-14 11:50:35 -05:00
parent 3159a44c3a
commit be33c91823
1 changed files with 7 additions and 8 deletions

View File

@ -151,15 +151,14 @@ public class NetworkService extends Service {
}
public long sendMessage(ApiCallable apiCallable, int requiredApi){
int apiId = 0;
if(requiredApi != -1 && mApiIds.containsKey(requiredApi)){
apiId = mApiIds.get(requiredApi);
}
ApiCall call = apiCallable.toApiCall(apiId, ++mCurrentId);
mRequestClassMap.put(mCurrentId, apiCallable.getClass());
if(mWebSocket != null && mWebSocket.send(call.toJsonString())){
Log.v(TAG,"-> "+call.toJsonString());
return mCurrentId;
int apiId = mApiIds.get(requiredApi);
ApiCall call = apiCallable.toApiCall(apiId, ++mCurrentId);
mRequestClassMap.put(mCurrentId, apiCallable.getClass());
if(mWebSocket != null && mWebSocket.send(call.toJsonString())){
Log.v(TAG,"-> "+call.toJsonString());
return mCurrentId;
}
}
return -1;
}