Эх сурвалжийг харах

Cleanups

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 7 жил өмнө
parent
commit
2dc738e2f2
72 өөрчлөгдсөн 236 нэмэгдсэн , 286 устгасан
  1. 32 80
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
  2. 4 4
      app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java
  3. 4 4
      app/src/main/java/com/nextcloud/talk/adapters/items/CallItem.java
  4. 4 4
      app/src/main/java/com/nextcloud/talk/adapters/items/UserItem.java
  5. 12 12
      app/src/main/java/com/nextcloud/talk/api/NcApi.java
  6. 6 6
      app/src/main/java/com/nextcloud/talk/controllers/AccountVerificationController.java
  7. 5 5
      app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java
  8. 8 8
      app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java
  9. 2 2
      app/src/main/java/com/nextcloud/talk/controllers/ServerSelectionController.java
  10. 5 5
      app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java
  11. 1 1
      app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.java
  12. 1 1
      app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java
  13. 1 1
      app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java
  14. 11 11
      app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java
  15. 2 2
      app/src/main/java/com/nextcloud/talk/dagger/modules/RestModule.java
  16. 1 1
      app/src/main/java/com/nextcloud/talk/events/MoreMenuClickEvent.java
  17. 1 1
      app/src/main/java/com/nextcloud/talk/events/SessionDescriptionSendEvent.java
  18. 7 7
      app/src/main/java/com/nextcloud/talk/jobs/AccountRemovalJob.java
  19. 52 0
      app/src/main/java/com/nextcloud/talk/models/database/User.java
  20. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/call/Call.java
  21. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/call/CallOCS.java
  22. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/call/CallOverall.java
  23. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/converters/EnumParticipantTypeConverter.java
  24. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/converters/EnumRoomTypeConverter.java
  25. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.java
  26. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOCS.java
  27. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOverall.java
  28. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/generic/Status.java
  29. 3 3
      app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOCS.java
  30. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOverall.java
  31. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.java
  32. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.java
  33. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.java
  34. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.java
  35. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/push/PushConfigurationState.java
  36. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java
  37. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistration.java
  38. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOCS.java
  39. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOverall.java
  40. 4 4
      app/src/main/java/com/nextcloud/talk/models/json/rooms/Room.java
  41. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomOCS.java
  42. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomOverall.java
  43. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomsOCS.java
  44. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/rooms/RoomsOverall.java
  45. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/sharees/ExactSharees.java
  46. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/sharees/Sharee.java
  47. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/sharees/ShareesOCS.java
  48. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/sharees/ShareesOverall.java
  49. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/sharees/SharesData.java
  50. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/sharees/Value.java
  51. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.java
  52. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.java
  53. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.java
  54. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.java
  55. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.java
  56. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java
  57. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java
  58. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java
  59. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java
  60. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java
  61. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java
  62. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.java
  63. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileData.java
  64. 2 2
      app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileOCS.java
  65. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/userprofile/UserProfileOverall.java
  66. 0 53
      app/src/main/java/com/nextcloud/talk/persistence/entities/User.java
  67. 2 2
      app/src/main/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.java
  68. 3 3
      app/src/main/java/com/nextcloud/talk/utils/ApiUtils.java
  69. 5 6
      app/src/main/java/com/nextcloud/talk/utils/PushUtils.java
  70. 1 1
      app/src/main/java/com/nextcloud/talk/utils/ShareUtils.java
  71. 1 1
      app/src/main/java/com/nextcloud/talk/utils/database/user/UserUtils.java
  72. 2 2
      app/src/main/java/com/nextcloud/talk/webrtc/MagicPeerConnectionWrapper.java

+ 32 - 80
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<RoomsOverall>() {
@@ -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<SignalingSettingsOverall>() {
@@ -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<GenericOverall>() {
@@ -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<GenericOverall>() {
@@ -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;

+ 4 - 4
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<AdvancedUserItem.User
             layoutParams.setMarginStart(0);
             layoutParams.removeRule(RelativeLayout.ALIGN_PARENT_START);
             holder.linearLayout.setLayoutParams(layoutParams);
-            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())

+ 4 - 4
app/src/main/java/com/nextcloud/talk/adapters/items/CallItem.java

@@ -33,8 +33,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.rooms.Room;
+import com.nextcloud.talk.utils.ApiUtils;
+import com.nextcloud.talk.models.json.rooms.Room;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.events.MoreMenuClickEvent;
 import com.nextcloud.talk.persistence.entities.UserEntity;
@@ -125,10 +125,10 @@ public class CallItem extends AbstractFlexibleItem<CallItem.RoomItemViewHolder>
                 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())

+ 4 - 4
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<UserItem.UserItemViewHolder>
             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())

+ 12 - 12
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;
 

+ 6 - 6
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 -> {

+ 5 - 5
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 -> {

+ 8 - 8
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())

+ 2 - 2
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);

+ 5 - 5
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())

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 11 - 11
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())

+ 2 - 2
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())

+ 1 - 1
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;
 

+ 1 - 1
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;
 

+ 7 - 7
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<GenericOverall>() {
                                 @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<Void>() {
                                                     @Override
                                                     public void onSubscribe(Disposable d) {

+ 52 - 0
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 <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 <http://www.gnu.org/licenses/>.
+ */
+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();
+}

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/call/Call.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/call/CallOCS.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/call/CallOverall.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/converters/EnumParticipantTypeConverter.java → app/src/main/java/com/nextcloud/talk/models/json/converters/EnumParticipantTypeConverter.java

@@ -18,10 +18,10 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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<Participant.ParticipantType> {
     @Override

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/converters/EnumRoomTypeConverter.java → app/src/main/java/com/nextcloud/talk/models/json/converters/EnumRoomTypeConverter.java

@@ -18,10 +18,10 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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<Room.RoomType> {
     @Override

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericMeta.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericOCS.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/generic/GenericOverall.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/generic/Status.java → app/src/main/java/com/nextcloud/talk/models/json/generic/Status.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 3 - 3
app/src/main/java/com/nextcloud/talk/api/models/json/participants/AddParticipantOCS.java → 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 <http://www.gnu.org/licenses/>.
  */
-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 {

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/participants/AddParticipantOverall.java → 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 <http://www.gnu.org/licenses/>.
  */
-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 {

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/participants/Participant.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/participants/ParticipantsOCS.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/participants/ParticipantsOverall.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/push/DecryptedPushMessage.java → app/src/main/java/com/nextcloud/talk/models/json/push/DecryptedPushMessage.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/push/PushConfigurationState.java → app/src/main/java/com/nextcloud/talk/models/json/push/PushConfigurationState.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/push/PushMessage.java → app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-package com.nextcloud.talk.api.models.json.push;
+package com.nextcloud.talk.models.json.push;
 
 import org.parceler.Parcel;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistration.java → app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistration.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-package com.nextcloud.talk.api.models.json.push;
+package com.nextcloud.talk.models.json.push;
 
 
 import com.bluelinelabs.logansquare.annotation.JsonField;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistrationOCS.java → app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOCS.java

@@ -18,11 +18,11 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/push/PushRegistrationOverall.java → app/src/main/java/com/nextcloud/talk/models/json/push/PushRegistrationOverall.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 4 - 4
app/src/main/java/com/nextcloud/talk/api/models/json/rooms/Room.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;
 

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomOCS.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomOverall.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomsOCS.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/rooms/RoomsOverall.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ExactSharees.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/sharees/Sharee.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ShareesOCS.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/sharees/ShareesOverall.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/sharees/SharesData.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/sharees/Value.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/DataChannelMessage.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCIceCandidate.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessagePayload.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCMessageWrapper.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/NCSignalingMessage.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/Signaling.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOCS.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java

@@ -18,11 +18,11 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/SignalingOverall.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/IceServer.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/Settings.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/SignalingSettingsOcs.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java

@@ -18,11 +18,11 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/signaling/settings/SignalingSettingsOverall.java → app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOverall.java

@@ -18,7 +18,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-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;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileData.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 2 - 2
app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileOCS.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;
 

+ 1 - 1
app/src/main/java/com/nextcloud/talk/api/models/json/userprofile/UserProfileOverall.java → 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 <http://www.gnu.org/licenses/>.
  */
-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;

+ 0 - 53
app/src/main/java/com/nextcloud/talk/persistence/entities/User.java

@@ -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 <http://www.gnu.org/licenses/>.
- */
-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();
-}

+ 2 - 2
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;

+ 3 - 3
app/src/main/java/com/nextcloud/talk/api/helpers/api/ApiHelper.java → 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 <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
@@ -17,7 +17,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-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";
 

+ 5 - 6
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<String, String> 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<Void>() {
                                                     @Override

+ 1 - 1
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;
 

+ 1 - 1
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;

+ 2 - 2
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;