From 2dc738e2f226a7ba70c2b1f714852ac9d03eefc8 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Mon, 29 Jan 2018 02:31:22 +0100 Subject: [PATCH] Cleanups Signed-off-by: Mario Danic --- .../talk/activities/CallActivity.java | 112 +++++------------- .../talk/adapters/items/AdvancedUserItem.java | 8 +- .../talk/adapters/items/CallItem.java | 8 +- .../talk/adapters/items/UserItem.java | 8 +- .../java/com/nextcloud/talk/api/NcApi.java | 24 ++-- .../AccountVerificationController.java | 12 +- .../talk/controllers/CallsListController.java | 10 +- .../talk/controllers/ContactsController.java | 16 +-- .../ServerSelectionController.java | 4 +- .../talk/controllers/SettingsController.java | 10 +- .../controllers/SwitchAccountController.java | 2 +- .../bottomsheet/CallMenuController.java | 2 +- .../bottomsheet/EntryMenuController.java | 2 +- .../bottomsheet/OperationsMenuController.java | 22 ++-- .../talk/dagger/modules/RestModule.java | 4 +- .../talk/events/MoreMenuClickEvent.java | 2 +- .../events/SessionDescriptionSendEvent.java | 2 +- .../talk/jobs/AccountRemovalJob.java | 14 +-- .../nextcloud/talk/models/database/User.java | 52 ++++++++ .../talk/{api => }/models/json/call/Call.java | 2 +- .../{api => }/models/json/call/CallOCS.java | 4 +- .../models/json/call/CallOverall.java | 2 +- .../EnumParticipantTypeConverter.java | 4 +- .../converters/EnumRoomTypeConverter.java | 4 +- .../models/json/generic/GenericMeta.java | 2 +- .../models/json/generic/GenericOCS.java | 2 +- .../models/json/generic/GenericOverall.java | 2 +- .../{api => }/models/json/generic/Status.java | 2 +- .../json/participants/AddParticipantOCS.java | 6 +- .../participants/AddParticipantOverall.java | 4 +- .../models/json/participants/Participant.java | 2 +- .../json/participants/ParticipantsOCS.java | 4 +- .../participants/ParticipantsOverall.java | 2 +- .../json/push/DecryptedPushMessage.java | 2 +- .../json/push/PushConfigurationState.java | 2 +- .../models/json/push/PushMessage.java | 2 +- .../models/json/push/PushRegistration.java | 2 +- .../models/json/push/PushRegistrationOCS.java | 4 +- .../json/push/PushRegistrationOverall.java | 2 +- .../{api => }/models/json/rooms/Room.java | 8 +- .../{api => }/models/json/rooms/RoomOCS.java | 4 +- .../models/json/rooms/RoomOverall.java | 2 +- .../{api => }/models/json/rooms/RoomsOCS.java | 4 +- .../models/json/rooms/RoomsOverall.java | 2 +- .../models/json/sharees/ExactSharees.java | 2 +- .../{api => }/models/json/sharees/Sharee.java | 2 +- .../models/json/sharees/ShareesOCS.java | 4 +- .../models/json/sharees/ShareesOverall.java | 2 +- .../models/json/sharees/SharesData.java | 2 +- .../{api => }/models/json/sharees/Value.java | 2 +- .../json/signaling/DataChannelMessage.java | 2 +- .../models/json/signaling/NCIceCandidate.java | 2 +- .../json/signaling/NCMessagePayload.java | 2 +- .../json/signaling/NCMessageWrapper.java | 2 +- .../json/signaling/NCSignalingMessage.java | 2 +- .../models/json/signaling/Signaling.java | 2 +- .../models/json/signaling/SignalingOCS.java | 4 +- .../json/signaling/SignalingOverall.java | 2 +- .../json/signaling/settings/IceServer.java | 2 +- .../json/signaling/settings/Settings.java | 2 +- .../settings/SignalingSettingsOcs.java | 4 +- .../settings/SignalingSettingsOverall.java | 2 +- .../json/userprofile/UserProfileData.java | 2 +- .../json/userprofile/UserProfileOCS.java | 4 +- .../json/userprofile/UserProfileOverall.java | 2 +- .../talk/persistence/entities/User.java | 53 --------- .../MagicFirebaseMessagingService.java | 4 +- .../ApiHelper.java => utils/ApiUtils.java} | 6 +- .../com/nextcloud/talk/utils/PushUtils.java | 11 +- .../com/nextcloud/talk/utils/ShareUtils.java | 2 +- .../talk/utils/database/user/UserUtils.java | 2 +- .../webrtc/MagicPeerConnectionWrapper.java | 4 +- 72 files changed, 236 insertions(+), 286 deletions(-) create mode 100644 app/src/main/java/com/nextcloud/talk/models/database/User.java rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/call/Call.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/call/CallOCS.java (90%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/call/CallOverall.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/converters/EnumParticipantTypeConverter.java (94%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/converters/EnumRoomTypeConverter.java (94%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/generic/GenericMeta.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/generic/GenericOCS.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/generic/GenericOverall.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/generic/Status.java (96%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/participants/AddParticipantOCS.java (86%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/participants/AddParticipantOverall.java (89%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/participants/Participant.java (96%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/participants/ParticipantsOCS.java (89%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/participants/ParticipantsOverall.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/push/DecryptedPushMessage.java (96%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/push/PushConfigurationState.java (96%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/push/PushMessage.java (94%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/push/PushRegistration.java (96%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/push/PushRegistrationOCS.java (90%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/push/PushRegistrationOverall.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/rooms/Room.java (90%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/rooms/RoomOCS.java (90%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/rooms/RoomOverall.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/rooms/RoomsOCS.java (90%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/rooms/RoomsOverall.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/sharees/ExactSharees.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/sharees/Sharee.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/sharees/ShareesOCS.java (90%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/sharees/ShareesOverall.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/sharees/SharesData.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/sharees/Value.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/DataChannelMessage.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/NCIceCandidate.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/NCMessagePayload.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/NCMessageWrapper.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/NCSignalingMessage.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/Signaling.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/SignalingOCS.java (90%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/SignalingOverall.java (94%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/settings/IceServer.java (94%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/settings/Settings.java (94%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/settings/SignalingSettingsOcs.java (89%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/signaling/settings/SignalingSettingsOverall.java (94%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/userprofile/UserProfileData.java (95%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/userprofile/UserProfileOCS.java (90%) rename app/src/main/java/com/nextcloud/talk/{api => }/models/json/userprofile/UserProfileOverall.java (95%) delete mode 100644 app/src/main/java/com/nextcloud/talk/persistence/entities/User.java rename app/src/main/java/com/nextcloud/talk/{api/helpers/api/ApiHelper.java => utils/ApiUtils.java} (97%) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 8c5a9e243..fd0a8de14 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -28,10 +28,6 @@ import android.Manifest; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.SuppressLint; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; import android.content.res.Configuration; import android.os.Bundle; import android.os.Handler; @@ -51,29 +47,27 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.bluelinelabs.logansquare.LoganSquare; -import com.evernote.android.job.JobRequest; -import com.evernote.android.job.util.Device; import com.nextcloud.talk.R; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; -import com.nextcloud.talk.api.models.json.call.CallOverall; -import com.nextcloud.talk.api.models.json.generic.GenericOverall; -import com.nextcloud.talk.api.models.json.rooms.Room; -import com.nextcloud.talk.api.models.json.rooms.RoomsOverall; -import com.nextcloud.talk.api.models.json.signaling.DataChannelMessage; -import com.nextcloud.talk.api.models.json.signaling.NCIceCandidate; -import com.nextcloud.talk.api.models.json.signaling.NCMessagePayload; -import com.nextcloud.talk.api.models.json.signaling.NCMessageWrapper; -import com.nextcloud.talk.api.models.json.signaling.NCSignalingMessage; -import com.nextcloud.talk.api.models.json.signaling.Signaling; -import com.nextcloud.talk.api.models.json.signaling.SignalingOverall; -import com.nextcloud.talk.api.models.json.signaling.settings.IceServer; -import com.nextcloud.talk.api.models.json.signaling.settings.SignalingSettingsOverall; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.events.MediaStreamEvent; import com.nextcloud.talk.events.PeerConnectionEvent; import com.nextcloud.talk.events.SessionDescriptionSendEvent; +import com.nextcloud.talk.models.json.call.CallOverall; +import com.nextcloud.talk.models.json.generic.GenericOverall; +import com.nextcloud.talk.models.json.rooms.Room; +import com.nextcloud.talk.models.json.rooms.RoomsOverall; +import com.nextcloud.talk.models.json.signaling.DataChannelMessage; +import com.nextcloud.talk.models.json.signaling.NCIceCandidate; +import com.nextcloud.talk.models.json.signaling.NCMessagePayload; +import com.nextcloud.talk.models.json.signaling.NCMessageWrapper; +import com.nextcloud.talk.models.json.signaling.NCSignalingMessage; +import com.nextcloud.talk.models.json.signaling.Signaling; +import com.nextcloud.talk.models.json.signaling.SignalingOverall; +import com.nextcloud.talk.models.json.signaling.settings.IceServer; +import com.nextcloud.talk.models.json.signaling.settings.SignalingSettingsOverall; import com.nextcloud.talk.persistence.entities.UserEntity; +import com.nextcloud.talk.utils.ApiUtils; import com.nextcloud.talk.utils.animations.PulseAnimation; import com.nextcloud.talk.utils.bundle.BundleKeys; import com.nextcloud.talk.utils.database.user.UserUtils; @@ -201,8 +195,6 @@ public class CallActivity extends AppCompatActivity { private boolean videoOn = false; private boolean audioOn = false; - private BroadcastReceiver networkBroadcastReceier; - private Handler handler = new Handler(); private boolean isPTTActive = false; @@ -242,20 +234,7 @@ public class CallActivity extends AppCompatActivity { roomToken = getIntent().getExtras().getString(BundleKeys.KEY_ROOM_TOKEN, ""); userEntity = Parcels.unwrap(getIntent().getExtras().getParcelable(BundleKeys.KEY_USER_ENTITY)); callSession = getIntent().getExtras().getString(BundleKeys.KEY_CALL_SESSION, "0"); - credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()); - - networkBroadcastReceier = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - if ("android.net.conn.CONNECTIVITY_CHANGE".equals(intent.getAction())) { - if (!Device.getNetworkType(context).equals(JobRequest.NetworkType.ANY)) { - startPullingSignalingMessages(true); - } else { - //hangup(true); - } - } - } - }; + credentials = ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()); callControls.setZ(100.0f); basicInitialization(); @@ -301,16 +280,8 @@ public class CallActivity extends AppCompatActivity { } } - private void performIceRestart() { - for (int i = 0; i < magicPeerConnectionWrapperList.size(); i++) { - sdpConstraints.optional.add(new MediaConstraints.KeyValuePair("IceRestart", "true")); - PeerConnection.RTCConfiguration rtcConfiguration = new PeerConnection.RTCConfiguration(iceServers); - magicPeerConnectionWrapperList.get(i).getPeerConnection().setConfiguration(rtcConfiguration); - } - } - private void handleFromNotification() { - ncApi.getRooms(credentials, ApiHelper.getUrlForGetRooms(userEntity.getBaseUrl())) + ncApi.getRooms(credentials, ApiUtils.getUrlForGetRooms(userEntity.getBaseUrl())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer() { @@ -690,8 +661,7 @@ public class CallActivity extends AppCompatActivity { if (!isPTTActive) { animateCallControls(false, 7500); } - startPullingSignalingMessages(false); - //registerNetworkReceiver(); + startPullingSignalingMessages(); } @OnClick({R.id.pip_video_view, R.id.remote_renderers_layout}) @@ -699,17 +669,11 @@ public class CallActivity extends AppCompatActivity { animateCallControls(true, 0); } - public void startPullingSignalingMessages(boolean restart) { - - if (restart) { - dispose(null); - //hangupNetworkCalls(); - } - + public void startPullingSignalingMessages() { leavingCall = false; - ncApi.getSignalingSettings(ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()), - ApiHelper.getUrlForSignalingSettings(userEntity.getBaseUrl())) + ncApi.getSignalingSettings(ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()), + ApiUtils.getUrlForSignalingSettings(userEntity.getBaseUrl())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer() { @@ -747,11 +711,7 @@ public class CallActivity extends AppCompatActivity { } } - if (restart) { - performIceRestart(); - } else { - joinRoomAndCall(); - } + joinRoomAndCall(); } @Override @@ -773,7 +733,7 @@ public class CallActivity extends AppCompatActivity { private void joinRoomAndCall() { if (callSession.equals("0")) { - ncApi.joinRoom(credentials, ApiHelper.getUrlForRoomParticipants(userEntity.getBaseUrl(), roomToken), null) + ncApi.joinRoom(credentials, ApiUtils.getUrlForRoomParticipants(userEntity.getBaseUrl(), roomToken), null) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .retry(3) @@ -805,7 +765,7 @@ public class CallActivity extends AppCompatActivity { private void performCall(@Nullable String callSessionId) { ncApi.joinCall(credentials, - ApiHelper.getUrlForCall(userEntity.getBaseUrl(), roomToken)) + ApiUtils.getUrlForCall(userEntity.getBaseUrl(), roomToken)) .subscribeOn(Schedulers.newThread()) .retry(3) .observeOn(AndroidSchedulers.mainThread()) @@ -823,8 +783,8 @@ public class CallActivity extends AppCompatActivity { } // start pinging the call - ncApi.pingCall(ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()), - ApiHelper.getUrlForCallPing(userEntity.getBaseUrl(), roomToken)) + ncApi.pingCall(ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()), + ApiUtils.getUrlForCallPing(userEntity.getBaseUrl(), roomToken)) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .repeatWhen(observable -> observable.delay(5000, TimeUnit.MILLISECONDS)) @@ -853,8 +813,8 @@ public class CallActivity extends AppCompatActivity { }); // Start pulling signaling messages - ncApi.pullSignalingMessages(ApiHelper.getCredentials(userEntity.getUsername(), - userEntity.getToken()), ApiHelper.getUrlForSignaling(userEntity.getBaseUrl())) + ncApi.pullSignalingMessages(ApiUtils.getCredentials(userEntity.getUsername(), + userEntity.getToken()), ApiUtils.getUrlForSignaling(userEntity.getBaseUrl())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .repeatWhen(observable -> observable) @@ -1090,8 +1050,8 @@ public class CallActivity extends AppCompatActivity { } private void hangupNetworkCalls() { - String credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()); - ncApi.leaveCall(credentials, ApiHelper.getUrlForCall(userEntity.getBaseUrl(), roomToken)) + String credentials = ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()); + ncApi.leaveCall(credentials, ApiUtils.getUrlForCall(userEntity.getBaseUrl(), roomToken)) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer() { @@ -1102,7 +1062,7 @@ public class CallActivity extends AppCompatActivity { @Override public void onNext(GenericOverall genericOverall) { - ncApi.leaveRoom(credentials, ApiHelper.getUrlForRoomParticipants(userEntity.getBaseUrl(), roomToken)) + ncApi.leaveRoom(credentials, ApiUtils.getUrlForRoomParticipants(userEntity.getBaseUrl(), roomToken)) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer() { @@ -1309,7 +1269,7 @@ public class CallActivity extends AppCompatActivity { @Subscribe(threadMode = ThreadMode.BACKGROUND) public void onMessageEvent(SessionDescriptionSendEvent sessionDescriptionSend) throws IOException { - String credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()); + String credentials = ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()); NCMessageWrapper ncMessageWrapper = new NCMessageWrapper(); ncMessageWrapper.setEv("message"); ncMessageWrapper.setSessionId(callSession); @@ -1349,7 +1309,7 @@ public class CallActivity extends AppCompatActivity { String stringToSend = stringBuilder.toString(); strings.add(stringToSend); - ncApi.sendSignalingMessages(credentials, ApiHelper.getUrlForSignaling(userEntity.getBaseUrl()), + ncApi.sendSignalingMessages(credentials, ApiUtils.getUrlForSignaling(userEntity.getBaseUrl()), strings.toString()) .retry(3) .subscribeOn(Schedulers.newThread()) @@ -1405,14 +1365,6 @@ public class CallActivity extends AppCompatActivity { this); } - private void registerNetworkReceiver() { - IntentFilter intentFilter = new IntentFilter(); - intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANxGE"); - intentFilter.addAction("android.net.wifi.STATE_CHANGE"); - - this.registerReceiver(networkBroadcastReceier, intentFilter); - } - private void animateCallControls(boolean show, long startDelay) { if (!isPTTActive) { float alpha; diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java b/app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java index cb5ea9e29..99391ec14 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java @@ -35,8 +35,8 @@ import com.bumptech.glide.load.model.LazyHeaders; import com.bumptech.glide.load.resource.bitmap.CircleCrop; import com.bumptech.glide.request.RequestOptions; import com.nextcloud.talk.R; -import com.nextcloud.talk.api.helpers.api.ApiHelper; -import com.nextcloud.talk.api.models.json.participants.Participant; +import com.nextcloud.talk.utils.ApiUtils; +import com.nextcloud.talk.models.json.participants.Participant; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.persistence.entities.UserEntity; import com.nextcloud.talk.utils.glide.GlideApp; @@ -123,10 +123,10 @@ public class AdvancedUserItem extends AbstractFlexibleItem holder.avatarImageView.setVisibility(View.VISIBLE); if (!TextUtils.isEmpty(room.getName())) { - GlideUrl glideUrl = new GlideUrl(ApiHelper.getUrlForAvatarWithName(userEntity.getBaseUrl(), + GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(), room.getName(), false), new LazyHeaders.Builder() .setHeader("Accept", "image/*") - .setHeader("User-Agent", ApiHelper.getUserAgent()) + .setHeader("User-Agent", ApiUtils.getUserAgent()) .build()); GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java b/app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java index b705cef1b..19ef859da 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java @@ -30,8 +30,8 @@ import com.bumptech.glide.load.model.LazyHeaders; import com.bumptech.glide.load.resource.bitmap.CircleCrop; import com.bumptech.glide.request.RequestOptions; import com.nextcloud.talk.R; -import com.nextcloud.talk.api.helpers.api.ApiHelper; -import com.nextcloud.talk.api.models.json.participants.Participant; +import com.nextcloud.talk.utils.ApiUtils; +import com.nextcloud.talk.models.json.participants.Participant; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.persistence.entities.UserEntity; import com.nextcloud.talk.utils.glide.GlideApp; @@ -102,10 +102,10 @@ public class UserItem extends AbstractFlexibleItem holder.contactDisplayName.setText(participant.getName()); } - GlideUrl glideUrl = new GlideUrl(ApiHelper.getUrlForAvatarWithName(userEntity.getBaseUrl(), + GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(), participant.getUserId(), false), new LazyHeaders.Builder() .setHeader("Accept", "image/*") - .setHeader("User-Agent", ApiHelper.getUserAgent()) + .setHeader("User-Agent", ApiUtils.getUserAgent()) .build()); GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()) diff --git a/app/src/main/java/com/nextcloud/talk/api/NcApi.java b/app/src/main/java/com/nextcloud/talk/api/NcApi.java index 532754c42..951244d00 100644 --- a/app/src/main/java/com/nextcloud/talk/api/NcApi.java +++ b/app/src/main/java/com/nextcloud/talk/api/NcApi.java @@ -22,18 +22,18 @@ package com.nextcloud.talk.api; import android.support.annotation.Nullable; -import com.nextcloud.talk.api.models.json.call.CallOverall; -import com.nextcloud.talk.api.models.json.generic.GenericOverall; -import com.nextcloud.talk.api.models.json.generic.Status; -import com.nextcloud.talk.api.models.json.participants.AddParticipantOverall; -import com.nextcloud.talk.api.models.json.participants.ParticipantsOverall; -import com.nextcloud.talk.api.models.json.push.PushRegistrationOverall; -import com.nextcloud.talk.api.models.json.rooms.RoomOverall; -import com.nextcloud.talk.api.models.json.rooms.RoomsOverall; -import com.nextcloud.talk.api.models.json.sharees.ShareesOverall; -import com.nextcloud.talk.api.models.json.signaling.SignalingOverall; -import com.nextcloud.talk.api.models.json.signaling.settings.SignalingSettingsOverall; -import com.nextcloud.talk.api.models.json.userprofile.UserProfileOverall; +import com.nextcloud.talk.models.json.call.CallOverall; +import com.nextcloud.talk.models.json.generic.GenericOverall; +import com.nextcloud.talk.models.json.generic.Status; +import com.nextcloud.talk.models.json.participants.AddParticipantOverall; +import com.nextcloud.talk.models.json.participants.ParticipantsOverall; +import com.nextcloud.talk.models.json.push.PushRegistrationOverall; +import com.nextcloud.talk.models.json.rooms.RoomOverall; +import com.nextcloud.talk.models.json.rooms.RoomsOverall; +import com.nextcloud.talk.models.json.sharees.ShareesOverall; +import com.nextcloud.talk.models.json.signaling.SignalingOverall; +import com.nextcloud.talk.models.json.signaling.settings.SignalingSettingsOverall; +import com.nextcloud.talk.models.json.userprofile.UserProfileOverall; import java.util.Map; diff --git a/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java b/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java index 0dc1ba849..c6d4fc206 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java @@ -36,7 +36,7 @@ import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler; import com.evernote.android.job.JobRequest; import com.nextcloud.talk.R; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; +import com.nextcloud.talk.utils.ApiUtils; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.jobs.PushRegistrationJob; @@ -136,9 +136,9 @@ public class AccountVerificationController extends BaseController { baseUrl = baseUrl.replace("http://", "").replace("https://", ""); if (checkForcedHttps) { - queryUrl = "https://" + baseUrl + ApiHelper.getUrlPostfixForStatus(); + queryUrl = "https://" + baseUrl + ApiUtils.getUrlPostfixForStatus(); } else { - queryUrl = "http://" + baseUrl + ApiHelper.getUrlPostfixForStatus(); + queryUrl = "http://" + baseUrl + ApiUtils.getUrlPostfixForStatus(); } statusQueryDisposable = ncApi.getServerStatus(queryUrl) @@ -164,10 +164,10 @@ public class AccountVerificationController extends BaseController { } private void checkEverything() { - String credentials = ApiHelper.getCredentials(username, token); + String credentials = ApiUtils.getCredentials(username, token); cookieManager.getCookieStore().removeAll(); - roomsQueryDisposable = ncApi.getRooms(credentials, ApiHelper.getUrlForGetRooms(baseUrl)) + roomsQueryDisposable = ncApi.getRooms(credentials, ApiUtils.getUrlForGetRooms(baseUrl)) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(roomsOverall -> { @@ -175,7 +175,7 @@ public class AccountVerificationController extends BaseController { R.string.nc_nextcloud_talk_app_installed), getResources().getString(R.string.nc_app_name))); profileQueryDisposable = ncApi.getUserProfile(credentials, - ApiHelper.getUrlForUserProfile(baseUrl)) + ApiUtils.getUrlForUserProfile(baseUrl)) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(userProfileOverall -> { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java index a6cb4ea5b..10cef221c 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java @@ -55,9 +55,9 @@ import com.nextcloud.talk.R; import com.nextcloud.talk.activities.CallActivity; import com.nextcloud.talk.adapters.items.CallItem; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; -import com.nextcloud.talk.api.models.json.participants.Participant; -import com.nextcloud.talk.api.models.json.rooms.Room; +import com.nextcloud.talk.utils.ApiUtils; +import com.nextcloud.talk.models.json.participants.Participant; +import com.nextcloud.talk.models.json.rooms.Room; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.controllers.bottomsheet.CallMenuController; @@ -245,8 +245,8 @@ public class CallsListController extends BaseController implements SearchView.On callItems = new ArrayList<>(); - roomsQueryDisposable = ncApi.getRooms(ApiHelper.getCredentials(userEntity.getUsername(), - userEntity.getToken()), ApiHelper.getUrlForGetRooms(userEntity.getBaseUrl())) + roomsQueryDisposable = ncApi.getRooms(ApiUtils.getCredentials(userEntity.getUsername(), + userEntity.getToken()), ApiUtils.getUrlForGetRooms(userEntity.getBaseUrl())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(roomsOverall -> { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java index f6b8845ea..65e616b12 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java @@ -54,10 +54,10 @@ import com.nextcloud.talk.R; import com.nextcloud.talk.activities.CallActivity; import com.nextcloud.talk.adapters.items.UserItem; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; -import com.nextcloud.talk.api.models.json.participants.Participant; -import com.nextcloud.talk.api.models.json.rooms.RoomOverall; -import com.nextcloud.talk.api.models.json.sharees.Sharee; +import com.nextcloud.talk.utils.ApiUtils; +import com.nextcloud.talk.models.json.participants.Participant; +import com.nextcloud.talk.models.json.rooms.RoomOverall; +import com.nextcloud.talk.models.json.sharees.Sharee; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.models.RetrofitBucket; @@ -226,10 +226,10 @@ public class ContactsController extends BaseController implements SearchView.OnQ contactItems = new ArrayList<>(); - RetrofitBucket retrofitBucket = ApiHelper.getRetrofitBucketForContactsSearch(userEntity.getBaseUrl(), + RetrofitBucket retrofitBucket = ApiUtils.getRetrofitBucketForContactsSearch(userEntity.getBaseUrl(), ""); contactsQueryDisposable = ncApi.getContactsWithSearchParam( - ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()), + ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()), retrofitBucket.getUrl(), retrofitBucket.getQueryMap()) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) @@ -439,9 +439,9 @@ public class ContactsController extends BaseController implements SearchView.OnQ @Override public boolean onItemClick(int position) { UserItem userItem = adapter.getItem(position); - RetrofitBucket retrofitBucket = ApiHelper.getRetrofitBucketForCreateRoom(userEntity.getBaseUrl(), "1", + RetrofitBucket retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(userEntity.getBaseUrl(), "1", userItem.getModel().getUserId()); - ncApi.createRoom(ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()), + ncApi.createRoom(ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()), retrofitBucket.getUrl(), retrofitBucket.getQueryMap()) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java b/app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java index 69f044f40..e5a058b5e 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java @@ -39,7 +39,7 @@ import com.bluelinelabs.conductor.RouterTransaction; import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler; import com.nextcloud.talk.R; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; +import com.nextcloud.talk.utils.ApiUtils; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.utils.AccountUtils; @@ -212,7 +212,7 @@ public class ServerSelectionController extends BaseController { url = url.substring(0, url.length() - 1); } - String queryUrl = url + ApiHelper.getUrlPostfixForStatus(); + String queryUrl = url + ApiUtils.getUrlPostfixForStatus(); if (url.startsWith("http://") || url.startsWith("https://")) { checkServer(queryUrl, false); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java index 15aa0a8d5..26bccfe8e 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java @@ -43,7 +43,7 @@ import com.evernote.android.job.JobRequest; import com.nextcloud.talk.BuildConfig; import com.nextcloud.talk.R; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; +import com.nextcloud.talk.utils.ApiUtils; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.jobs.AccountRemovalJob; @@ -273,9 +273,9 @@ public class SettingsController extends BaseController { loadAvatarImage(); - profileQueryDisposable = ncApi.getUserProfile(ApiHelper.getCredentials(userEntity.getUsername(), + profileQueryDisposable = ncApi.getUserProfile(ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()), - ApiHelper.getUrlForUserProfile(userEntity.getBaseUrl())) + ApiUtils.getUrlForUserProfile(userEntity.getBaseUrl())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(userProfileOverall -> { @@ -418,10 +418,10 @@ public class SettingsController extends BaseController { avatarId = userEntity.getUsername(); } - GlideUrl glideUrl = new GlideUrl(ApiHelper.getUrlForAvatarWithName(userEntity.getBaseUrl(), + GlideUrl glideUrl = new GlideUrl(ApiUtils.getUrlForAvatarWithName(userEntity.getBaseUrl(), avatarId, true), new LazyHeaders.Builder() .setHeader("Accept", "image/*") - .setHeader("User-Agent", ApiHelper.getUserAgent()) + .setHeader("User-Agent", ApiUtils.getUserAgent()) .build()); GlideApp.with(NextcloudTalkApplication.getSharedApplication().getApplicationContext()) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java b/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java index c7ba413e4..e8e60b6ba 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java @@ -38,7 +38,7 @@ import com.bluelinelabs.conductor.RouterTransaction; import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler; import com.nextcloud.talk.R; import com.nextcloud.talk.adapters.items.AdvancedUserItem; -import com.nextcloud.talk.api.models.json.participants.Participant; +import com.nextcloud.talk.models.json.participants.Participant; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.models.ImportAccount; diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java index b4a9edc37..e99ac1c8c 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java @@ -36,7 +36,7 @@ import com.kennyc.bottomsheet.adapters.AppAdapter; import com.nextcloud.talk.R; import com.nextcloud.talk.adapters.items.AppItem; import com.nextcloud.talk.adapters.items.MenuItem; -import com.nextcloud.talk.api.models.json.rooms.Room; +import com.nextcloud.talk.models.json.rooms.Room; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.events.BottomSheetLockEvent; diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java index 44126ee48..0b7e585c6 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java @@ -35,7 +35,7 @@ import android.widget.Button; import com.bluelinelabs.conductor.RouterTransaction; import com.nextcloud.talk.R; -import com.nextcloud.talk.api.models.json.rooms.Room; +import com.nextcloud.talk.models.json.rooms.Room; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.events.BottomSheetLockEvent; diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java index 4c164dfee..5a55df4b9 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java @@ -35,9 +35,9 @@ import com.bluelinelabs.conductor.internal.NoOpControllerChangeHandler; import com.nextcloud.talk.R; import com.nextcloud.talk.activities.CallActivity; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; -import com.nextcloud.talk.api.models.json.call.CallOverall; -import com.nextcloud.talk.api.models.json.rooms.Room; +import com.nextcloud.talk.utils.ApiUtils; +import com.nextcloud.talk.models.json.call.CallOverall; +import com.nextcloud.talk.models.json.rooms.Room; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.events.BottomSheetLockEvent; @@ -124,10 +124,10 @@ public class OperationsMenuController extends BaseController { UserEntity userEntity = userUtils.getCurrentUser(); OperationsObserver operationsObserver = new OperationsObserver(); if (userEntity != null) { - String credentials = ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()); + String credentials = ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()); switch (operationCode) { case 1: - ncApi.removeSelfFromRoom(credentials, ApiHelper.getUrlForRemoveSelfFromRoom(userEntity.getBaseUrl + ncApi.removeSelfFromRoom(credentials, ApiUtils.getUrlForRemoveSelfFromRoom(userEntity.getBaseUrl (), room.getToken())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) @@ -135,7 +135,7 @@ public class OperationsMenuController extends BaseController { .subscribe(operationsObserver); break; case 2: - ncApi.renameRoom(credentials, ApiHelper.getRoom(userEntity.getBaseUrl(), room.getToken()), + ncApi.renameRoom(credentials, ApiUtils.getRoom(userEntity.getBaseUrl(), room.getToken()), room.getName()) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) @@ -143,7 +143,7 @@ public class OperationsMenuController extends BaseController { .subscribe(operationsObserver); break; case 3: - ncApi.makeRoomPublic(credentials, ApiHelper.getUrlForRoomVisibility(userEntity.getBaseUrl(), room + ncApi.makeRoomPublic(credentials, ApiUtils.getUrlForRoomVisibility(userEntity.getBaseUrl(), room .getToken())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) @@ -157,7 +157,7 @@ public class OperationsMenuController extends BaseController { if (room.getPassword() != null) { pass = room.getPassword(); } - ncApi.setPassword(credentials, ApiHelper.getUrlForPassword(userEntity.getBaseUrl(), + ncApi.setPassword(credentials, ApiUtils.getUrlForPassword(userEntity.getBaseUrl(), room.getToken()), pass) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) @@ -168,7 +168,7 @@ public class OperationsMenuController extends BaseController { // Operation 7 is sharing, so we handle this differently break; case 8: - ncApi.makeRoomPrivate(credentials, ApiHelper.getUrlForRoomVisibility(userEntity.getBaseUrl(), room + ncApi.makeRoomPrivate(credentials, ApiUtils.getUrlForRoomVisibility(userEntity.getBaseUrl(), room .getToken())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) @@ -176,13 +176,13 @@ public class OperationsMenuController extends BaseController { .subscribe(operationsObserver); break; case 9: - ncApi.deleteRoom(credentials, ApiHelper.getUrlForRoomParticipants(userEntity.getBaseUrl(), room.getToken())) + ncApi.deleteRoom(credentials, ApiUtils.getUrlForRoomParticipants(userEntity.getBaseUrl(), room.getToken())) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .retry(1) .subscribe(operationsObserver); case 99: - ncApi.joinRoom(credentials, ApiHelper.getUrlForRoomParticipants(userEntity.getBaseUrl(), room.getToken()), + ncApi.joinRoom(credentials, ApiUtils.getUrlForRoomParticipants(userEntity.getBaseUrl(), room.getToken()), callPassword) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) diff --git a/app/src/main/java/com/nextcloud/talk/dagger/modules/RestModule.java b/app/src/main/java/com/nextcloud/talk/dagger/modules/RestModule.java index 94dab24e6..4602d7f79 100644 --- a/app/src/main/java/com/nextcloud/talk/dagger/modules/RestModule.java +++ b/app/src/main/java/com/nextcloud/talk/dagger/modules/RestModule.java @@ -28,7 +28,7 @@ import android.util.Log; import com.github.aurae.retrofit2.LoganSquareConverterFactory; import com.nextcloud.talk.BuildConfig; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; +import com.nextcloud.talk.utils.ApiUtils; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.utils.preferences.AppPreferences; import com.nextcloud.talk.utils.ssl.MagicTrustManager; @@ -208,7 +208,7 @@ public class RestModule { Request original = chain.request(); Request request = original.newBuilder() - .header("User-Agent", ApiHelper.getUserAgent()) + .header("User-Agent", ApiUtils.getUserAgent()) .header("Accept", "application/json") .header("OCS-APIRequest", "true") .method(original.method(), original.body()) diff --git a/app/src/main/java/com/nextcloud/talk/events/MoreMenuClickEvent.java b/app/src/main/java/com/nextcloud/talk/events/MoreMenuClickEvent.java index da0101e1a..23044dd60 100644 --- a/app/src/main/java/com/nextcloud/talk/events/MoreMenuClickEvent.java +++ b/app/src/main/java/com/nextcloud/talk/events/MoreMenuClickEvent.java @@ -20,7 +20,7 @@ package com.nextcloud.talk.events; -import com.nextcloud.talk.api.models.json.rooms.Room; +import com.nextcloud.talk.models.json.rooms.Room; import lombok.Data; diff --git a/app/src/main/java/com/nextcloud/talk/events/SessionDescriptionSendEvent.java b/app/src/main/java/com/nextcloud/talk/events/SessionDescriptionSendEvent.java index 322ad91a5..1c1d2f02e 100644 --- a/app/src/main/java/com/nextcloud/talk/events/SessionDescriptionSendEvent.java +++ b/app/src/main/java/com/nextcloud/talk/events/SessionDescriptionSendEvent.java @@ -22,7 +22,7 @@ package com.nextcloud.talk.events; import android.support.annotation.Nullable; -import com.nextcloud.talk.api.models.json.signaling.NCIceCandidate; +import com.nextcloud.talk.models.json.signaling.NCIceCandidate; import org.webrtc.SessionDescription; diff --git a/app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalJob.java b/app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalJob.java index a487cfd47..6c5de7251 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalJob.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalJob.java @@ -28,9 +28,9 @@ import android.util.Log; import com.bluelinelabs.logansquare.LoganSquare; import com.evernote.android.job.Job; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; -import com.nextcloud.talk.api.models.json.generic.GenericOverall; -import com.nextcloud.talk.api.models.json.push.PushConfigurationState; +import com.nextcloud.talk.utils.ApiUtils; +import com.nextcloud.talk.models.json.generic.GenericOverall; +import com.nextcloud.talk.models.json.push.PushConfigurationState; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.persistence.entities.UserEntity; import com.nextcloud.talk.utils.database.user.UserUtils; @@ -81,8 +81,8 @@ public class AccountRemovalJob extends Job { ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(new JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class); - ncApi.unregisterDeviceForNotificationsWithNextcloud(ApiHelper.getCredentials(userEntity.getUsername(), - userEntity.getToken()), ApiHelper.getUrlNextcloudPush(userEntity.getBaseUrl())) + ncApi.unregisterDeviceForNotificationsWithNextcloud(ApiUtils.getCredentials(userEntity.getUsername(), + userEntity.getToken()), ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl())) .subscribe(new Observer() { @Override public void onSubscribe(Disposable d) { @@ -100,8 +100,8 @@ public class AccountRemovalJob extends Job { finalPushConfigurationState.getDeviceIdentifierSignature()); ncApi.unregisterDeviceForNotificationsWithProxy - (ApiHelper.getCredentials(userEntity.getUsername(), - userEntity.getToken()), ApiHelper.getUrlPushProxy(), queryMap) + (ApiUtils.getCredentials(userEntity.getUsername(), + userEntity.getToken()), ApiUtils.getUrlPushProxy(), queryMap) .subscribe(new Observer() { @Override public void onSubscribe(Disposable d) { diff --git a/app/src/main/java/com/nextcloud/talk/models/database/User.java b/app/src/main/java/com/nextcloud/talk/models/database/User.java new file mode 100644 index 000000000..7c9cd145d --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/database/User.java @@ -0,0 +1,52 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017-2018 Mario Danic + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.nextcloud.talk.models.database; + +import android.os.Parcelable; + +import java.io.Serializable; + +import io.requery.Entity; +import io.requery.Generated; +import io.requery.Key; +import io.requery.Persistable; + +@Entity +public interface User extends Parcelable, Persistable, Serializable { + @Key + @Generated + long getId(); + + String getUserId(); + + String getUsername(); + + String getBaseUrl(); + + String getToken(); + + String getDisplayName(); + + String getPushConfigurationState(); + + boolean getCurrent(); + + boolean getScheduledForDeletion(); +} diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/call/Call.java b/app/src/main/java/com/nextcloud/talk/models/json/call/Call.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/call/Call.java rename to app/src/main/java/com/nextcloud/talk/models/json/call/Call.java index a45840d37..97c5b3223 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/call/Call.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/call/Call.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.call; +package com.nextcloud.talk.models.json.call; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/call/CallOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/call/CallOCS.java similarity index 90% rename from app/src/main/java/com/nextcloud/talk/api/models/json/call/CallOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/call/CallOCS.java index 3eca77b50..92e23aaeb 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/call/CallOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/call/CallOCS.java @@ -18,11 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.call; +package com.nextcloud.talk.models.json.call; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import org.parceler.Parcel; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/call/CallOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/call/CallOverall.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/call/CallOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/call/CallOverall.java index 5f2944a20..29f80e1b2 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/call/CallOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/call/CallOverall.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.call; +package com.nextcloud.talk.models.json.call; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/converters/EnumParticipantTypeConverter.java b/app/src/main/java/com/nextcloud/talk/models/json/converters/EnumParticipantTypeConverter.java similarity index 94% rename from app/src/main/java/com/nextcloud/talk/api/models/json/converters/EnumParticipantTypeConverter.java rename to app/src/main/java/com/nextcloud/talk/models/json/converters/EnumParticipantTypeConverter.java index 6154f8b91..86a0639c3 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/converters/EnumParticipantTypeConverter.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/converters/EnumParticipantTypeConverter.java @@ -18,10 +18,10 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.converters; +package com.nextcloud.talk.models.json.converters; import com.bluelinelabs.logansquare.typeconverters.IntBasedTypeConverter; -import com.nextcloud.talk.api.models.json.participants.Participant; +import com.nextcloud.talk.models.json.participants.Participant; public class EnumParticipantTypeConverter extends IntBasedTypeConverter { @Override diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/converters/EnumRoomTypeConverter.java b/app/src/main/java/com/nextcloud/talk/models/json/converters/EnumRoomTypeConverter.java similarity index 94% rename from app/src/main/java/com/nextcloud/talk/api/models/json/converters/EnumRoomTypeConverter.java rename to app/src/main/java/com/nextcloud/talk/models/json/converters/EnumRoomTypeConverter.java index 413d90a5c..5033b2e53 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/converters/EnumRoomTypeConverter.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/converters/EnumRoomTypeConverter.java @@ -18,10 +18,10 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.converters; +package com.nextcloud.talk.models.json.converters; import com.bluelinelabs.logansquare.typeconverters.IntBasedTypeConverter; -import com.nextcloud.talk.api.models.json.rooms.Room; +import com.nextcloud.talk.models.json.rooms.Room; public class EnumRoomTypeConverter extends IntBasedTypeConverter { @Override diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericMeta.java b/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericMeta.java rename to app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.java index 3c5b624bd..24a856f5f 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericMeta.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.generic; +package com.nextcloud.talk.models.json.generic; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOCS.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOCS.java index a26dcca32..7725735c1 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOCS.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.generic; +package com.nextcloud.talk.models.json.generic; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOverall.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOverall.java index c7282a3b6..e6c8959ac 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOverall.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.generic; +package com.nextcloud.talk.models.json.generic; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/generic/Status.java b/app/src/main/java/com/nextcloud/talk/models/json/generic/Status.java similarity index 96% rename from app/src/main/java/com/nextcloud/talk/api/models/json/generic/Status.java rename to app/src/main/java/com/nextcloud/talk/models/json/generic/Status.java index 37566c684..58958aa51 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/generic/Status.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/generic/Status.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.generic; +package com.nextcloud.talk.models.json.generic; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/AddParticipantOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOCS.java similarity index 86% rename from app/src/main/java/com/nextcloud/talk/api/models/json/participants/AddParticipantOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOCS.java index 6082c4b50..b7aafa3b5 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/AddParticipantOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOCS.java @@ -18,12 +18,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.participants; +package com.nextcloud.talk.models.json.participants; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; -import com.nextcloud.talk.api.models.json.rooms.Room; +import com.nextcloud.talk.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.rooms.Room; @JsonObject public class AddParticipantOCS extends GenericOCS { diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/AddParticipantOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOverall.java similarity index 89% rename from app/src/main/java/com/nextcloud/talk/api/models/json/participants/AddParticipantOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOverall.java index 6b04df37d..dff0a1286 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/AddParticipantOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOverall.java @@ -18,11 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.participants; +package com.nextcloud.talk.models.json.participants; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.rooms.RoomsOCS; +import com.nextcloud.talk.models.json.rooms.RoomsOCS; @JsonObject public class AddParticipantOverall { diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/Participant.java b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.java similarity index 96% rename from app/src/main/java/com/nextcloud/talk/api/models/json/participants/Participant.java rename to app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.java index 0859eb851..72009a2c1 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/Participant.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.participants; +package com.nextcloud.talk.models.json.participants; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/ParticipantsOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.java similarity index 89% rename from app/src/main/java/com/nextcloud/talk/api/models/json/participants/ParticipantsOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.java index 4bf229a74..3ec968e8e 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/ParticipantsOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.java @@ -18,11 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.participants; +package com.nextcloud.talk.models.json.participants; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import java.util.List; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/ParticipantsOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/participants/ParticipantsOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.java index 65e453cb9..3bab0721a 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/participants/ParticipantsOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.participants; +package com.nextcloud.talk.models.json.participants; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/push/DecryptedPushMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.java similarity index 96% rename from app/src/main/java/com/nextcloud/talk/api/models/json/push/DecryptedPushMessage.java rename to app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.java index 41b7e084a..65f676e6c 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/push/DecryptedPushMessage.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.push; +package com.nextcloud.talk.models.json.push; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushConfigurationState.java b/app/src/main/java/com/nextcloud/talk/models/json/push/PushConfigurationState.java similarity index 96% rename from app/src/main/java/com/nextcloud/talk/api/models/json/push/PushConfigurationState.java rename to app/src/main/java/com/nextcloud/talk/models/json/push/PushConfigurationState.java index 13597c31d..c8038dc60 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushConfigurationState.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/push/PushConfigurationState.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.push; +package com.nextcloud.talk.models.json.push; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java similarity index 94% rename from app/src/main/java/com/nextcloud/talk/api/models/json/push/PushMessage.java rename to app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java index b6ac73477..cc8f39932 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushMessage.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.push; +package com.nextcloud.talk.models.json.push; import org.parceler.Parcel; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistration.java b/app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistration.java similarity index 96% rename from app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistration.java rename to app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistration.java index 2e8547a86..0e9d5b65b 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistration.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistration.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.push; +package com.nextcloud.talk.models.json.push; import com.bluelinelabs.logansquare.annotation.JsonField; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistrationOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOCS.java similarity index 90% rename from app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistrationOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOCS.java index 3387493d7..e52d5e3c6 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistrationOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOCS.java @@ -18,11 +18,11 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.push; +package com.nextcloud.talk.models.json.push; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import org.parceler.Parcel; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistrationOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOverall.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistrationOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOverall.java index 7ebc4f1a0..572daaafc 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistrationOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOverall.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.push; +package com.nextcloud.talk.models.json.push; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/Room.java b/app/src/main/java/com/nextcloud/talk/models/json/rooms/Room.java similarity index 90% rename from app/src/main/java/com/nextcloud/talk/api/models/json/rooms/Room.java rename to app/src/main/java/com/nextcloud/talk/models/json/rooms/Room.java index a8b17da52..b23b8ce50 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/Room.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/rooms/Room.java @@ -18,13 +18,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.rooms; +package com.nextcloud.talk.models.json.rooms; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.converters.EnumParticipantTypeConverter; -import com.nextcloud.talk.api.models.json.converters.EnumRoomTypeConverter; -import com.nextcloud.talk.api.models.json.participants.Participant; +import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter; +import com.nextcloud.talk.models.json.converters.EnumRoomTypeConverter; +import com.nextcloud.talk.models.json.participants.Participant; import org.parceler.Parcel; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomOCS.java similarity index 90% rename from app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomOCS.java index 44c3646e6..a30cc617e 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomOCS.java @@ -18,11 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.rooms; +package com.nextcloud.talk.models.json.rooms; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import lombok.Data; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomOverall.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomOverall.java index 3882aae11..5030262b1 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomOverall.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.rooms; +package com.nextcloud.talk.models.json.rooms; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomsOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomsOCS.java similarity index 90% rename from app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomsOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomsOCS.java index 274363110..4c2ba917c 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomsOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomsOCS.java @@ -18,11 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.rooms; +package com.nextcloud.talk.models.json.rooms; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import org.parceler.Parcel; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomsOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomsOverall.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomsOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomsOverall.java index 6a3a04105..ff63df4b1 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomsOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomsOverall.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.rooms; +package com.nextcloud.talk.models.json.rooms; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ExactSharees.java b/app/src/main/java/com/nextcloud/talk/models/json/sharees/ExactSharees.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ExactSharees.java rename to app/src/main/java/com/nextcloud/talk/models/json/sharees/ExactSharees.java index 0f6e228c2..f1a453309 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ExactSharees.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/sharees/ExactSharees.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.sharees; +package com.nextcloud.talk.models.json.sharees; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/Sharee.java b/app/src/main/java/com/nextcloud/talk/models/json/sharees/Sharee.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/sharees/Sharee.java rename to app/src/main/java/com/nextcloud/talk/models/json/sharees/Sharee.java index 31d617317..599d89bca 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/Sharee.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/sharees/Sharee.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.sharees; +package com.nextcloud.talk.models.json.sharees; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ShareesOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/sharees/ShareesOCS.java similarity index 90% rename from app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ShareesOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/sharees/ShareesOCS.java index b599d50fb..e79a18584 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ShareesOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/sharees/ShareesOCS.java @@ -18,11 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.sharees; +package com.nextcloud.talk.models.json.sharees; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import org.parceler.Parcel; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ShareesOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/sharees/ShareesOverall.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ShareesOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/sharees/ShareesOverall.java index dfc761c1b..eccf496a9 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ShareesOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/sharees/ShareesOverall.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.sharees; +package com.nextcloud.talk.models.json.sharees; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/SharesData.java b/app/src/main/java/com/nextcloud/talk/models/json/sharees/SharesData.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/sharees/SharesData.java rename to app/src/main/java/com/nextcloud/talk/models/json/sharees/SharesData.java index ed55af538..acdd5102d 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/SharesData.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/sharees/SharesData.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.sharees; +package com.nextcloud.talk.models.json.sharees; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/Value.java b/app/src/main/java/com/nextcloud/talk/models/json/sharees/Value.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/sharees/Value.java rename to app/src/main/java/com/nextcloud/talk/models/json/sharees/Value.java index 5da497378..6eac35196 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/sharees/Value.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/sharees/Value.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.sharees; +package com.nextcloud.talk.models.json.sharees; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/DataChannelMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/DataChannelMessage.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.java index b29214853..394b0fc27 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/DataChannelMessage.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling; +package com.nextcloud.talk.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCIceCandidate.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCIceCandidate.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.java index 546d92fb5..6ea0be569 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCIceCandidate.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling; +package com.nextcloud.talk.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessagePayload.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessagePayload.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.java index e63d1dd9b..cbd0645e8 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessagePayload.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling; +package com.nextcloud.talk.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessageWrapper.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessageWrapper.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.java index 25afd2467..9c5af0d0a 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessageWrapper.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling; +package com.nextcloud.talk.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.java index 1e3ff287e..3876aae83 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling; +package com.nextcloud.talk.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/Signaling.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/Signaling.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java index 5dfbadc3b..c62e76dc8 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/Signaling.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling; +package com.nextcloud.talk.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java similarity index 90% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java index ced5207b6..495314972 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java @@ -18,11 +18,11 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling; +package com.nextcloud.talk.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import java.util.List; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java similarity index 94% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java index 5eb0a266a..25fa42fe5 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling; +package com.nextcloud.talk.models.json.signaling; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/IceServer.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java similarity index 94% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/IceServer.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java index be7b90227..412e8d998 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/IceServer.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling.settings; +package com.nextcloud.talk.models.json.signaling.settings; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/Settings.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java similarity index 94% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/Settings.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java index af443c40f..f16cbd1a7 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/Settings.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling.settings; +package com.nextcloud.talk.models.json.signaling.settings; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/SignalingSettingsOcs.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java similarity index 89% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/SignalingSettingsOcs.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java index 6759517f1..258295466 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/SignalingSettingsOcs.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java @@ -18,11 +18,11 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling.settings; +package com.nextcloud.talk.models.json.signaling.settings; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import lombok.Data; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/SignalingSettingsOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.java similarity index 94% rename from app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/SignalingSettingsOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.java index 7acc16c65..fbe7c5098 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/SignalingSettingsOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.java @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.signaling.settings; +package com.nextcloud.talk.models.json.signaling.settings; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileData.java b/app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileData.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileData.java rename to app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileData.java index 110c63a7a..9b62f093c 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileData.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileData.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.userprofile; +package com.nextcloud.talk.models.json.userprofile; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileOCS.java similarity index 90% rename from app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileOCS.java rename to app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileOCS.java index 0de5d1ec8..132f12442 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileOCS.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileOCS.java @@ -18,11 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.userprofile; +package com.nextcloud.talk.models.json.userprofile; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.api.models.json.generic.GenericOCS; +import com.nextcloud.talk.models.json.generic.GenericOCS; import org.parceler.Parcel; diff --git a/app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileOverall.java similarity index 95% rename from app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileOverall.java rename to app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileOverall.java index 9044b0140..4ced43f8c 100644 --- a/app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileOverall.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileOverall.java @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.models.json.userprofile; +package com.nextcloud.talk.models.json.userprofile; import com.bluelinelabs.logansquare.annotation.JsonField; import com.bluelinelabs.logansquare.annotation.JsonObject; diff --git a/app/src/main/java/com/nextcloud/talk/persistence/entities/User.java b/app/src/main/java/com/nextcloud/talk/persistence/entities/User.java deleted file mode 100644 index d9d545325..000000000 --- a/app/src/main/java/com/nextcloud/talk/persistence/entities/User.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * - * Nextcloud Talk application - * - * @author Mario Danic - * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.nextcloud.talk.persistence.entities; - -import android.os.Parcelable; - -import java.io.Serializable; - -import io.requery.Entity; -import io.requery.Generated; -import io.requery.Key; -import io.requery.Persistable; - -@Entity -public interface User extends Parcelable, Persistable, Serializable { - @Key - @Generated - long getId(); - - String getUserId(); - - String getUsername(); - - String getBaseUrl(); - - String getToken(); - - String getDisplayName(); - - String getPushConfigurationState(); - - boolean getCurrent(); - - boolean getScheduledForDeletion(); -} diff --git a/app/src/main/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.java b/app/src/main/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.java index 4fb3a9d2b..02fe573b8 100644 --- a/app/src/main/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.java +++ b/app/src/main/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.java @@ -40,8 +40,8 @@ import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; import com.nextcloud.talk.R; import com.nextcloud.talk.activities.CallActivity; -import com.nextcloud.talk.api.models.json.push.DecryptedPushMessage; -import com.nextcloud.talk.api.models.json.push.PushMessage; +import com.nextcloud.talk.models.json.push.DecryptedPushMessage; +import com.nextcloud.talk.models.json.push.PushMessage; import com.nextcloud.talk.models.SignatureVerification; import com.nextcloud.talk.utils.NotificationUtils; import com.nextcloud.talk.utils.PushUtils; diff --git a/app/src/main/java/com/nextcloud/talk/api/helpers/api/ApiHelper.java b/app/src/main/java/com/nextcloud/talk/utils/ApiUtils.java similarity index 97% rename from app/src/main/java/com/nextcloud/talk/api/helpers/api/ApiHelper.java rename to app/src/main/java/com/nextcloud/talk/utils/ApiUtils.java index bb2a685f8..defe4fac3 100644 --- a/app/src/main/java/com/nextcloud/talk/api/helpers/api/ApiHelper.java +++ b/app/src/main/java/com/nextcloud/talk/utils/ApiUtils.java @@ -2,7 +2,7 @@ * Nextcloud Talk application * * @author Mario Danic - * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com) + * Copyright (C) 2017-2018 Mario Danic * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.nextcloud.talk.api.helpers.api; +package com.nextcloud.talk.utils; import android.net.Uri; @@ -31,7 +31,7 @@ import java.util.Map; import okhttp3.Credentials; -public class ApiHelper { +public class ApiUtils { private static String ocsApiVersion = "/ocs/v2.php"; private static String spreedApiVersion = "/apps/spreed/api/v1"; diff --git a/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java b/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java index 061f48b16..6410b5278 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java @@ -28,8 +28,7 @@ import android.util.Log; import com.bluelinelabs.logansquare.LoganSquare; import com.nextcloud.talk.R; import com.nextcloud.talk.api.NcApi; -import com.nextcloud.talk.api.helpers.api.ApiHelper; -import com.nextcloud.talk.api.models.json.push.PushConfigurationState; +import com.nextcloud.talk.models.json.push.PushConfigurationState; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.models.SignatureVerification; import com.nextcloud.talk.persistence.entities.UserEntity; @@ -265,8 +264,8 @@ public class PushUtils { JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class); ncApi.registerDeviceForNotificationsWithNextcloud( - ApiHelper.getCredentials(userEntity.getUsername(), userEntity.getToken()), - ApiHelper.getUrlNextcloudPush(userEntity.getBaseUrl()), queryMap) + ApiUtils.getCredentials(userEntity.getUsername(), userEntity.getToken()), + ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()), queryMap) .subscribeOn(Schedulers.newThread()) .subscribe(pushRegistrationOverall -> { Map proxyMap = new HashMap<>(); @@ -279,9 +278,9 @@ public class PushUtils { .getData().getPublicKey()); - ncApi.registerDeviceForNotificationsWithProxy(ApiHelper.getCredentials + ncApi.registerDeviceForNotificationsWithProxy(ApiUtils.getCredentials (userEntity.getUsername(), userEntity.getToken()), - ApiHelper.getUrlPushProxy(), proxyMap) + ApiUtils.getUrlPushProxy(), proxyMap) .subscribeOn(Schedulers.newThread()) .subscribe(new Consumer() { @Override diff --git a/app/src/main/java/com/nextcloud/talk/utils/ShareUtils.java b/app/src/main/java/com/nextcloud/talk/utils/ShareUtils.java index c9498ec63..10d85c084 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/ShareUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/ShareUtils.java @@ -33,7 +33,7 @@ import android.text.TextUtils; import com.kennyc.bottomsheet.adapters.AppAdapter; import com.nextcloud.talk.R; -import com.nextcloud.talk.api.models.json.rooms.Room; +import com.nextcloud.talk.models.json.rooms.Room; import com.nextcloud.talk.persistence.entities.UserEntity; import com.nextcloud.talk.utils.database.user.UserUtils; diff --git a/app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java b/app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java index f03301b2e..7c258c26b 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java @@ -23,7 +23,7 @@ package com.nextcloud.talk.utils.database.user; import android.support.annotation.Nullable; import android.text.TextUtils; -import com.nextcloud.talk.persistence.entities.User; +import com.nextcloud.talk.models.database.User; import com.nextcloud.talk.persistence.entities.UserEntity; import java.util.List; diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java b/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java index 8cbff26ec..af602709e 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java @@ -26,8 +26,8 @@ import android.util.Log; import com.bluelinelabs.logansquare.LoganSquare; import com.nextcloud.talk.R; -import com.nextcloud.talk.api.models.json.signaling.DataChannelMessage; -import com.nextcloud.talk.api.models.json.signaling.NCIceCandidate; +import com.nextcloud.talk.models.json.signaling.DataChannelMessage; +import com.nextcloud.talk.models.json.signaling.NCIceCandidate; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.events.MediaStreamEvent; import com.nextcloud.talk.events.PeerConnectionEvent;