mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Start using new api holder for jobs
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
57c2858737
commit
7aa4743a32
@ -37,9 +37,9 @@ import com.nextcloud.talk.models.json.generic.GenericOverall;
|
|||||||
import com.nextcloud.talk.models.json.push.PushConfigurationState;
|
import com.nextcloud.talk.models.json.push.PushConfigurationState;
|
||||||
import com.nextcloud.talk.utils.ApiUtils;
|
import com.nextcloud.talk.utils.ApiUtils;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
|
import com.nextcloud.talk.utils.singletons.ApplicationWideApiHolder;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.CookieManager;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.zip.CRC32;
|
import java.util.zip.CRC32;
|
||||||
|
|
||||||
@ -50,7 +50,6 @@ import autodagger.AutoInjector;
|
|||||||
import io.reactivex.CompletableObserver;
|
import io.reactivex.CompletableObserver;
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import okhttp3.JavaNetCookieJar;
|
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
|
|
||||||
@ -75,6 +74,7 @@ public class AccountRemovalWorker extends Worker {
|
|||||||
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
||||||
|
|
||||||
PushConfigurationState pushConfigurationState;
|
PushConfigurationState pushConfigurationState;
|
||||||
|
String credentials;
|
||||||
for (Object userEntityObject : userUtils.getUsersScheduledForDeletion()) {
|
for (Object userEntityObject : userUtils.getUsersScheduledForDeletion()) {
|
||||||
UserEntity userEntity = (UserEntity) userEntityObject;
|
UserEntity userEntity = (UserEntity) userEntityObject;
|
||||||
try {
|
try {
|
||||||
@ -83,11 +83,12 @@ public class AccountRemovalWorker extends Worker {
|
|||||||
PushConfigurationState.class);
|
PushConfigurationState.class);
|
||||||
PushConfigurationState finalPushConfigurationState = pushConfigurationState;
|
PushConfigurationState finalPushConfigurationState = pushConfigurationState;
|
||||||
|
|
||||||
ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(new
|
ncApi = ApplicationWideApiHolder.getInstance().getNcApiInstanceForAccountId(userEntity.getId(), null);
|
||||||
JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class);
|
credentials = ApiUtils.getCredentials(userEntity.getUserId(), userEntity.getToken());
|
||||||
|
|
||||||
ncApi.unregisterDeviceForNotificationsWithNextcloud(ApiUtils.getCredentials(userEntity.getUsername(),
|
String finalCredentials = credentials;
|
||||||
userEntity.getToken()), ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()))
|
ncApi.unregisterDeviceForNotificationsWithNextcloud(credentials, ApiUtils.getUrlNextcloudPush(userEntity
|
||||||
|
.getBaseUrl()))
|
||||||
.blockingSubscribe(new Observer<GenericOverall>() {
|
.blockingSubscribe(new Observer<GenericOverall>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
@ -105,8 +106,7 @@ public class AccountRemovalWorker extends Worker {
|
|||||||
finalPushConfigurationState.getDeviceIdentifierSignature());
|
finalPushConfigurationState.getDeviceIdentifierSignature());
|
||||||
|
|
||||||
ncApi.unregisterDeviceForNotificationsWithProxy
|
ncApi.unregisterDeviceForNotificationsWithProxy
|
||||||
(ApiUtils.getCredentials(userEntity.getUsername(),
|
(finalCredentials, ApiUtils.getUrlPushProxy(), queryMap)
|
||||||
userEntity.getToken()), ApiUtils.getUrlPushProxy(), queryMap)
|
|
||||||
.blockingSubscribe(new Observer<Void>() {
|
.blockingSubscribe(new Observer<Void>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(Disposable d) {
|
||||||
|
@ -32,6 +32,7 @@ import com.nextcloud.talk.models.json.capabilities.CapabilitiesOverall;
|
|||||||
import com.nextcloud.talk.utils.ApiUtils;
|
import com.nextcloud.talk.utils.ApiUtils;
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
|
import com.nextcloud.talk.utils.singletons.ApplicationWideApiHolder;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@ -46,7 +47,6 @@ import androidx.work.Worker;
|
|||||||
import autodagger.AutoInjector;
|
import autodagger.AutoInjector;
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import okhttp3.JavaNetCookieJar;
|
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
|
|
||||||
@ -124,8 +124,7 @@ public class CapabilitiesWorker extends Worker {
|
|||||||
for (Object userEntityObject : userEntityObjectList) {
|
for (Object userEntityObject : userEntityObjectList) {
|
||||||
UserEntity internalUserEntity = (UserEntity) userEntityObject;
|
UserEntity internalUserEntity = (UserEntity) userEntityObject;
|
||||||
|
|
||||||
ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(new
|
ncApi = ApplicationWideApiHolder.getInstance().getNcApiInstanceForAccountId(internalUserEntity.getId(), null);
|
||||||
JavaNetCookieJar(new java.net.CookieManager())).build()).build().create(NcApi.class);
|
|
||||||
|
|
||||||
ncApi.getCapabilities(ApiUtils.getCredentials(internalUserEntity.getUsername(),
|
ncApi.getCapabilities(ApiUtils.getCredentials(internalUserEntity.getUsername(),
|
||||||
internalUserEntity.getToken()), ApiUtils.getUrlForCapabilities(internalUserEntity.getBaseUrl()))
|
internalUserEntity.getToken()), ApiUtils.getUrlForCapabilities(internalUserEntity.getBaseUrl()))
|
||||||
|
@ -60,6 +60,7 @@ import com.nextcloud.talk.utils.PushUtils;
|
|||||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
||||||
|
import com.nextcloud.talk.utils.singletons.ApplicationWideApiHolder;
|
||||||
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder;
|
||||||
import com.nextcloud.talk.utils.singletons.ApplicationWideStateHolder;
|
import com.nextcloud.talk.utils.singletons.ApplicationWideStateHolder;
|
||||||
|
|
||||||
@ -93,7 +94,6 @@ public class NotificationWorker extends Worker {
|
|||||||
@Inject
|
@Inject
|
||||||
AppPreferences appPreferences;
|
AppPreferences appPreferences;
|
||||||
|
|
||||||
@Inject
|
|
||||||
NcApi ncApi;
|
NcApi ncApi;
|
||||||
|
|
||||||
private DecryptedPushMessage decryptedPushMessage;
|
private DecryptedPushMessage decryptedPushMessage;
|
||||||
@ -101,10 +101,11 @@ public class NotificationWorker extends Worker {
|
|||||||
private SignatureVerification signatureVerification;
|
private SignatureVerification signatureVerification;
|
||||||
private String conversationType = "";
|
private String conversationType = "";
|
||||||
|
|
||||||
|
private String credentials;
|
||||||
|
|
||||||
private void showNotificationForCallWithNoPing(Intent intent) {
|
private void showNotificationForCallWithNoPing(Intent intent) {
|
||||||
UserEntity userEntity = signatureVerification.getUserEntity();
|
UserEntity userEntity = signatureVerification.getUserEntity();
|
||||||
ncApi.getRoom(ApiUtils.getCredentials(userEntity.getUserId(),
|
ncApi.getRoom(credentials, ApiUtils.getRoom(userEntity.getBaseUrl(),
|
||||||
userEntity.getToken()), ApiUtils.getRoom(userEntity.getBaseUrl(),
|
|
||||||
intent.getExtras().getString(BundleKeys.KEY_ROOM_TOKEN)))
|
intent.getExtras().getString(BundleKeys.KEY_ROOM_TOKEN)))
|
||||||
.blockingSubscribe(new Observer<RoomOverall>() {
|
.blockingSubscribe(new Observer<RoomOverall>() {
|
||||||
@Override
|
@Override
|
||||||
@ -142,8 +143,7 @@ public class NotificationWorker extends Worker {
|
|||||||
|
|
||||||
private void showMessageNotificationWithObjectData(Intent intent) {
|
private void showMessageNotificationWithObjectData(Intent intent) {
|
||||||
UserEntity userEntity = signatureVerification.getUserEntity();
|
UserEntity userEntity = signatureVerification.getUserEntity();
|
||||||
ncApi.getNotification(ApiUtils.getCredentials(userEntity.getUserId(),
|
ncApi.getNotification(credentials, ApiUtils.getUrlForNotificationWithId(userEntity.getBaseUrl(),
|
||||||
userEntity.getToken()), ApiUtils.getUrlForNotificationWithId(userEntity.getBaseUrl(),
|
|
||||||
Long.toString(decryptedPushMessage.getNotificationId())))
|
Long.toString(decryptedPushMessage.getNotificationId())))
|
||||||
.blockingSubscribe(new Observer<NotificationOverall>() {
|
.blockingSubscribe(new Observer<NotificationOverall>() {
|
||||||
@Override
|
@Override
|
||||||
@ -164,16 +164,16 @@ public class NotificationWorker extends Worker {
|
|||||||
decryptedPushMessage.setText(notification.getMessage());
|
decryptedPushMessage.setText(notification.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMap<String, HashMap<String, String>> subjectRichParametersRichParameters = notification
|
HashMap<String, HashMap<String, String>> subjectRichParameters = notification
|
||||||
.getSubjectRichParameters();
|
.getSubjectRichParameters();
|
||||||
|
|
||||||
if (subjectRichParametersRichParameters != null && subjectRichParametersRichParameters
|
if (subjectRichParameters != null && subjectRichParameters
|
||||||
.size() > 0 && subjectRichParametersRichParameters.containsKey("call")
|
.size() > 0 && subjectRichParameters.containsKey("call")
|
||||||
&& subjectRichParametersRichParameters.containsKey("user")) {
|
&& subjectRichParameters.containsKey("user")) {
|
||||||
HashMap<String, String> callHashMap = subjectRichParametersRichParameters.get("call");
|
HashMap<String, String> callHashMap = subjectRichParameters.get("call");
|
||||||
HashMap<String, String> userHashMap = subjectRichParametersRichParameters.get("user");
|
HashMap<String, String> userHashMap = subjectRichParameters.get("user");
|
||||||
|
|
||||||
if (callHashMap.containsKey("call-type")) {
|
if (callHashMap != null && callHashMap.size() > 0 && callHashMap.containsKey("call-type")) {
|
||||||
conversationType = callHashMap.get("call-type");
|
conversationType = callHashMap.get("call-type");
|
||||||
|
|
||||||
if ("one2one".equals(conversationType)) {
|
if ("one2one".equals(conversationType)) {
|
||||||
@ -374,8 +374,12 @@ public class NotificationWorker extends Worker {
|
|||||||
decryptedPushMessage = LoganSquare.parse(new String(decryptedSubject),
|
decryptedPushMessage = LoganSquare.parse(new String(decryptedSubject),
|
||||||
DecryptedPushMessage.class);
|
DecryptedPushMessage.class);
|
||||||
|
|
||||||
boolean hasChatSupport = signatureVerification.getUserEntity().hasSpreedCapabilityWithName
|
ncApi = ApplicationWideApiHolder.getInstance().getNcApiInstanceForAccountId(signatureVerification.getUserEntity().getId(), null);
|
||||||
("chat-v2");
|
credentials = ApiUtils.getCredentials(signatureVerification.getUserEntity().getUserId(),
|
||||||
|
signatureVerification.getUserEntity().getToken());
|
||||||
|
|
||||||
|
boolean hasChatSupport = signatureVerification.getUserEntity().
|
||||||
|
hasSpreedCapabilityWithName("chat-v2");
|
||||||
|
|
||||||
boolean isInTheSameRoomAsNotification = (ApplicationWideCurrentRoomHolder.getInstance().
|
boolean isInTheSameRoomAsNotification = (ApplicationWideCurrentRoomHolder.getInstance().
|
||||||
getCurrentRoomId().equals(decryptedPushMessage.getId()) ||
|
getCurrentRoomId().equals(decryptedPushMessage.getId()) ||
|
||||||
|
@ -79,7 +79,8 @@ public interface User extends Parcelable, Persistable, Serializable {
|
|||||||
if (getCapabilities() != null) {
|
if (getCapabilities() != null) {
|
||||||
try {
|
try {
|
||||||
Capabilities capabilities = LoganSquare.parse(getCapabilities(), Capabilities.class);
|
Capabilities capabilities = LoganSquare.parse(getCapabilities(), Capabilities.class);
|
||||||
if (capabilities.getSpreedCapability() != null && capabilities.getSpreedCapability().getFeatures() != null) {
|
if (capabilities != null && capabilities.getSpreedCapability() != null &&
|
||||||
|
capabilities.getSpreedCapability().getFeatures() != null) {
|
||||||
return capabilities.getSpreedCapability().getFeatures().contains(capabilityName);
|
return capabilities.getSpreedCapability().getFeatures().contains(capabilityName);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -36,6 +36,7 @@ import com.nextcloud.talk.models.json.push.PushConfigurationState;
|
|||||||
import com.nextcloud.talk.models.json.push.PushRegistrationOverall;
|
import com.nextcloud.talk.models.json.push.PushRegistrationOverall;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
||||||
|
import com.nextcloud.talk.utils.singletons.ApplicationWideApiHolder;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@ -44,7 +45,6 @@ import java.io.FileInputStream;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.CookieManager;
|
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.Key;
|
import java.security.Key;
|
||||||
import java.security.KeyFactory;
|
import java.security.KeyFactory;
|
||||||
@ -68,9 +68,6 @@ import autodagger.AutoInjector;
|
|||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import okhttp3.JavaNetCookieJar;
|
|
||||||
import okhttp3.OkHttpClient;
|
|
||||||
import retrofit2.Retrofit;
|
|
||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
public class PushUtils {
|
public class PushUtils {
|
||||||
@ -85,12 +82,6 @@ public class PushUtils {
|
|||||||
@Inject
|
@Inject
|
||||||
EventBus eventBus;
|
EventBus eventBus;
|
||||||
|
|
||||||
@Inject
|
|
||||||
OkHttpClient okHttpClient;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
Retrofit retrofit;
|
|
||||||
|
|
||||||
NcApi ncApi;
|
NcApi ncApi;
|
||||||
|
|
||||||
private File keysFile;
|
private File keysFile;
|
||||||
@ -231,6 +222,7 @@ public class PushUtils {
|
|||||||
String token = appPreferences.getPushToken();
|
String token = appPreferences.getPushToken();
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(token)) {
|
if (!TextUtils.isEmpty(token)) {
|
||||||
|
String credentials;
|
||||||
String pushTokenHash = generateSHA512Hash(token).toLowerCase();
|
String pushTokenHash = generateSHA512Hash(token).toLowerCase();
|
||||||
PublicKey devicePublicKey = (PublicKey) readKeyFromFile(true);
|
PublicKey devicePublicKey = (PublicKey) readKeyFromFile(true);
|
||||||
if (devicePublicKey != null) {
|
if (devicePublicKey != null) {
|
||||||
@ -268,11 +260,12 @@ public class PushUtils {
|
|||||||
queryMap.put("devicePublicKey", publicKey);
|
queryMap.put("devicePublicKey", publicKey);
|
||||||
queryMap.put("proxyServer", proxyServer);
|
queryMap.put("proxyServer", proxyServer);
|
||||||
|
|
||||||
ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(new
|
ncApi = ApplicationWideApiHolder.getInstance().getNcApiInstanceForAccountId(userEntity.getId(), null);
|
||||||
JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class);
|
credentials = ApiUtils.getCredentials(userEntity.getUserId(), userEntity.getToken());
|
||||||
|
|
||||||
|
String finalCredentials = credentials;
|
||||||
ncApi.registerDeviceForNotificationsWithNextcloud(
|
ncApi.registerDeviceForNotificationsWithNextcloud(
|
||||||
ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()),
|
credentials,
|
||||||
ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()), queryMap)
|
ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()), queryMap)
|
||||||
.subscribeOn(Schedulers.newThread())
|
.subscribeOn(Schedulers.newThread())
|
||||||
.subscribe(new Observer<PushRegistrationOverall>() {
|
.subscribe(new Observer<PushRegistrationOverall>() {
|
||||||
@ -293,8 +286,7 @@ public class PushUtils {
|
|||||||
.getData().getPublicKey());
|
.getData().getPublicKey());
|
||||||
|
|
||||||
|
|
||||||
ncApi.registerDeviceForNotificationsWithProxy(ApiUtils.getCredentials
|
ncApi.registerDeviceForNotificationsWithProxy(finalCredentials,
|
||||||
(userEntity.getUsername(), userEntity.getToken()),
|
|
||||||
ApiUtils.getUrlPushProxy(), proxyMap)
|
ApiUtils.getUrlPushProxy(), proxyMap)
|
||||||
.subscribeOn(Schedulers.newThread())
|
.subscribeOn(Schedulers.newThread())
|
||||||
.subscribe(new Observer<Void>() {
|
.subscribe(new Observer<Void>() {
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.utils.singletons;
|
package com.nextcloud.talk.utils.singletons;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
@ -29,6 +30,7 @@ import com.nextcloud.talk.models.database.UserEntity;
|
|||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -39,7 +41,8 @@ import retrofit2.Retrofit;
|
|||||||
public class ApiHolder {
|
public class ApiHolder {
|
||||||
private static final String TAG = "ApiHolder";
|
private static final String TAG = "ApiHolder";
|
||||||
|
|
||||||
private HashMap<Long, NcApi> ncApiHashMap;
|
@SuppressLint("UseSparseArrays")
|
||||||
|
private Map<Long, NcApi> ncApiHashMap;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
UserUtils userUtils;
|
UserUtils userUtils;
|
||||||
@ -53,15 +56,21 @@ public class ApiHolder {
|
|||||||
return holder;
|
return holder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("UseSparseArrays")
|
||||||
public NcApi getNcApiInstanceForAccountId(long accountId, @Nullable String baseUrl) {
|
public NcApi getNcApiInstanceForAccountId(long accountId, @Nullable String baseUrl) {
|
||||||
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
||||||
|
|
||||||
|
if (ncApiHashMap == null) {
|
||||||
|
ncApiHashMap = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
if (!ncApiHashMap.containsKey(accountId)) {
|
if (!ncApiHashMap.containsKey(accountId)) {
|
||||||
UserEntity userAccount = userUtils.getUserWithId(accountId);
|
UserEntity userAccount = userUtils.getUserWithId(accountId);
|
||||||
if (userAccount == null || !TextUtils.isEmpty(baseUrl)) {
|
if (userAccount == null || !TextUtils.isEmpty(baseUrl)) {
|
||||||
retrofit = retrofit.newBuilder().baseUrl(baseUrl).build();
|
retrofit = retrofit.newBuilder().baseUrl(baseUrl).build();
|
||||||
return retrofit.create(NcApi.class);
|
return retrofit.create(NcApi.class);
|
||||||
} else {
|
} else {
|
||||||
retrofit = retrofit.newBuilder().baseUrl(userAccount.getBaseUrl()).build();
|
retrofit = retrofit.newBuilder().baseUrl(userAccount.getBaseUrl() + "/").build();
|
||||||
ncApiHashMap.put(accountId, retrofit.create(NcApi.class));
|
ncApiHashMap.put(accountId, retrofit.create(NcApi.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user