Only sending a message if we have the API id
This commit is contained in:
parent
3159a44c3a
commit
be33c91823
1 changed files with 7 additions and 8 deletions
|
@ -151,15 +151,14 @@ public class NetworkService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
public long sendMessage(ApiCallable apiCallable, int requiredApi){
|
public long sendMessage(ApiCallable apiCallable, int requiredApi){
|
||||||
int apiId = 0;
|
|
||||||
if(requiredApi != -1 && mApiIds.containsKey(requiredApi)){
|
if(requiredApi != -1 && mApiIds.containsKey(requiredApi)){
|
||||||
apiId = mApiIds.get(requiredApi);
|
int apiId = mApiIds.get(requiredApi);
|
||||||
}
|
ApiCall call = apiCallable.toApiCall(apiId, ++mCurrentId);
|
||||||
ApiCall call = apiCallable.toApiCall(apiId, ++mCurrentId);
|
mRequestClassMap.put(mCurrentId, apiCallable.getClass());
|
||||||
mRequestClassMap.put(mCurrentId, apiCallable.getClass());
|
if(mWebSocket != null && mWebSocket.send(call.toJsonString())){
|
||||||
if(mWebSocket != null && mWebSocket.send(call.toJsonString())){
|
Log.v(TAG,"-> "+call.toJsonString());
|
||||||
Log.v(TAG,"-> "+call.toJsonString());
|
return mCurrentId;
|
||||||
return mCurrentId;
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue