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

Merge pull request #2061 from nextcloud/chore/noid/migrateParceler2

Parcel to Parcelize Migration
Andy Scherzinger 3 жил өмнө
parent
commit
579e73ef2a
100 өөрчлөгдсөн 2256 нэмэгдсэн , 4658 устгасан
  1. 10 7
      app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt
  2. 0 5
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.java
  3. 2 2
      app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java
  4. 28 0
      app/src/main/java/com/nextcloud/talk/activities/CallStatus.kt
  5. 5 5
      app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt
  6. 4 4
      app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java
  7. 9 9
      app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt
  8. 7 7
      app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt
  9. 7 7
      app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt
  10. 6 6
      app/src/main/java/com/nextcloud/talk/adapters/messages/MagicOutcomingTextMessageViewHolder.kt
  11. 15 12
      app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java
  12. 4 4
      app/src/main/java/com/nextcloud/talk/adapters/messages/MagicSystemMessageViewHolder.java
  13. 5 5
      app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt
  14. 3 3
      app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt
  15. 5 5
      app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt
  16. 2 2
      app/src/main/java/com/nextcloud/talk/components/filebrowser/adapters/items/BrowserFileItem.java
  17. 7 6
      app/src/main/java/com/nextcloud/talk/components/filebrowser/controllers/BrowserController.kt
  18. 0 309
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/BrowserFile.java
  19. 118 0
      app/src/main/java/com/nextcloud/talk/components/filebrowser/models/BrowserFile.kt
  20. 2 2
      app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java
  21. 39 39
      app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt
  22. 14 14
      app/src/main/java/com/nextcloud/talk/controllers/ContactsController.kt
  23. 7 7
      app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt
  24. 13 11
      app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java
  25. 5 5
      app/src/main/java/com/nextcloud/talk/controllers/RingtoneSelectionController.kt
  26. 4 4
      app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.kt
  27. 27 27
      app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.kt
  28. 2 2
      app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java
  29. 0 91
      app/src/main/java/com/nextcloud/talk/models/ExternalSignalingServer.java
  30. 39 0
      app/src/main/java/com/nextcloud/talk/models/ExternalSignalingServer.kt
  31. 0 101
      app/src/main/java/com/nextcloud/talk/models/LoginData.java
  32. 32 0
      app/src/main/java/com/nextcloud/talk/models/LoginData.kt
  33. 0 86
      app/src/main/java/com/nextcloud/talk/models/RetrofitBucket.java
  34. 31 0
      app/src/main/java/com/nextcloud/talk/models/RetrofitBucket.kt
  35. 0 98
      app/src/main/java/com/nextcloud/talk/models/RingtoneSettings.java
  36. 41 0
      app/src/main/java/com/nextcloud/talk/models/RingtoneSettings.kt
  37. 0 85
      app/src/main/java/com/nextcloud/talk/models/SignatureVerification.java
  38. 32 0
      app/src/main/java/com/nextcloud/talk/models/SignatureVerification.kt
  39. 33 0
      app/src/main/java/com/nextcloud/talk/models/json/AnyParceler.kt
  40. 0 694
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.java
  41. 473 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.kt
  42. 0 76
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCS.java
  43. 40 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCS.kt
  44. 0 74
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCSSingleMessage.java
  45. 40 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCSSingleMessage.kt
  46. 0 74
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.java
  47. 37 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.kt
  48. 0 74
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.java
  49. 37 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.kt
  50. 0 76
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.java
  51. 38 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.kt
  52. 0 75
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.java
  53. 37 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.kt
  54. 0 78
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.java
  55. 41 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.kt
  56. 0 75
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.java
  57. 37 0
      app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.kt
  58. 2 3
      app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.kt
  59. 0 624
      app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.java
  60. 198 0
      app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt
  61. 0 72
      app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomOCS.java
  62. 40 0
      app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomOCS.kt
  63. 0 71
      app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomOverall.java
  64. 37 0
      app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomOverall.kt
  65. 0 77
      app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomsOCS.java
  66. 40 0
      app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomsOCS.kt
  67. 0 74
      app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomsOverall.java
  68. 37 0
      app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomsOverall.kt
  69. 1 0
      app/src/main/java/com/nextcloud/talk/models/json/converters/EnumSystemMessageTypeConverter.kt
  70. 1 1
      app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.kt
  71. 0 38
      app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOCS.java
  72. 15 14
      app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOverall.kt
  73. 0 35
      app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOCS.java
  74. 42 0
      app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOCS.kt
  75. 0 72
      app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOverall.java
  76. 38 0
      app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOverall.kt
  77. 0 3
      app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.kt
  78. 0 100
      app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.java
  79. 43 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.kt
  80. 0 102
      app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessageNick.java
  81. 40 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessageNick.kt
  82. 0 107
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.java
  83. 41 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.kt
  84. 0 146
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.java
  85. 45 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.kt
  86. 0 111
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.java
  87. 42 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.kt
  88. 0 176
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.java
  89. 49 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.kt
  90. 0 93
      app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java
  91. 43 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.kt
  92. 0 74
      app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java
  93. 40 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.kt
  94. 0 71
      app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java
  95. 37 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.kt
  96. 0 129
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java
  97. 44 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.kt
  98. 0 127
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java
  99. 43 0
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.kt
  100. 0 72
      app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java

+ 10 - 7
app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt

@@ -191,16 +191,16 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
             if (delete) {
             if (delete) {
                 cancelExistingNotificationWithId(
                 cancelExistingNotificationWithId(
                     applicationContext,
                     applicationContext,
-                    signatureVerification!!.userEntity,
+                    signatureVerification!!.userEntity!!,
                     notificationId
                     notificationId
                 )
                 )
             } else if (deleteAll) {
             } else if (deleteAll) {
-                cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity)
+                cancelAllNotificationsForAccount(applicationContext, signatureVerification!!.userEntity!!)
             } else if (deleteMultiple) {
             } else if (deleteMultiple) {
                 notificationIds!!.forEach {
                 notificationIds!!.forEach {
                     cancelExistingNotificationWithId(
                     cancelExistingNotificationWithId(
                         applicationContext,
                         applicationContext,
-                        signatureVerification!!.userEntity,
+                        signatureVerification!!.userEntity!!,
                         it
                         it
                     )
                     )
                 }
                 }
@@ -222,7 +222,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
 
 
                 val soundUri = getCallRingtoneUri(applicationContext!!, appPreferences!!)
                 val soundUri = getCallRingtoneUri(applicationContext!!, appPreferences!!)
                 val notificationChannelId = NotificationUtils.NOTIFICATION_CHANNEL_CALLS_V4
                 val notificationChannelId = NotificationUtils.NOTIFICATION_CHANNEL_CALLS_V4
-                val uri = Uri.parse(signatureVerification!!.userEntity.baseUrl)
+                val uri = Uri.parse(signatureVerification!!.userEntity!!.baseUrl)
                 val baseUrl = uri.host
                 val baseUrl = uri.host
 
 
                 val notification =
                 val notification =
@@ -275,10 +275,13 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
         )
         )
 
 
         ncApi.getPeersForCall(
         ncApi.getPeersForCall(
-            ApiUtils.getCredentials(signatureVerification.userEntity.username, signatureVerification.userEntity.token),
+            ApiUtils.getCredentials(
+                signatureVerification.userEntity!!.username,
+                signatureVerification.userEntity!!.token
+            ),
             ApiUtils.getUrlForCall(
             ApiUtils.getUrlForCall(
                 apiVersion,
                 apiVersion,
-                signatureVerification.userEntity.baseUrl,
+                signatureVerification.userEntity!!.baseUrl,
                 decryptedPushMessage.id
                 decryptedPushMessage.id
             )
             )
         )
         )
@@ -298,7 +301,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
                     hasParticipantsInCall = participantList.isNotEmpty()
                     hasParticipantsInCall = participantList.isNotEmpty()
                     if (hasParticipantsInCall) {
                     if (hasParticipantsInCall) {
                         for (participant in participantList) {
                         for (participant in participantList) {
-                            if (participant.actorId == signatureVerification.userEntity.userId &&
+                            if (participant.actorId == signatureVerification.userEntity!!.userId &&
                                 participant.actorType == Participant.ActorType.USERS
                                 participant.actorType == Participant.ActorType.USERS
                             ) {
                             ) {
                                 inCallOnDifferentDevice = true
                                 inCallOnDifferentDevice = true

+ 0 - 5
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

@@ -268,11 +268,6 @@ public class CallActivity extends CallBaseActivity {
 
 
     private AudioOutputDialog audioOutputDialog;
     private AudioOutputDialog audioOutputDialog;
 
 
-    @Parcel
-    public enum CallStatus {
-        CONNECTING, CALLING_TIMEOUT, JOINED, IN_CONVERSATION, RECONNECTING, OFFLINE, LEAVING, PUBLISHER_FAILED
-    }
-
     @SuppressLint("ClickableViewAccessibility")
     @SuppressLint("ClickableViewAccessibility")
     @Override
     @Override
     public void onCreate(Bundle savedInstanceState) {
     public void onCreate(Bundle savedInstanceState) {

+ 2 - 2
app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java

@@ -280,7 +280,7 @@ public class CallNotificationActivity extends CallBaseActivity {
 
 
                 @Override
                 @Override
                 public void onNext(@io.reactivex.annotations.NonNull RoomOverall roomOverall) {
                 public void onNext(@io.reactivex.annotations.NonNull RoomOverall roomOverall) {
-                    currentConversation = roomOverall.getOcs().data;
+                    currentConversation = roomOverall.getOcs().getData();
                     setUpAfterConversationIsKnown();
                     setUpAfterConversationIsKnown();
 
 
                     if (apiVersion >= 3) {
                     if (apiVersion >= 3) {
@@ -288,7 +288,7 @@ public class CallNotificationActivity extends CallBaseActivity {
                             CapabilitiesUtil.hasSpreedFeatureCapability(userBeingCalled,
                             CapabilitiesUtil.hasSpreedFeatureCapability(userBeingCalled,
                                                                         "conversation-call-flags");
                                                                         "conversation-call-flags");
                         if (hasCallFlags) {
                         if (hasCallFlags) {
-                            if (isInCallWithVideo(currentConversation.callFlag)) {
+                            if (isInCallWithVideo(currentConversation.getCallFlag())) {
                                 binding.incomingCallVoiceOrVideoTextView.setText(
                                 binding.incomingCallVoiceOrVideoTextView.setText(
                                     String.format(getResources().getString(R.string.nc_call_video),
                                     String.format(getResources().getString(R.string.nc_call_video),
                                                   getResources().getString(R.string.nc_app_product_name)));
                                                   getResources().getString(R.string.nc_app_product_name)));

+ 28 - 0
app/src/main/java/com/nextcloud/talk/activities/CallStatus.kt

@@ -0,0 +1,28 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ *
+ * 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.activities
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+enum class CallStatus : Parcelable {
+    CONNECTING, CALLING_TIMEOUT, JOINED, IN_CONVERSATION, RECONNECTING, OFFLINE, LEAVING, PUBLISHER_FAILED
+}

+ 5 - 5
app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt

@@ -256,8 +256,8 @@ class MainActivity : BaseActivity(), ActionBarProvider {
                 override fun onNext(roomOverall: RoomOverall) {
                 override fun onNext(roomOverall: RoomOverall) {
                     val bundle = Bundle()
                     val bundle = Bundle()
                     bundle.putParcelable(KEY_USER_ENTITY, currentUser)
                     bundle.putParcelable(KEY_USER_ENTITY, currentUser)
-                    bundle.putString(KEY_ROOM_TOKEN, roomOverall.ocs.data.token)
-                    bundle.putString(KEY_ROOM_ID, roomOverall.ocs.data.roomId)
+                    bundle.putString(KEY_ROOM_TOKEN, roomOverall.ocs!!.data!!.token)
+                    bundle.putString(KEY_ROOM_ID, roomOverall.ocs!!.data!!.roomId)
 
 
                     // FIXME once APIv2 or later is used only, the createRoom already returns all the data
                     // FIXME once APIv2 or later is used only, the createRoom already returns all the data
                     ncApi.getRoom(
                     ncApi.getRoom(
@@ -265,7 +265,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
                         ApiUtils.getUrlForRoom(
                         ApiUtils.getUrlForRoom(
                             apiVersion,
                             apiVersion,
                             currentUser.baseUrl,
                             currentUser.baseUrl,
-                            roomOverall.ocs.data.token
+                            roomOverall.ocs!!.data!!.token
                         )
                         )
                     )
                     )
                         .subscribeOn(Schedulers.io())
                         .subscribeOn(Schedulers.io())
@@ -277,11 +277,11 @@ class MainActivity : BaseActivity(), ActionBarProvider {
                             override fun onNext(roomOverall: RoomOverall) {
                             override fun onNext(roomOverall: RoomOverall) {
                                 bundle.putParcelable(
                                 bundle.putParcelable(
                                     KEY_ACTIVE_CONVERSATION,
                                     KEY_ACTIVE_CONVERSATION,
-                                    Parcels.wrap(roomOverall.ocs.data)
+                                    Parcels.wrap(roomOverall.ocs!!.data)
                                 )
                                 )
                                 remapChatController(
                                 remapChatController(
                                     router!!, currentUser.id,
                                     router!!, currentUser.id,
-                                    roomOverall.ocs.data.token, bundle, true
+                                    roomOverall.ocs!!.data!!.token!!, bundle, true
                                 )
                                 )
                             }
                             }
 
 

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

@@ -165,10 +165,10 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
                 ContextCompat.getColor(context,
                 ContextCompat.getColor(context,
                                        R.color.colorPrimary));
                                        R.color.colorPrimary));
 
 
-            if (conversation.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) {
+            if (conversation.getType() == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) {
                 holder.binding.dialogUnreadBubble.setChipBackgroundColorResource(R.color.colorPrimary);
                 holder.binding.dialogUnreadBubble.setChipBackgroundColorResource(R.color.colorPrimary);
                 holder.binding.dialogUnreadBubble.setTextColor(Color.WHITE);
                 holder.binding.dialogUnreadBubble.setTextColor(Color.WHITE);
-            } else if (conversation.isUnreadMention()) {
+            } else if (conversation.getUnreadMention()) {
                 if (CapabilitiesUtil.hasSpreedFeatureCapability(userEntity, "direct-mention-flag")) {
                 if (CapabilitiesUtil.hasSpreedFeatureCapability(userEntity, "direct-mention-flag")) {
                     if (conversation.getUnreadMentionDirect()) {
                     if (conversation.getUnreadMentionDirect()) {
                         holder.binding.dialogUnreadBubble.setChipBackgroundColorResource(R.color.colorPrimary);
                         holder.binding.dialogUnreadBubble.setChipBackgroundColorResource(R.color.colorPrimary);
@@ -196,7 +196,7 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
             holder.binding.dialogUnreadBubble.setVisibility(View.GONE);
             holder.binding.dialogUnreadBubble.setVisibility(View.GONE);
         }
         }
 
 
-        if (conversation.isFavorite()) {
+        if (conversation.getFavorite()) {
             holder.binding.favoriteConversationImageView.setVisibility(View.VISIBLE);
             holder.binding.favoriteConversationImageView.setVisibility(View.VISIBLE);
         } else {
         } else {
             holder.binding.favoriteConversationImageView.setVisibility(View.GONE);
             holder.binding.favoriteConversationImageView.setVisibility(View.GONE);
@@ -227,7 +227,7 @@ public class ConversationItem extends AbstractFlexibleItem<ConversationItem.Conv
                 String authorDisplayName = "";
                 String authorDisplayName = "";
                 conversation.getLastMessage().setActiveUser(userEntity);
                 conversation.getLastMessage().setActiveUser(userEntity);
                 String text;
                 String text;
-                if (conversation.getLastMessage().getMessageType() == ChatMessage.MessageType.REGULAR_TEXT_MESSAGE) {
+                if (conversation.getLastMessage().getCalculateMessageType() == ChatMessage.MessageType.REGULAR_TEXT_MESSAGE) {
                     if (conversation.getLastMessage().getActorId().equals(userEntity.getUserId())) {
                     if (conversation.getLastMessage().getActorId().equals(userEntity.getUserId())) {
                         text = String.format(appContext.getString(R.string.nc_formatted_message_you),
                         text = String.format(appContext.getString(R.string.nc_formatted_message_you),
                                              conversation.getLastMessage().getLastMessageDisplayText());
                                              conversation.getLastMessage().getLastMessageDisplayText());

+ 9 - 9
app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt

@@ -113,11 +113,11 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess
     }
     }
 
 
     private fun setAvatarAndAuthorOnMessageItem(message: ChatMessage) {
     private fun setAvatarAndAuthorOnMessageItem(message: ChatMessage) {
-        val author: String = message.actorDisplayName
+        val author: String = message.actorDisplayName!!
         if (!TextUtils.isEmpty(author)) {
         if (!TextUtils.isEmpty(author)) {
             binding.messageAuthor.text = author
             binding.messageAuthor.text = author
             binding.messageUserAvatar.setOnClickListener {
             binding.messageUserAvatar.setOnClickListener {
-                (payload as? ProfileBottomSheet)?.showFor(message.actorId, itemView.context)
+                (payload as? ProfileBottomSheet)?.showFor(message.actorId!!, itemView.context)
             }
             }
         } else {
         } else {
             binding.messageAuthor.setText(R.string.nc_nick_guest)
             binding.messageAuthor.setText(R.string.nc_nick_guest)
@@ -180,13 +180,13 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess
     private fun setParentMessageDataOnMessageItem(message: ChatMessage) {
     private fun setParentMessageDataOnMessageItem(message: ChatMessage) {
         if (!message.isDeleted && message.parentMessage != null) {
         if (!message.isDeleted && message.parentMessage != null) {
             val parentChatMessage = message.parentMessage
             val parentChatMessage = message.parentMessage
-            parentChatMessage.activeUser = message.activeUser
-            parentChatMessage.imageUrl?.let {
+            parentChatMessage!!.activeUser = message.activeUser
+            parentChatMessage!!.imageUrl?.let {
                 binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
                 binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
                 binding.messageQuote.quotedMessageImage.load(it) {
                 binding.messageQuote.quotedMessageImage.load(it) {
                     addHeader(
                     addHeader(
                         "Authorization",
                         "Authorization",
-                        ApiUtils.getCredentials(message.activeUser.username, message.activeUser.token)
+                        ApiUtils.getCredentials(message.activeUser!!.username, message.activeUser!!.token)
                     )
                     )
                 }
                 }
             } ?: run {
             } ?: run {
@@ -199,7 +199,7 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess
             binding.messageQuote.quotedMessageAuthor
             binding.messageQuote.quotedMessageAuthor
                 .setTextColor(context!!.resources.getColor(R.color.textColorMaxContrast))
                 .setTextColor(context!!.resources.getColor(R.color.textColorMaxContrast))
 
 
-            if (parentChatMessage.actorId?.equals(message.activeUser.userId) == true) {
+            if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) {
                 binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.colorPrimary)
                 binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.colorPrimary)
             } else {
             } else {
                 binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast)
                 binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast)
@@ -213,9 +213,9 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess
 
 
     @SuppressLint("SetJavaScriptEnabled", "ClickableViewAccessibility")
     @SuppressLint("SetJavaScriptEnabled", "ClickableViewAccessibility")
     private fun setLocationDataOnMessageItem(message: ChatMessage) {
     private fun setLocationDataOnMessageItem(message: ChatMessage) {
-        if (message.messageParameters != null && message.messageParameters.size > 0) {
-            for (key in message.messageParameters.keys) {
-                val individualHashMap: Map<String, String> = message.messageParameters[key]!!
+        if (message.messageParameters != null && message.messageParameters!!.size > 0) {
+            for (key in message.messageParameters!!.keys) {
+                val individualHashMap: Map<String?, String?> = message.messageParameters!![key]!!
                 if (individualHashMap["type"] == "geo-location") {
                 if (individualHashMap["type"] == "geo-location") {
                     locationLon = individualHashMap["longitude"]
                     locationLon = individualHashMap["longitude"]
                     locationLat = individualHashMap["latitude"]
                     locationLat = individualHashMap["latitude"]

+ 7 - 7
app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt

@@ -154,7 +154,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message
 
 
     private fun updateDownloadState(message: ChatMessage) {
     private fun updateDownloadState(message: ChatMessage) {
         // check if download worker is already running
         // check if download worker is already running
-        val fileId = message.getSelectedIndividualHashMap()["id"]
+        val fileId = message.selectedIndividualHashMap!!["id"]
         val workers = WorkManager.getInstance(context!!).getWorkInfosByTag(fileId!!)
         val workers = WorkManager.getInstance(context!!).getWorkInfosByTag(fileId!!)
 
 
         try {
         try {
@@ -206,11 +206,11 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message
     }
     }
 
 
     private fun setAvatarAndAuthorOnMessageItem(message: ChatMessage) {
     private fun setAvatarAndAuthorOnMessageItem(message: ChatMessage) {
-        val author: String = message.actorDisplayName
+        val author: String = message.actorDisplayName!!
         if (!TextUtils.isEmpty(author)) {
         if (!TextUtils.isEmpty(author)) {
             binding.messageAuthor.text = author
             binding.messageAuthor.text = author
             binding.messageUserAvatar.setOnClickListener {
             binding.messageUserAvatar.setOnClickListener {
-                (payload as? ProfileBottomSheet)?.showFor(message.actorId, itemView.context)
+                (payload as? ProfileBottomSheet)?.showFor(message.actorId!!, itemView.context)
             }
             }
         } else {
         } else {
             binding.messageAuthor.setText(R.string.nc_nick_guest)
             binding.messageAuthor.setText(R.string.nc_nick_guest)
@@ -281,13 +281,13 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message
     private fun setParentMessageDataOnMessageItem(message: ChatMessage) {
     private fun setParentMessageDataOnMessageItem(message: ChatMessage) {
         if (!message.isDeleted && message.parentMessage != null) {
         if (!message.isDeleted && message.parentMessage != null) {
             val parentChatMessage = message.parentMessage
             val parentChatMessage = message.parentMessage
-            parentChatMessage.activeUser = message.activeUser
-            parentChatMessage.imageUrl?.let {
+            parentChatMessage!!.activeUser = message.activeUser
+            parentChatMessage!!.imageUrl?.let {
                 binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
                 binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
                 binding.messageQuote.quotedMessageImage.load(it) {
                 binding.messageQuote.quotedMessageImage.load(it) {
                     addHeader(
                     addHeader(
                         "Authorization",
                         "Authorization",
-                        ApiUtils.getCredentials(message.activeUser.username, message.activeUser.token)
+                        ApiUtils.getCredentials(message.activeUser!!.username, message.activeUser!!.token)
                     )
                     )
                 }
                 }
             } ?: run {
             } ?: run {
@@ -300,7 +300,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message
             binding.messageQuote.quotedMessageAuthor
             binding.messageQuote.quotedMessageAuthor
                 .setTextColor(ContextCompat.getColor(context!!, R.color.textColorMaxContrast))
                 .setTextColor(ContextCompat.getColor(context!!, R.color.textColorMaxContrast))
 
 
-            if (parentChatMessage.actorId?.equals(message.activeUser.userId) == true) {
+            if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) {
                 binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.colorPrimary)
                 binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.colorPrimary)
             } else {
             } else {
                 binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast)
                 binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast)

+ 7 - 7
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt

@@ -120,7 +120,7 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
             binding.messageQuote.quotedChatMessageView.visibility = View.GONE
             binding.messageQuote.quotedChatMessageView.visibility = View.GONE
         }
         }
 
 
-        itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.isReplyable)
+        itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.replyable)
 
 
         Reaction().showReactions(message, binding.reactions, binding.messageText.context, false)
         Reaction().showReactions(message, binding.reactions, binding.messageText.context, false)
         binding.reactions.reactionsEmojiWrapper.setOnClickListener {
         binding.reactions.reactionsEmojiWrapper.setOnClickListener {
@@ -136,7 +136,7 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
         if (!TextUtils.isEmpty(message.actorDisplayName)) {
         if (!TextUtils.isEmpty(message.actorDisplayName)) {
             binding.messageAuthor.text = message.actorDisplayName
             binding.messageAuthor.text = message.actorDisplayName
             binding.messageUserAvatar.setOnClickListener {
             binding.messageUserAvatar.setOnClickListener {
-                (payload as? ProfileBottomSheet)?.showFor(message.actorId, itemView.context)
+                (payload as? ProfileBottomSheet)?.showFor(message.actorId!!, itemView.context)
             }
             }
         } else {
         } else {
             binding.messageAuthor.setText(R.string.nc_nick_guest)
             binding.messageAuthor.setText(R.string.nc_nick_guest)
@@ -169,13 +169,13 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
 
 
     private fun processParentMessage(message: ChatMessage) {
     private fun processParentMessage(message: ChatMessage) {
         val parentChatMessage = message.parentMessage
         val parentChatMessage = message.parentMessage
-        parentChatMessage.activeUser = message.activeUser
+        parentChatMessage!!.activeUser = message.activeUser
         parentChatMessage.imageUrl?.let {
         parentChatMessage.imageUrl?.let {
             binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
             binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
             binding.messageQuote.quotedMessageImage.load(it) {
             binding.messageQuote.quotedMessageImage.load(it) {
                 addHeader(
                 addHeader(
                     "Authorization",
                     "Authorization",
-                    ApiUtils.getCredentials(message.activeUser.username, message.activeUser.token)
+                    ApiUtils.getCredentials(message.activeUser!!.username, message.activeUser!!.token)
                 )
                 )
             }
             }
         } ?: run {
         } ?: run {
@@ -188,7 +188,7 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
         binding.messageQuote.quotedMessageAuthor
         binding.messageQuote.quotedMessageAuthor
             .setTextColor(ContextCompat.getColor(context!!, R.color.textColorMaxContrast))
             .setTextColor(ContextCompat.getColor(context!!, R.color.textColorMaxContrast))
 
 
-        if (parentChatMessage.actorId?.equals(message.activeUser.userId) == true) {
+        if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) {
             binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.colorPrimary)
             binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.colorPrimary)
         } else {
         } else {
             binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast)
             binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast)
@@ -226,13 +226,13 @@ class MagicIncomingTextMessageViewHolder(itemView: View, payload: Any) : Message
     }
     }
 
 
     private fun processMessageParameters(
     private fun processMessageParameters(
-        messageParameters: HashMap<String, HashMap<String, String>>,
+        messageParameters: HashMap<String?, HashMap<String?, String?>>,
         message: ChatMessage,
         message: ChatMessage,
         messageString: Spannable
         messageString: Spannable
     ): Spannable {
     ): Spannable {
         var messageStringInternal = messageString
         var messageStringInternal = messageString
         for (key in messageParameters.keys) {
         for (key in messageParameters.keys) {
-            val individualHashMap = message.messageParameters[key]
+            val individualHashMap = message.messageParameters!![key]
             if (individualHashMap != null) {
             if (individualHashMap != null) {
                 if (
                 if (
                     individualHashMap["type"] == "user" ||
                     individualHashMap["type"] == "user" ||

+ 6 - 6
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicOutcomingTextMessageViewHolder.kt

@@ -66,7 +66,7 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
     override fun onBind(message: ChatMessage) {
     override fun onBind(message: ChatMessage) {
         super.onBind(message)
         super.onBind(message)
         sharedApplication!!.componentApplication.inject(this)
         sharedApplication!!.componentApplication.inject(this)
-        val messageParameters: HashMap<String, HashMap<String, String>>? = message.messageParameters
+        val messageParameters: HashMap<String?, HashMap<String?, String?>>? = message.messageParameters
         var messageString: Spannable = SpannableString(message.text)
         var messageString: Spannable = SpannableString(message.text)
         realView.isSelected = false
         realView.isSelected = false
         binding.messageTime.setTextColor(context!!.resources.getColor(R.color.white60))
         binding.messageTime.setTextColor(context!!.resources.getColor(R.color.white60))
@@ -119,7 +119,7 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
 
 
         binding.checkMark.setContentDescription(readStatusContentDescriptionString)
         binding.checkMark.setContentDescription(readStatusContentDescriptionString)
 
 
-        itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.isReplyable)
+        itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.replyable)
 
 
         Reaction().showReactions(message, binding.reactions, context!!, true)
         Reaction().showReactions(message, binding.reactions, context!!, true)
         binding.reactions.reactionsEmojiWrapper.setOnClickListener {
         binding.reactions.reactionsEmojiWrapper.setOnClickListener {
@@ -133,13 +133,13 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
 
 
     private fun processParentMessage(message: ChatMessage) {
     private fun processParentMessage(message: ChatMessage) {
         val parentChatMessage = message.parentMessage
         val parentChatMessage = message.parentMessage
-        parentChatMessage.activeUser = message.activeUser
+        parentChatMessage!!.activeUser = message.activeUser
         parentChatMessage.imageUrl?.let {
         parentChatMessage.imageUrl?.let {
             binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
             binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
             binding.messageQuote.quotedMessageImage.load(it) {
             binding.messageQuote.quotedMessageImage.load(it) {
                 addHeader(
                 addHeader(
                     "Authorization",
                     "Authorization",
-                    ApiUtils.getCredentials(message.activeUser.username, message.activeUser.token)
+                    ApiUtils.getCredentials(message.activeUser!!.username, message.activeUser!!.token)
                 )
                 )
             }
             }
         } ?: run {
         } ?: run {
@@ -183,13 +183,13 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
     }
     }
 
 
     private fun processMessageParameters(
     private fun processMessageParameters(
-        messageParameters: HashMap<String, HashMap<String, String>>,
+        messageParameters: HashMap<String?, HashMap<String?, String?>>,
         message: ChatMessage,
         message: ChatMessage,
         messageString: Spannable
         messageString: Spannable
     ): Spannable {
     ): Spannable {
         var messageString1 = messageString
         var messageString1 = messageString
         for (key in messageParameters.keys) {
         for (key in messageParameters.keys) {
-            val individualHashMap: HashMap<String, String>? = message.messageParameters[key]
+            val individualHashMap: HashMap<String?, String?>? = message.messageParameters!![key]
             if (individualHashMap != null) {
             if (individualHashMap != null) {
                 if (individualHashMap["type"] == "user" ||
                 if (individualHashMap["type"] == "user" ||
                     individualHashMap["type"] == "guest" ||
                     individualHashMap["type"] == "guest" ||

+ 15 - 12
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java

@@ -116,8 +116,8 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
     public void onBind(ChatMessage message) {
     public void onBind(ChatMessage message) {
         super.onBind(message);
         super.onBind(message);
         if (userAvatar != null) {
         if (userAvatar != null) {
-            if (message.isGrouped || message.isOneToOneConversation) {
-                if (message.isOneToOneConversation) {
+            if (message.isGrouped() || message.isOneToOneConversation()) {
+                if (message.isOneToOneConversation()) {
                     userAvatar.setVisibility(View.GONE);
                     userAvatar.setVisibility(View.GONE);
                 } else {
                 } else {
                     userAvatar.setVisibility(View.INVISIBLE);
                     userAvatar.setVisibility(View.INVISIBLE);
@@ -126,11 +126,11 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
                 userAvatar.setVisibility(View.VISIBLE);
                 userAvatar.setVisibility(View.VISIBLE);
                 userAvatar.setOnClickListener(v -> {
                 userAvatar.setOnClickListener(v -> {
                     if (payload instanceof ProfileBottomSheet) {
                     if (payload instanceof ProfileBottomSheet) {
-                        ((ProfileBottomSheet) payload).showFor(message.actorId, v.getContext());
+                        ((ProfileBottomSheet) payload).showFor(message.getActorId(), v.getContext());
                     }
                     }
                 });
                 });
 
 
-                if (ACTOR_TYPE_BOTS.equals(message.actorType) && ACTOR_ID_CHANGELOG.equals(message.actorId)) {
+                if (ACTOR_TYPE_BOTS.equals(message.getActorType()) && ACTOR_ID_CHANGELOG.equals(message.getActorId())) {
                     if (context != null) {
                     if (context != null) {
                         Drawable[] layers = new Drawable[2];
                         Drawable[] layers = new Drawable[2];
                         layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background);
                         layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background);
@@ -148,9 +148,9 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
         clickView = getImage();
         clickView = getImage();
         getMessageText().setVisibility(View.VISIBLE);
         getMessageText().setVisibility(View.VISIBLE);
 
 
-        if (message.getMessageType() == ChatMessage.MessageType.SINGLE_NC_ATTACHMENT_MESSAGE) {
+        if (message.getCalculateMessageType() == ChatMessage.MessageType.SINGLE_NC_ATTACHMENT_MESSAGE) {
 
 
-            fileViewerUtils = new FileViewerUtils(context, message.activeUser);
+            fileViewerUtils = new FileViewerUtils(context, message.getActiveUser());
 
 
             String fileName = message.getSelectedIndividualHashMap().get(KEY_NAME);
             String fileName = message.getSelectedIndividualHashMap().get(KEY_NAME);
             getMessageText().setText(fileName);
             getMessageText().setText(fileName);
@@ -177,10 +177,13 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
                 Drawable drawable = ContextCompat.getDrawable(context, drawableResourceId);
                 Drawable drawable = ContextCompat.getDrawable(context, drawableResourceId);
                 image.getHierarchy().setPlaceholderImage(drawable);
                 image.getHierarchy().setPlaceholderImage(drawable);
             } else {
             } else {
-                fetchFileInformation("/" + message.getSelectedIndividualHashMap().get(KEY_PATH), message.activeUser);
+                fetchFileInformation("/" + message.getSelectedIndividualHashMap().get(KEY_PATH),
+                                     message.getActiveUser());
             }
             }
 
 
-            if (message.activeUser != null && message.activeUser.getUsername() != null && message.activeUser.getBaseUrl() != null) {
+            if (message.getActiveUser() != null &&
+                message.getActiveUser().getUsername() != null &&
+                message.getActiveUser().getBaseUrl() != null) {
                 clickView.setOnClickListener(v ->
                 clickView.setOnClickListener(v ->
                     fileViewerUtils.openFile(
                     fileViewerUtils.openFile(
                         message,
                         message,
@@ -202,10 +205,10 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
                 message.getSelectedIndividualHashMap().get(MagicPreviewMessageViewHolder.KEY_MIMETYPE),
                 message.getSelectedIndividualHashMap().get(MagicPreviewMessageViewHolder.KEY_MIMETYPE),
                 new FileViewerUtils.ProgressUi(progressBar, getMessageText(), image));
                 new FileViewerUtils.ProgressUi(progressBar, getMessageText(), image));
 
 
-        } else if (message.getMessageType() == ChatMessage.MessageType.SINGLE_LINK_GIPHY_MESSAGE) {
+        } else if (message.getCalculateMessageType() == ChatMessage.MessageType.SINGLE_LINK_GIPHY_MESSAGE) {
             getMessageText().setText("GIPHY");
             getMessageText().setText("GIPHY");
             DisplayUtils.setClickableString("GIPHY", "https://giphy.com", getMessageText());
             DisplayUtils.setClickableString("GIPHY", "https://giphy.com", getMessageText());
-        } else if (message.getMessageType() == ChatMessage.MessageType.SINGLE_LINK_TENOR_MESSAGE) {
+        } else if (message.getCalculateMessageType() == ChatMessage.MessageType.SINGLE_LINK_TENOR_MESSAGE) {
             getMessageText().setText("Tenor");
             getMessageText().setText("Tenor");
             DisplayUtils.setClickableString("Tenor", "https://tenor.com", getMessageText());
             DisplayUtils.setClickableString("Tenor", "https://tenor.com", getMessageText());
         } else {
         } else {
@@ -221,7 +224,7 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
             getMessageText().setText("");
             getMessageText().setText("");
         }
         }
 
 
-        itemView.setTag(REPLYABLE_VIEW_TAG, message.isReplyable());
+        itemView.setTag(REPLYABLE_VIEW_TAG, message.getReplyable());
 
 
         reactionsBinding = getReactionsBinding();
         reactionsBinding = getReactionsBinding();
         new Reaction().showReactions(message, reactionsBinding, getMessageText().getContext(), true);
         new Reaction().showReactions(message, reactionsBinding, getMessageText().getContext(), true);
@@ -307,7 +310,7 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
                             new Handler(context.getMainLooper()).post(() -> {
                             new Handler(context.getMainLooper()).post(() -> {
                                 int resourceId = DrawableUtils
                                 int resourceId = DrawableUtils
                                     .INSTANCE
                                     .INSTANCE
-                                    .getDrawableResourceIdForMimeType(browserFileList.get(0).mimeType);
+                                    .getDrawableResourceIdForMimeType(browserFileList.get(0).getMimeType());
                                 Drawable drawable = ContextCompat.getDrawable(context, resourceId);
                                 Drawable drawable = ContextCompat.getDrawable(context, resourceId);
                                 image.getHierarchy().setPlaceholderImage(drawable);
                                 image.getHierarchy().setPlaceholderImage(drawable);
                             });
                             });

+ 4 - 4
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicSystemMessageViewHolder.java

@@ -76,9 +76,9 @@ public class MagicSystemMessageViewHolder extends MessageHolders.IncomingTextMes
 
 
         Spannable messageString = new SpannableString(message.getText());
         Spannable messageString = new SpannableString(message.getText());
 
 
-        if (message.messageParameters != null && message.messageParameters.size() > 0) {
-            for (String key : message.messageParameters.keySet()) {
-                Map<String, String> individualMap = message.messageParameters.get(key);
+        if (message.getMessageParameters() != null && message.getMessageParameters().size() > 0) {
+            for (String key : message.getMessageParameters().keySet()) {
+                Map<String, String> individualMap = message.getMessageParameters().get(key);
 
 
                 if (individualMap != null && individualMap.containsKey("name")) {
                 if (individualMap != null && individualMap.containsKey("name")) {
                     String searchText;
                     String searchText;
@@ -97,6 +97,6 @@ public class MagicSystemMessageViewHolder extends MessageHolders.IncomingTextMes
 
 
         text.setText(messageString);
         text.setText(messageString);
 
 
-        itemView.setTag(REPLYABLE_VIEW_TAG, message.isReplyable());
+        itemView.setTag(REPLYABLE_VIEW_TAG, message.getReplyable());
     }
     }
 }
 }

+ 5 - 5
app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLocationMessageViewHolder.kt

@@ -126,9 +126,9 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders
 
 
     @SuppressLint("SetJavaScriptEnabled", "ClickableViewAccessibility")
     @SuppressLint("SetJavaScriptEnabled", "ClickableViewAccessibility")
     private fun setLocationDataOnMessageItem(message: ChatMessage) {
     private fun setLocationDataOnMessageItem(message: ChatMessage) {
-        if (message.messageParameters != null && message.messageParameters.size > 0) {
-            for (key in message.messageParameters.keys) {
-                val individualHashMap: Map<String, String> = message.messageParameters[key]!!
+        if (message.messageParameters != null && message.messageParameters!!.size > 0) {
+            for (key in message.messageParameters!!.keys) {
+                val individualHashMap: Map<String?, String?> = message.messageParameters!![key]!!
                 if (individualHashMap["type"] == "geo-location") {
                 if (individualHashMap["type"] == "geo-location") {
                     locationLon = individualHashMap["longitude"]
                     locationLon = individualHashMap["longitude"]
                     locationLat = individualHashMap["latitude"]
                     locationLat = individualHashMap["latitude"]
@@ -185,13 +185,13 @@ class OutcomingLocationMessageViewHolder(incomingView: View) : MessageHolders
     private fun setParentMessageDataOnMessageItem(message: ChatMessage) {
     private fun setParentMessageDataOnMessageItem(message: ChatMessage) {
         if (!message.isDeleted && message.parentMessage != null) {
         if (!message.isDeleted && message.parentMessage != null) {
             val parentChatMessage = message.parentMessage
             val parentChatMessage = message.parentMessage
-            parentChatMessage.activeUser = message.activeUser
+            parentChatMessage!!.activeUser = message.activeUser
             parentChatMessage.imageUrl?.let {
             parentChatMessage.imageUrl?.let {
                 binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
                 binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
                 binding.messageQuote.quotedMessageImage.load(it) {
                 binding.messageQuote.quotedMessageImage.load(it) {
                     addHeader(
                     addHeader(
                         "Authorization",
                         "Authorization",
-                        ApiUtils.getCredentials(message.activeUser.username, message.activeUser.token)
+                        ApiUtils.getCredentials(message.activeUser!!.username, message.activeUser!!.token)
                     )
                     )
                 }
                 }
             } ?: run {
             } ?: run {

+ 3 - 3
app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt

@@ -180,7 +180,7 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders
 
 
     private fun updateDownloadState(message: ChatMessage) {
     private fun updateDownloadState(message: ChatMessage) {
         // check if download worker is already running
         // check if download worker is already running
-        val fileId = message.getSelectedIndividualHashMap()["id"]
+        val fileId = message.selectedIndividualHashMap!!["id"]
         val workers = WorkManager.getInstance(context!!).getWorkInfosByTag(fileId!!)
         val workers = WorkManager.getInstance(context!!).getWorkInfosByTag(fileId!!)
 
 
         try {
         try {
@@ -235,13 +235,13 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders
     private fun setParentMessageDataOnMessageItem(message: ChatMessage) {
     private fun setParentMessageDataOnMessageItem(message: ChatMessage) {
         if (!message.isDeleted && message.parentMessage != null) {
         if (!message.isDeleted && message.parentMessage != null) {
             val parentChatMessage = message.parentMessage
             val parentChatMessage = message.parentMessage
-            parentChatMessage.activeUser = message.activeUser
+            parentChatMessage!!.activeUser = message.activeUser
             parentChatMessage.imageUrl?.let {
             parentChatMessage.imageUrl?.let {
                 binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
                 binding.messageQuote.quotedMessageImage.visibility = View.VISIBLE
                 binding.messageQuote.quotedMessageImage.load(it) {
                 binding.messageQuote.quotedMessageImage.load(it) {
                     addHeader(
                     addHeader(
                         "Authorization",
                         "Authorization",
-                        ApiUtils.getCredentials(message.activeUser.username, message.activeUser.token)
+                        ApiUtils.getCredentials(message.activeUser!!.username, message.activeUser!!.token)
                     )
                     )
                 }
                 }
             } ?: run {
             } ?: run {

+ 5 - 5
app/src/main/java/com/nextcloud/talk/adapters/messages/Reaction.kt

@@ -44,10 +44,10 @@ class Reaction {
         isOutgoingMessage: Boolean
         isOutgoingMessage: Boolean
     ) {
     ) {
         binding.reactionsEmojiWrapper.removeAllViews()
         binding.reactionsEmojiWrapper.removeAllViews()
-        if (message.reactions != null && message.reactions.isNotEmpty()) {
+        if (message.reactions != null && message.reactions!!.isNotEmpty()) {
 
 
             var remainingEmojisToDisplay = MAX_EMOJIS_TO_DISPLAY
             var remainingEmojisToDisplay = MAX_EMOJIS_TO_DISPLAY
-            val showInfoAboutMoreEmojis = message.reactions.size > MAX_EMOJIS_TO_DISPLAY
+            val showInfoAboutMoreEmojis = message.reactions!!.size > MAX_EMOJIS_TO_DISPLAY
 
 
             val textColor = getTextColor(context, isOutgoingMessage, binding)
             val textColor = getTextColor(context, isOutgoingMessage, binding)
             val amountParams = getAmountLayoutParams(context)
             val amountParams = getAmountLayoutParams(context)
@@ -57,7 +57,7 @@ class Reaction {
             val paddingTop = DisplayUtils.convertDpToPixel(WRAPPER_PADDING_TOP, context).toInt()
             val paddingTop = DisplayUtils.convertDpToPixel(WRAPPER_PADDING_TOP, context).toInt()
             val paddingBottom = DisplayUtils.convertDpToPixel(WRAPPER_PADDING_BOTTOM, context).toInt()
             val paddingBottom = DisplayUtils.convertDpToPixel(WRAPPER_PADDING_BOTTOM, context).toInt()
 
 
-            for ((emoji, amount) in message.reactions) {
+            for ((emoji, amount) in message.reactions!!) {
                 val emojiWithAmountWrapper = getEmojiWithAmountWrapperLayout(
                 val emojiWithAmountWrapper = getEmojiWithAmountWrapperLayout(
                     context,
                     context,
                     message,
                     message,
@@ -99,8 +99,8 @@ class Reaction {
         emojiWithAmountWrapper.layoutParams = layoutInfo.wrapperParams
         emojiWithAmountWrapper.layoutParams = layoutInfo.wrapperParams
 
 
         if (message.reactionsSelf != null &&
         if (message.reactionsSelf != null &&
-            message.reactionsSelf.isNotEmpty() &&
-            message.reactionsSelf.contains(emoji)
+            message.reactionsSelf!!.isNotEmpty() &&
+            message.reactionsSelf!!.contains(emoji)
         ) {
         ) {
             emojiWithAmountWrapper.background =
             emojiWithAmountWrapper.background =
                 AppCompatResources.getDrawable(context, R.drawable.reaction_self_background)
                 AppCompatResources.getDrawable(context, R.drawable.reaction_self_background)

+ 2 - 2
app/src/main/java/com/nextcloud/talk/components/filebrowser/adapters/items/BrowserFileItem.java

@@ -129,7 +129,7 @@ public class BrowserFileItem extends AbstractFlexibleItem<BrowserFileItem.Browse
         }
         }
 
 
         if (selectionInterface.shouldOnlySelectOneImageFile()) {
         if (selectionInterface.shouldOnlySelectOneImageFile()) {
-            if (browserFile.isFile && browserFile.mimeType.startsWith("image/")) {
+            if (browserFile.isFile() && browserFile.getMimeType().startsWith("image/")) {
                 holder.binding.selectFileCheckbox.setVisibility(View.VISIBLE);
                 holder.binding.selectFileCheckbox.setVisibility(View.VISIBLE);
             } else {
             } else {
                 holder.binding.selectFileCheckbox.setVisibility(View.GONE);
                 holder.binding.selectFileCheckbox.setVisibility(View.GONE);
@@ -148,7 +148,7 @@ public class BrowserFileItem extends AbstractFlexibleItem<BrowserFileItem.Browse
                         context, DrawableUtils.INSTANCE.getDrawableResourceIdForMimeType(browserFile.getMimeType())));
                         context, DrawableUtils.INSTANCE.getDrawableResourceIdForMimeType(browserFile.getMimeType())));
         }
         }
 
 
-        if (browserFile.isHasPreview()) {
+        if (browserFile.getHasPreview()) {
             String path = ApiUtils.getUrlForFilePreviewWithRemotePath(activeUser.getBaseUrl(),
             String path = ApiUtils.getUrlForFilePreviewWithRemotePath(activeUser.getBaseUrl(),
                     browserFile.getPath(),
                     browserFile.getPath(),
                     context.getResources().getDimensionPixelSize(R.dimen.small_item_height));
                     context.getResources().getDimensionPixelSize(R.dimen.small_item_height));

+ 7 - 6
app/src/main/java/com/nextcloud/talk/components/filebrowser/controllers/BrowserController.kt

@@ -23,6 +23,7 @@ package com.nextcloud.talk.components.filebrowser.controllers
 
 
 import android.annotation.SuppressLint
 import android.annotation.SuppressLint
 import android.os.Bundle
 import android.os.Bundle
+import android.os.Parcelable
 import android.util.Log
 import android.util.Log
 import android.view.Menu
 import android.view.Menu
 import android.view.MenuInflater
 import android.view.MenuInflater
@@ -55,9 +56,9 @@ import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_USER_ENTITY
 import com.nextcloud.talk.utils.database.user.UserUtils
 import com.nextcloud.talk.utils.database.user.UserUtils
 import eu.davidea.flexibleadapter.FlexibleAdapter
 import eu.davidea.flexibleadapter.FlexibleAdapter
 import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager
 import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager
+import kotlinx.android.parcel.Parcelize
 import net.orange_box.storebox.listeners.OnPreferenceValueChangedListener
 import net.orange_box.storebox.listeners.OnPreferenceValueChangedListener
 import okhttp3.OkHttpClient
 import okhttp3.OkHttpClient
-import org.parceler.Parcel
 import org.parceler.Parcels
 import org.parceler.Parcels
 import java.io.File
 import java.io.File
 import java.util.ArrayList
 import java.util.ArrayList
@@ -198,7 +199,7 @@ abstract class BrowserController(args: Bundle) :
         recyclerViewItems = ArrayList()
         recyclerViewItems = ArrayList()
         if (davResponse.getData() != null) {
         if (davResponse.getData() != null) {
             val objectList = davResponse.getData() as List<BrowserFile>
             val objectList = davResponse.getData() as List<BrowserFile>
-            currentPath = objectList[0].getPath()
+            currentPath = objectList[0].path!!
             if (activity != null) {
             if (activity != null) {
                 activity!!.runOnUiThread { setTitle() }
                 activity!!.runOnUiThread { setTitle() }
             }
             }
@@ -256,8 +257,8 @@ abstract class BrowserController(args: Bundle) :
 
 
     override fun onItemClick(view: View, position: Int): Boolean {
     override fun onItemClick(view: View, position: Int): Boolean {
         val browserFile = (adapter!!.getItem(position) as BrowserFileItem).model
         val browserFile = (adapter!!.getItem(position) as BrowserFileItem).model
-        if ("inode/directory" == browserFile.getMimeType()) {
-            fetchPath(browserFile.getPath())
+        if ("inode/directory" == browserFile.mimeType) {
+            fetchPath(browserFile.path!!)
             return true
             return true
         }
         }
         return false
         return false
@@ -294,8 +295,8 @@ abstract class BrowserController(args: Bundle) :
 
 
     abstract override fun shouldOnlySelectOneImageFile(): Boolean
     abstract override fun shouldOnlySelectOneImageFile(): Boolean
 
 
-    @Parcel
-    enum class BrowserType {
+    @Parcelize
+    enum class BrowserType : Parcelable {
         FILE_BROWSER, DAV_BROWSER
         FILE_BROWSER, DAV_BROWSER
     }
     }
 
 

+ 0 - 309
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/BrowserFile.java

@@ -1,309 +0,0 @@
-/*
- * 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.components.filebrowser.models;
-
-import android.net.Uri;
-import android.text.TextUtils;
-
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.components.filebrowser.models.properties.NCEncrypted;
-import com.nextcloud.talk.components.filebrowser.models.properties.NCPermission;
-import com.nextcloud.talk.components.filebrowser.models.properties.NCPreview;
-import com.nextcloud.talk.components.filebrowser.models.properties.OCFavorite;
-import com.nextcloud.talk.components.filebrowser.models.properties.OCId;
-import com.nextcloud.talk.components.filebrowser.models.properties.OCSize;
-
-import org.parceler.Parcel;
-
-import java.io.File;
-import java.util.List;
-
-import at.bitfire.dav4jvm.Property;
-import at.bitfire.dav4jvm.Response;
-import at.bitfire.dav4jvm.property.DisplayName;
-import at.bitfire.dav4jvm.property.GetContentType;
-import at.bitfire.dav4jvm.property.GetLastModified;
-import at.bitfire.dav4jvm.property.ResourceType;
-
-@JsonObject
-@Parcel
-public class BrowserFile {
-    public String path;
-    public String displayName;
-    public String mimeType;
-    public long modifiedTimestamp;
-    public long size;
-    public boolean isFile;
-    // Used for remote files
-    public String remoteId;
-    public boolean hasPreview;
-    public boolean favorite;
-    public boolean encrypted;
-    public String permissions;
-    private boolean isAllowedToReShare = false;
-
-    public static BrowserFile getModelFromResponse(Response response, String remotePath) {
-        BrowserFile browserFile = new BrowserFile();
-        browserFile.setPath(Uri.decode(remotePath));
-        browserFile.setDisplayName(Uri.decode(new File(remotePath).getName()));
-        final List<Property> properties = response.getProperties();
-
-        for (Property property : properties) {
-            if (property instanceof OCId) {
-                browserFile.setRemoteId(((OCId) property).getOcId());
-            }
-
-            if (property instanceof ResourceType) {
-                browserFile.isFile =
-                    !(((ResourceType) property).getTypes().contains(ResourceType.Companion.getCOLLECTION()));
-            }
-
-            if (property instanceof GetLastModified) {
-                browserFile.setModifiedTimestamp(((GetLastModified) property).getLastModified());
-            }
-
-            if (property instanceof GetContentType) {
-                browserFile.setMimeType(((GetContentType) property).getType());
-            }
-
-            if (property instanceof OCSize) {
-                browserFile.setSize(((OCSize) property).getOcSize());
-            }
-
-            if (property instanceof NCPreview) {
-                browserFile.setHasPreview(((NCPreview) property).isNcPreview());
-            }
-
-            if (property instanceof OCFavorite) {
-                browserFile.setFavorite(((OCFavorite) property).isOcFavorite());
-            }
-
-            if (property instanceof DisplayName) {
-                browserFile.setDisplayName(((DisplayName) property).getDisplayName());
-            }
-
-            if (property instanceof NCEncrypted) {
-                browserFile.setEncrypted(((NCEncrypted) property).isNcEncrypted());
-            }
-
-            if (property instanceof NCPermission) {
-                browserFile.setPermissions(((NCPermission) property).getNcPermission());
-            }
-        }
-
-        if (browserFile.getPermissions() != null && browserFile.getPermissions().contains("R")) {
-            browserFile.isAllowedToReShare = true;
-        }
-
-        if (TextUtils.isEmpty(browserFile.getMimeType()) && !browserFile.isFile()) {
-            browserFile.setMimeType("inode/directory");
-        }
-
-        return browserFile;
-    }
-
-    public String getPath() {
-        return this.path;
-    }
-
-    public String getDisplayName() {
-        return this.displayName;
-    }
-
-    public String getMimeType() {
-        return this.mimeType;
-    }
-
-    public long getModifiedTimestamp() {
-        return this.modifiedTimestamp;
-    }
-
-    public long getSize() {
-        return this.size;
-    }
-
-    public boolean isFile() {
-        return this.isFile;
-    }
-
-    public String getRemoteId() {
-        return this.remoteId;
-    }
-
-    public boolean isHasPreview() {
-        return this.hasPreview;
-    }
-
-    public boolean isFavorite() {
-        return this.favorite;
-    }
-
-    public boolean isEncrypted() {
-        return this.encrypted;
-    }
-
-    public String getPermissions() {
-        return this.permissions;
-    }
-
-    public boolean isAllowedToReShare() {
-        return this.isAllowedToReShare;
-    }
-
-    public void setPath(String path) {
-        this.path = path;
-    }
-
-    public void setDisplayName(String displayName) {
-        this.displayName = displayName;
-    }
-
-    public void setMimeType(String mimeType) {
-        this.mimeType = mimeType;
-    }
-
-    public void setModifiedTimestamp(long modifiedTimestamp) {
-        this.modifiedTimestamp = modifiedTimestamp;
-    }
-
-    public void setSize(long size) {
-        this.size = size;
-    }
-
-    public void setFile(boolean isFile) {
-        this.isFile = isFile;
-    }
-
-    public void setRemoteId(String remoteId) {
-        this.remoteId = remoteId;
-    }
-
-    public void setHasPreview(boolean hasPreview) {
-        this.hasPreview = hasPreview;
-    }
-
-    public void setFavorite(boolean favorite) {
-        this.favorite = favorite;
-    }
-
-    public void setEncrypted(boolean encrypted) {
-        this.encrypted = encrypted;
-    }
-
-    public void setPermissions(String permissions) {
-        this.permissions = permissions;
-    }
-
-    public void setAllowedToReShare(boolean isAllowedToReShare) {
-        this.isAllowedToReShare = isAllowedToReShare;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof BrowserFile)) {
-            return false;
-        }
-        final BrowserFile other = (BrowserFile) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$path = this.getPath();
-        final Object other$path = other.getPath();
-        if (this$path == null ? other$path != null : !this$path.equals(other$path)) {
-            return false;
-        }
-        final Object this$displayName = this.getDisplayName();
-        final Object other$displayName = other.getDisplayName();
-        if (this$displayName == null ? other$displayName != null : !this$displayName.equals(other$displayName)) {
-            return false;
-        }
-        final Object this$mimeType = this.getMimeType();
-        final Object other$mimeType = other.getMimeType();
-        if (this$mimeType == null ? other$mimeType != null : !this$mimeType.equals(other$mimeType)) {
-            return false;
-        }
-        if (this.getModifiedTimestamp() != other.getModifiedTimestamp()) {
-            return false;
-        }
-        if (this.getSize() != other.getSize()) {
-            return false;
-        }
-        if (this.isFile() != other.isFile()) {
-            return false;
-        }
-        final Object this$remoteId = this.getRemoteId();
-        final Object other$remoteId = other.getRemoteId();
-        if (this$remoteId == null ? other$remoteId != null : !this$remoteId.equals(other$remoteId)) {
-            return false;
-        }
-        if (this.isHasPreview() != other.isHasPreview()) {
-            return false;
-        }
-        if (this.isFavorite() != other.isFavorite()) {
-            return false;
-        }
-        if (this.isEncrypted() != other.isEncrypted()) {
-            return false;
-        }
-        final Object this$permissions = this.getPermissions();
-        final Object other$permissions = other.getPermissions();
-        if (this$permissions == null ? other$permissions != null : !this$permissions.equals(other$permissions)) {
-            return false;
-        }
-
-        return this.isAllowedToReShare() == other.isAllowedToReShare();
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof BrowserFile;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $path = this.getPath();
-        result = result * PRIME + ($path == null ? 43 : $path.hashCode());
-        final Object $displayName = this.getDisplayName();
-        result = result * PRIME + ($displayName == null ? 43 : $displayName.hashCode());
-        final Object $mimeType = this.getMimeType();
-        result = result * PRIME + ($mimeType == null ? 43 : $mimeType.hashCode());
-        final long $modifiedTimestamp = this.getModifiedTimestamp();
-        result = result * PRIME + (int) ($modifiedTimestamp >>> 32 ^ $modifiedTimestamp);
-        final long $size = this.getSize();
-        result = result * PRIME + (int) ($size >>> 32 ^ $size);
-        result = result * PRIME + (this.isFile() ? 79 : 97);
-        final Object $remoteId = this.getRemoteId();
-        result = result * PRIME + ($remoteId == null ? 43 : $remoteId.hashCode());
-        result = result * PRIME + (this.isHasPreview() ? 79 : 97);
-        result = result * PRIME + (this.isFavorite() ? 79 : 97);
-        result = result * PRIME + (this.isEncrypted() ? 79 : 97);
-        final Object $permissions = this.getPermissions();
-        result = result * PRIME + ($permissions == null ? 43 : $permissions.hashCode());
-        result = result * PRIME + (this.isAllowedToReShare() ? 79 : 97);
-        return result;
-    }
-
-    public String toString() {
-        return "BrowserFile(path=" + this.getPath() + ", displayName=" + this.getDisplayName() + ", mimeType=" + this.getMimeType() + ", modifiedTimestamp=" + this.getModifiedTimestamp() + ", size=" + this.getSize() + ", isFile=" + this.isFile() + ", remoteId=" + this.getRemoteId() + ", hasPreview=" + this.isHasPreview() + ", favorite=" + this.isFavorite() + ", encrypted=" + this.isEncrypted() + ", permissions=" + this.getPermissions() + ", isAllowedToReShare=" + this.isAllowedToReShare() + ")";
-    }
-}

+ 118 - 0
app/src/main/java/com/nextcloud/talk/components/filebrowser/models/BrowserFile.kt

@@ -0,0 +1,118 @@
+/*
+ * 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.components.filebrowser.models
+
+import android.net.Uri
+import android.os.Parcelable
+import android.text.TextUtils
+import at.bitfire.dav4jvm.Property
+import at.bitfire.dav4jvm.Response
+import at.bitfire.dav4jvm.property.DisplayName
+import at.bitfire.dav4jvm.property.GetContentType
+import at.bitfire.dav4jvm.property.GetLastModified
+import at.bitfire.dav4jvm.property.ResourceType
+import at.bitfire.dav4jvm.property.ResourceType.Companion.COLLECTION
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.components.filebrowser.models.properties.NCEncrypted
+import com.nextcloud.talk.components.filebrowser.models.properties.NCPermission
+import com.nextcloud.talk.components.filebrowser.models.properties.NCPreview
+import com.nextcloud.talk.components.filebrowser.models.properties.OCFavorite
+import com.nextcloud.talk.components.filebrowser.models.properties.OCId
+import com.nextcloud.talk.components.filebrowser.models.properties.OCSize
+import kotlinx.android.parcel.Parcelize
+import java.io.File
+
+@Parcelize
+@JsonObject
+data class BrowserFile(
+    var path: String? = null,
+    var displayName: String? = null,
+    var mimeType: String? = null,
+    var modifiedTimestamp: Long = 0,
+    var size: Long = 0,
+    var isFile: Boolean = false,
+
+    // Used for remote files
+    var remoteId: String? = null,
+    var hasPreview: Boolean = false,
+    var isFavorite: Boolean = false,
+    var isEncrypted: Boolean = false,
+    var permissions: String? = null,
+    var isAllowedToReShare: Boolean = false
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null, null, 0, 0, false, null, false, false, false, null, false)
+
+    companion object {
+        fun getModelFromResponse(response: Response, remotePath: String): BrowserFile {
+            val browserFile = BrowserFile()
+            browserFile.path = Uri.decode(remotePath)
+            browserFile.displayName = Uri.decode(File(remotePath).name)
+            val properties = response.properties
+            for (property in properties) {
+                mapPropertyToBrowserFile(property, browserFile)
+            }
+            if (browserFile.permissions != null && browserFile.permissions!!.contains("R")) {
+                browserFile.isAllowedToReShare = true
+            }
+            if (TextUtils.isEmpty(browserFile.mimeType) && !browserFile.isFile) {
+                browserFile.mimeType = "inode/directory"
+            }
+
+            return browserFile
+        }
+
+        @Suppress("Detekt.ComplexMethod")
+        private fun mapPropertyToBrowserFile(property: Property, browserFile: BrowserFile) {
+            when (property) {
+                is OCId -> {
+                    browserFile.remoteId = property.ocId
+                }
+                is ResourceType -> {
+                    browserFile.isFile = !property.types.contains(COLLECTION)
+                }
+                is GetLastModified -> {
+                    browserFile.modifiedTimestamp = property.lastModified
+                }
+                is GetContentType -> {
+                    browserFile.mimeType = property.type
+                }
+                is OCSize -> {
+                    browserFile.size = property.ocSize
+                }
+                is NCPreview -> {
+                    browserFile.hasPreview = property.isNcPreview
+                }
+                is OCFavorite -> {
+                    browserFile.isFavorite = property.isOcFavorite
+                }
+                is DisplayName -> {
+                    browserFile.displayName = property.displayName
+                }
+                is NCEncrypted -> {
+                    browserFile.isEncrypted = property.isNcEncrypted
+                }
+                is NCPermission -> {
+                    browserFile.permissions = property.ncPermission
+                }
+            }
+        }
+    }
+}

+ 2 - 2
app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java

@@ -94,10 +94,10 @@ public class ReadFilesystemOperation {
             Log.w("", "Error reading remote path");
             Log.w("", "Error reading remote path");
         }
         }
 
 
-        remoteFiles.add(BrowserFile.getModelFromResponse(rootElement[0],
+        remoteFiles.add(BrowserFile.Companion.getModelFromResponse(rootElement[0],
                 rootElement[0].getHref().toString().substring(basePath.length())));
                 rootElement[0].getHref().toString().substring(basePath.length())));
         for (Response memberElement : memberElements) {
         for (Response memberElement : memberElements) {
-            remoteFiles.add(BrowserFile.getModelFromResponse(memberElement,
+            remoteFiles.add(BrowserFile.Companion.getModelFromResponse(memberElement,
                     memberElement.getHref().toString().substring(basePath.length())));
                     memberElement.getHref().toString().substring(basePath.length())));
         }
         }
 
 

+ 39 - 39
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -336,10 +336,10 @@ class ChatController(args: Bundle) :
                     @Suppress("Detekt.TooGenericExceptionCaught")
                     @Suppress("Detekt.TooGenericExceptionCaught")
                     override fun onNext(roomOverall: RoomOverall) {
                     override fun onNext(roomOverall: RoomOverall) {
                         Log.d(TAG, "getRoomInfo - getRoom - got response: " + startNanoTime)
                         Log.d(TAG, "getRoomInfo - getRoom - got response: " + startNanoTime)
-                        currentConversation = roomOverall.ocs.data
+                        currentConversation = roomOverall.ocs!!.data
                         Log.d(
                         Log.d(
                             TAG,
                             TAG,
-                            "getRoomInfo. token: " + currentConversation?.getToken() +
+                            "getRoomInfo. token: " + currentConversation?.token +
                                 " sessionId: " + currentConversation?.sessionId
                                 " sessionId: " + currentConversation?.sessionId
                         )
                         )
                         loadAvatarForStatusBar()
                         loadAvatarForStatusBar()
@@ -401,7 +401,7 @@ class ChatController(args: Bundle) :
 
 
                 override fun onNext(roomsOverall: RoomsOverall) {
                 override fun onNext(roomsOverall: RoomsOverall) {
                     Log.d(TAG, "handleFromNotification - getRooms - got response")
                     Log.d(TAG, "handleFromNotification - getRooms - got response")
-                    for (conversation in roomsOverall.ocs.data) {
+                    for (conversation in roomsOverall.ocs!!.data!!) {
                         if (roomId == conversation.roomId) {
                         if (roomId == conversation.roomId) {
                             roomToken = conversation.token
                             roomToken = conversation.token
                             currentConversation = conversation
                             currentConversation = conversation
@@ -548,7 +548,7 @@ class ChatController(args: Bundle) :
             if (!conversationUser?.userId.equals("?")) {
             if (!conversationUser?.userId.equals("?")) {
                 senderId = "users/" + conversationUser?.userId
                 senderId = "users/" + conversationUser?.userId
             } else {
             } else {
-                senderId = currentConversation?.getActorType() + "/" + currentConversation?.getActorId()
+                senderId = currentConversation?.actorType + "/" + currentConversation?.actorId
             }
             }
 
 
             Log.d(TAG, "Initialize TalkMessagesListAdapter with senderId: " + senderId)
             Log.d(TAG, "Initialize TalkMessagesListAdapter with senderId: " + senderId)
@@ -579,7 +579,7 @@ class ChatController(args: Bundle) :
         adapter?.registerViewClickListener(
         adapter?.registerViewClickListener(
             R.id.playPauseBtn
             R.id.playPauseBtn
         ) { view, message ->
         ) { view, message ->
-            val filename = message.getSelectedIndividualHashMap()["name"]
+            val filename = message.selectedIndividualHashMap!!["name"]
             val file = File(context!!.cacheDir, filename!!)
             val file = File(context!!.cacheDir, filename!!)
             if (file.exists()) {
             if (file.exists()) {
                 if (message.isPlayingVoiceMessage) {
                 if (message.isPlayingVoiceMessage) {
@@ -934,7 +934,7 @@ class ChatController(args: Bundle) :
         }
         }
 
 
         if (mediaPlayer == null) {
         if (mediaPlayer == null) {
-            val fileName = message.getSelectedIndividualHashMap()["name"]
+            val fileName = message.selectedIndividualHashMap!!["name"]
             val absolutePath = context!!.cacheDir.absolutePath + "/" + fileName
             val absolutePath = context!!.cacheDir.absolutePath + "/" + fileName
             mediaPlayer = MediaPlayer().apply {
             mediaPlayer = MediaPlayer().apply {
                 setDataSource(absolutePath)
                 setDataSource(absolutePath)
@@ -978,17 +978,17 @@ class ChatController(args: Bundle) :
         message.isDownloadingVoiceMessage = true
         message.isDownloadingVoiceMessage = true
         adapter?.update(message)
         adapter?.update(message)
 
 
-        val baseUrl = message.activeUser.baseUrl
-        val userId = message.activeUser.userId
+        val baseUrl = message.activeUser!!.baseUrl
+        val userId = message.activeUser!!.userId
         val attachmentFolder = CapabilitiesUtil.getAttachmentFolder(message.activeUser)
         val attachmentFolder = CapabilitiesUtil.getAttachmentFolder(message.activeUser)
-        val fileName = message.getSelectedIndividualHashMap()["name"]
-        var size = message.getSelectedIndividualHashMap()["size"]
+        val fileName = message.selectedIndividualHashMap!!["name"]
+        var size = message.selectedIndividualHashMap!!["size"]
         if (size == null) {
         if (size == null) {
             size = "-1"
             size = "-1"
         }
         }
         val fileSize = size.toLong()
         val fileSize = size.toLong()
-        val fileId = message.getSelectedIndividualHashMap()["id"]
-        val path = message.getSelectedIndividualHashMap()["path"]
+        val fileId = message.selectedIndividualHashMap!!["id"]
+        val path = message.selectedIndividualHashMap!!["path"]
 
 
         // check if download worker is already running
         // check if download worker is already running
         val workers = WorkManager.getInstance(
         val workers = WorkManager.getInstance(
@@ -1223,7 +1223,7 @@ class ChatController(args: Bundle) :
 
 
     private fun shouldShowLobby(): Boolean {
     private fun shouldShowLobby(): Boolean {
         if (currentConversation != null) {
         if (currentConversation != null) {
-            return currentConversation?.shouldShowLobby(conversationUser) == true
+            return currentConversation?.shouldShowLobby(conversationUser!!) == true
         }
         }
         return false
         return false
     }
     }
@@ -1262,7 +1262,7 @@ class ChatController(args: Bundle) :
 
 
     private fun checkLobbyState() {
     private fun checkLobbyState() {
         if (currentConversation != null &&
         if (currentConversation != null &&
-            currentConversation?.isLobbyViewApplicable(conversationUser) ?: false &&
+            currentConversation?.isLobbyViewApplicable(conversationUser!!) ?: false &&
             isAlive()
             isAlive()
         ) {
         ) {
 
 
@@ -1270,7 +1270,7 @@ class ChatController(args: Bundle) :
                 getRoomInfo()
                 getRoomInfo()
             }
             }
 
 
-            if (currentConversation?.shouldShowLobby(conversationUser) ?: false) {
+            if (currentConversation?.shouldShowLobby(conversationUser!!) ?: false) {
                 binding.lobby.lobbyView.visibility = View.VISIBLE
                 binding.lobby.lobbyView.visibility = View.VISIBLE
                 binding.messagesListView.visibility = View.GONE
                 binding.messagesListView.visibility = View.GONE
                 binding.messageInputView.visibility = View.GONE
                 binding.messageInputView.visibility = View.GONE
@@ -1792,7 +1792,7 @@ class ChatController(args: Bundle) :
                     override fun onNext(roomOverall: RoomOverall) {
                     override fun onNext(roomOverall: RoomOverall) {
                         Log.d(TAG, "joinRoomWithPassword - joinRoom - got response: " + startNanoTime)
                         Log.d(TAG, "joinRoomWithPassword - joinRoom - got response: " + startNanoTime)
                         inConversation = true
                         inConversation = true
-                        currentConversation?.sessionId = roomOverall.ocs.data.sessionId
+                        currentConversation?.sessionId = roomOverall.ocs!!.data!!.sessionId
                         Log.d(TAG, "joinRoomWithPassword - sessionId: " + currentConversation?.sessionId)
                         Log.d(TAG, "joinRoomWithPassword - sessionId: " + currentConversation?.sessionId)
 
 
                         ApplicationWideCurrentRoomHolder.getInstance().session =
                         ApplicationWideCurrentRoomHolder.getInstance().session =
@@ -2026,7 +2026,7 @@ class ChatController(args: Bundle) :
         }
         }
         pullChatMessagesPending = true
         pullChatMessagesPending = true
 
 
-        if (currentConversation != null && currentConversation!!.shouldShowLobby(conversationUser)) {
+        if (currentConversation != null && currentConversation!!.shouldShowLobby(conversationUser!!)) {
             // return
             // return
         }
         }
 
 
@@ -2181,7 +2181,7 @@ class ChatController(args: Bundle) :
         if (response.code() == HTTP_CODE_OK) {
         if (response.code() == HTTP_CODE_OK) {
 
 
             val chatOverall = response.body() as ChatOverall?
             val chatOverall = response.body() as ChatOverall?
-            val chatMessageList = handleSystemMessages(chatOverall?.ocs!!.data)
+            val chatMessageList = handleSystemMessages(chatOverall?.ocs!!.data!!)
 
 
             if (chatMessageList.isNotEmpty() &&
             if (chatMessageList.isNotEmpty() &&
                 ChatMessage.SystemMessageType.CLEARED_CHAT == chatMessageList[0].systemMessageType
                 ChatMessage.SystemMessageType.CLEARED_CHAT == chatMessageList[0].systemMessageType
@@ -2455,19 +2455,19 @@ class ChatController(args: Bundle) :
 
 
             // setDeletionFlagsAndRemoveInfomessages
             // setDeletionFlagsAndRemoveInfomessages
             if (isInfoMessageAboutDeletion(currentMessage)) {
             if (isInfoMessageAboutDeletion(currentMessage)) {
-                if (!chatMessageMap.containsKey(currentMessage.value.parentMessage.id)) {
+                if (!chatMessageMap.containsKey(currentMessage.value.parentMessage!!.id)) {
                     // if chatMessageMap doesn't contain message to delete (this happens when lookingIntoFuture),
                     // if chatMessageMap doesn't contain message to delete (this happens when lookingIntoFuture),
                     // the message to delete has to be modified directly inside the adapter
                     // the message to delete has to be modified directly inside the adapter
                     setMessageAsDeleted(currentMessage.value.parentMessage)
                     setMessageAsDeleted(currentMessage.value.parentMessage)
                 } else {
                 } else {
-                    chatMessageMap[currentMessage.value.parentMessage.id]!!.isDeleted = true
+                    chatMessageMap[currentMessage.value.parentMessage!!.id]!!.isDeleted = true
                 }
                 }
                 chatMessageIterator.remove()
                 chatMessageIterator.remove()
             }
             }
 
 
             // delete reactions system messages
             // delete reactions system messages
             else if (isReactionsMessage(currentMessage)) {
             else if (isReactionsMessage(currentMessage)) {
-                if (!chatMessageMap.containsKey(currentMessage.value.parentMessage.id)) {
+                if (!chatMessageMap.containsKey(currentMessage.value.parentMessage!!.id)) {
                     updateAdapterForReaction(currentMessage.value.parentMessage)
                     updateAdapterForReaction(currentMessage.value.parentMessage)
                 }
                 }
 
 
@@ -2569,7 +2569,7 @@ class ChatController(args: Bundle) :
     }
     }
 
 
     private fun isSystemMessage(message: ChatMessage): Boolean {
     private fun isSystemMessage(message: ChatMessage): Boolean {
-        return ChatMessage.MessageType.SYSTEM_MESSAGE == message.getMessageType()
+        return ChatMessage.MessageType.SYSTEM_MESSAGE == message.getCalculateMessageType()
     }
     }
 
 
     fun deleteMessage(message: IMessage?) {
     fun deleteMessage(message: IMessage?) {
@@ -2603,7 +2603,7 @@ class ChatController(args: Bundle) :
                     }
                     }
 
 
                     override fun onNext(t: ChatOverallSingleMessage) {
                     override fun onNext(t: ChatOverallSingleMessage) {
-                        if (t.ocs.meta.statusCode == HttpURLConnection.HTTP_ACCEPTED) {
+                        if (t.ocs!!.meta!!.statusCode == HttpURLConnection.HTTP_ACCEPTED) {
                             Toast.makeText(
                             Toast.makeText(
                                 context, R.string.nc_delete_message_leaked_to_matterbridge,
                                 context, R.string.nc_delete_message_leaked_to_matterbridge,
                                 Toast.LENGTH_LONG
                                 Toast.LENGTH_LONG
@@ -2641,7 +2641,7 @@ class ChatController(args: Bundle) :
         )
         )
         ncApi!!.createRoom(
         ncApi!!.createRoom(
             credentials,
             credentials,
-            retrofitBucket.getUrl(), retrofitBucket.getQueryMap()
+            retrofitBucket.url, retrofitBucket.queryMap
         )
         )
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
             .observeOn(AndroidSchedulers.mainThread())
             .observeOn(AndroidSchedulers.mainThread())
@@ -2653,15 +2653,15 @@ class ChatController(args: Bundle) :
                 override fun onNext(roomOverall: RoomOverall) {
                 override fun onNext(roomOverall: RoomOverall) {
                     val bundle = Bundle()
                     val bundle = Bundle()
                     bundle.putParcelable(KEY_USER_ENTITY, conversationUser)
                     bundle.putParcelable(KEY_USER_ENTITY, conversationUser)
-                    bundle.putString(KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken())
-                    bundle.putString(KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId())
+                    bundle.putString(KEY_ROOM_TOKEN, roomOverall.ocs!!.data!!.token)
+                    bundle.putString(KEY_ROOM_ID, roomOverall.ocs!!.data!!.roomId)
 
 
                     // FIXME once APIv2+ is used only, the createRoom already returns all the data
                     // FIXME once APIv2+ is used only, the createRoom already returns all the data
                     ncApi!!.getRoom(
                     ncApi!!.getRoom(
                         credentials,
                         credentials,
                         ApiUtils.getUrlForRoom(
                         ApiUtils.getUrlForRoom(
                             apiVersion, conversationUser?.baseUrl,
                             apiVersion, conversationUser?.baseUrl,
-                            roomOverall.getOcs().getData().getToken()
+                            roomOverall.ocs!!.data!!.token
                         )
                         )
                     )
                     )
                         .subscribeOn(Schedulers.io())
                         .subscribeOn(Schedulers.io())
@@ -2674,11 +2674,11 @@ class ChatController(args: Bundle) :
                             override fun onNext(roomOverall: RoomOverall) {
                             override fun onNext(roomOverall: RoomOverall) {
                                 bundle.putParcelable(
                                 bundle.putParcelable(
                                     KEY_ACTIVE_CONVERSATION,
                                     KEY_ACTIVE_CONVERSATION,
-                                    Parcels.wrap(roomOverall.getOcs().getData())
+                                    Parcels.wrap(roomOverall.ocs!!.data!!)
                                 )
                                 )
                                 remapChatController(
                                 remapChatController(
                                     router, conversationUser!!.id,
                                     router, conversationUser!!.id,
-                                    roomOverall.getOcs().getData().getToken(), bundle, true
+                                    roomOverall.ocs!!.data!!.token!!, bundle, true
                                 )
                                 )
                             }
                             }
 
 
@@ -2767,9 +2767,9 @@ class ChatController(args: Bundle) :
             message.user.id.substring(ACTOR_LENGTH) != currentConversation?.actorId &&
             message.user.id.substring(ACTOR_LENGTH) != currentConversation?.actorId &&
             currentConversation?.type != Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL ||
             currentConversation?.type != Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL ||
             isShowMessageDeletionButton(message) || // delete
             isShowMessageDeletionButton(message) || // delete
-            ChatMessage.MessageType.REGULAR_TEXT_MESSAGE == message.getMessageType() || // forward
+            ChatMessage.MessageType.REGULAR_TEXT_MESSAGE == message.getCalculateMessageType() || // forward
             message.previousMessageId > NO_PREVIOUS_MESSAGE_ID && // mark as unread
             message.previousMessageId > NO_PREVIOUS_MESSAGE_ID && // mark as unread
-            ChatMessage.MessageType.SYSTEM_MESSAGE != message.getMessageType() &&
+            ChatMessage.MessageType.SYSTEM_MESSAGE != message.getCalculateMessageType() &&
             BuildConfig.DEBUG
             BuildConfig.DEBUG
     }
     }
 
 
@@ -2867,12 +2867,12 @@ class ChatController(args: Bundle) :
             message.reactionsSelf = ArrayList<String>()
             message.reactionsSelf = ArrayList<String>()
         }
         }
 
 
-        var amount = message.reactions[emoji]
+        var amount = message.reactions!![emoji]
         if (amount == null) {
         if (amount == null) {
             amount = 0
             amount = 0
         }
         }
-        message.reactions[emoji] = amount + 1
-        message.reactionsSelf.add(emoji)
+        message.reactions!![emoji] = amount + 1
+        message.reactionsSelf!!.add(emoji)
         adapter?.update(message)
         adapter?.update(message)
     }
     }
 
 
@@ -2905,7 +2905,7 @@ class ChatController(args: Bundle) :
     override fun hasContentFor(message: ChatMessage, type: Byte): Boolean {
     override fun hasContentFor(message: ChatMessage, type: Byte): Boolean {
         return when (type) {
         return when (type) {
             CONTENT_TYPE_LOCATION -> message.hasGeoLocation()
             CONTENT_TYPE_LOCATION -> message.hasGeoLocation()
-            CONTENT_TYPE_VOICE_MESSAGE -> message.isVoiceMessage()
+            CONTENT_TYPE_VOICE_MESSAGE -> message.isVoiceMessage
             CONTENT_TYPE_SYSTEM_MESSAGE -> !TextUtils.isEmpty(message.systemMessage)
             CONTENT_TYPE_SYSTEM_MESSAGE -> !TextUtils.isEmpty(message.systemMessage)
             CONTENT_TYPE_UNREAD_NOTICE_MESSAGE -> message.id == "-1"
             CONTENT_TYPE_UNREAD_NOTICE_MESSAGE -> message.id == "-1"
             else -> false
             else -> false
@@ -2968,19 +2968,19 @@ class ChatController(args: Bundle) :
                         val conversationIntent = Intent(activity, CallActivity::class.java)
                         val conversationIntent = Intent(activity, CallActivity::class.java)
                         val bundle = Bundle()
                         val bundle = Bundle()
                         bundle.putParcelable(KEY_USER_ENTITY, conversationUser)
                         bundle.putParcelable(KEY_USER_ENTITY, conversationUser)
-                        bundle.putString(KEY_ROOM_TOKEN, roomOverall.ocs.data.token)
-                        bundle.putString(KEY_ROOM_ID, roomOverall.ocs.data.roomId)
+                        bundle.putString(KEY_ROOM_TOKEN, roomOverall.ocs!!.data!!.token)
+                        bundle.putString(KEY_ROOM_ID, roomOverall.ocs!!.data!!.roomId)
 
 
                         if (conversationUser != null) {
                         if (conversationUser != null) {
                             bundle.putParcelable(
                             bundle.putParcelable(
                                 KEY_ACTIVE_CONVERSATION,
                                 KEY_ACTIVE_CONVERSATION,
-                                Parcels.wrap(roomOverall.ocs.data)
+                                Parcels.wrap(roomOverall.ocs!!.data)
                             )
                             )
                             conversationIntent.putExtras(bundle)
                             conversationIntent.putExtras(bundle)
 
 
                             ConductorRemapping.remapChatController(
                             ConductorRemapping.remapChatController(
                                 router, conversationUser.id,
                                 router, conversationUser.id,
-                                roomOverall.ocs.data.token, bundle, false
+                                roomOverall.ocs!!.data!!.token!!, bundle, false
                             )
                             )
                         } else {
                         } else {
                             conversationIntent.putExtras(bundle)
                             conversationIntent.putExtras(bundle)

+ 14 - 14
app/src/main/java/com/nextcloud/talk/controllers/ContactsController.kt

@@ -252,7 +252,7 @@ class ContactsController(args: Bundle) :
         )
         )
         ncApi.createRoom(
         ncApi.createRoom(
             credentials,
             credentials,
-            retrofitBucket.getUrl(), retrofitBucket.getQueryMap()
+            retrofitBucket.url, retrofitBucket.queryMap
         )
         )
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
             .observeOn(AndroidSchedulers.mainThread())
             .observeOn(AndroidSchedulers.mainThread())
@@ -263,15 +263,15 @@ class ContactsController(args: Bundle) :
                 override fun onNext(roomOverall: RoomOverall) {
                 override fun onNext(roomOverall: RoomOverall) {
                     val bundle = Bundle()
                     val bundle = Bundle()
                     bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, currentUser)
                     bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, currentUser)
-                    bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken())
-                    bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId())
+                    bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.ocs!!.data!!.token)
+                    bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.ocs!!.data!!.roomId)
 
 
                     // FIXME once APIv2 or later is used only, the createRoom already returns all the data
                     // FIXME once APIv2 or later is used only, the createRoom already returns all the data
                     ncApi.getRoom(
                     ncApi.getRoom(
                         credentials,
                         credentials,
                         ApiUtils.getUrlForRoom(
                         ApiUtils.getUrlForRoom(
                             apiVersion, currentUser!!.baseUrl,
                             apiVersion, currentUser!!.baseUrl,
-                            roomOverall.getOcs().getData().getToken()
+                            roomOverall.ocs!!.data!!.token
                         )
                         )
                     )
                     )
                         .subscribeOn(Schedulers.io())
                         .subscribeOn(Schedulers.io())
@@ -283,11 +283,11 @@ class ContactsController(args: Bundle) :
                             override fun onNext(roomOverall: RoomOverall) {
                             override fun onNext(roomOverall: RoomOverall) {
                                 bundle.putParcelable(
                                 bundle.putParcelable(
                                     BundleKeys.KEY_ACTIVE_CONVERSATION,
                                     BundleKeys.KEY_ACTIVE_CONVERSATION,
-                                    Parcels.wrap(roomOverall.getOcs().getData())
+                                    Parcels.wrap(roomOverall.ocs!!.data!!)
                                 )
                                 )
                                 ConductorRemapping.remapChatController(
                                 ConductorRemapping.remapChatController(
                                     router, currentUser!!.id,
                                     router, currentUser!!.id,
-                                    roomOverall.getOcs().getData().getToken(), bundle, true
+                                    roomOverall.ocs!!.data!!.token!!, bundle, true
                                 )
                                 )
                             }
                             }
 
 
@@ -393,7 +393,7 @@ class ContactsController(args: Bundle) :
         val query = adapter!!.getFilter(String::class.java) as String?
         val query = adapter!!.getFilter(String::class.java) as String?
         val retrofitBucket: RetrofitBucket =
         val retrofitBucket: RetrofitBucket =
             ApiUtils.getRetrofitBucketForContactsSearchFor14(currentUser!!.baseUrl, query)
             ApiUtils.getRetrofitBucketForContactsSearchFor14(currentUser!!.baseUrl, query)
-        val modifiedQueryMap: HashMap<String, Any?> = HashMap<String, Any?>(retrofitBucket.getQueryMap())
+        val modifiedQueryMap: HashMap<String, Any?> = HashMap<String, Any?>(retrofitBucket.queryMap)
         modifiedQueryMap.put("limit", CONTACTS_BATCH_SIZE)
         modifiedQueryMap.put("limit", CONTACTS_BATCH_SIZE)
         if (isAddingParticipantsView) {
         if (isAddingParticipantsView) {
             modifiedQueryMap.put("itemId", conversationToken)
             modifiedQueryMap.put("itemId", conversationToken)
@@ -417,7 +417,7 @@ class ContactsController(args: Bundle) :
         modifiedQueryMap.put("shareTypes[]", shareTypesList)
         modifiedQueryMap.put("shareTypes[]", shareTypesList)
         ncApi.getContactsWithSearchParam(
         ncApi.getContactsWithSearchParam(
             credentials,
             credentials,
-            retrofitBucket.getUrl(), shareTypesList, modifiedQueryMap
+            retrofitBucket.url, shareTypesList, modifiedQueryMap
         )
         )
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
             .observeOn(AndroidSchedulers.mainThread())
             .observeOn(AndroidSchedulers.mainThread())
@@ -752,7 +752,7 @@ class ContactsController(args: Bundle) :
     fun onMessageEvent(openConversationEvent: OpenConversationEvent) {
     fun onMessageEvent(openConversationEvent: OpenConversationEvent) {
         ConductorRemapping.remapChatController(
         ConductorRemapping.remapChatController(
             router, currentUser!!.id,
             router, currentUser!!.id,
-            openConversationEvent.conversation!!.getToken(),
+            openConversationEvent.conversation!!.token!!,
             openConversationEvent.bundle!!, true
             openConversationEvent.bundle!!, true
         )
         )
         contactsBottomDialog?.dismiss()
         contactsBottomDialog?.dismiss()
@@ -815,7 +815,7 @@ class ContactsController(args: Bundle) :
         )
         )
         ncApi.createRoom(
         ncApi.createRoom(
             credentials,
             credentials,
-            retrofitBucket.getUrl(), retrofitBucket.getQueryMap()
+            retrofitBucket.url, retrofitBucket.queryMap
         )
         )
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
             .observeOn(AndroidSchedulers.mainThread())
             .observeOn(AndroidSchedulers.mainThread())
@@ -827,16 +827,16 @@ class ContactsController(args: Bundle) :
                     if (activity != null) {
                     if (activity != null) {
                         val bundle = Bundle()
                         val bundle = Bundle()
                         bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, currentUser)
                         bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, currentUser)
-                        bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken())
-                        bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId())
+                        bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.ocs!!.data!!.token)
+                        bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.ocs!!.data!!.roomId)
                         bundle.putParcelable(
                         bundle.putParcelable(
                             BundleKeys.KEY_ACTIVE_CONVERSATION,
                             BundleKeys.KEY_ACTIVE_CONVERSATION,
-                            Parcels.wrap(roomOverall.getOcs().getData())
+                            Parcels.wrap(roomOverall.ocs!!.data!!)
                         )
                         )
                         ConductorRemapping.remapChatController(
                         ConductorRemapping.remapChatController(
                             router,
                             router,
                             currentUser!!.id,
                             currentUser!!.id,
-                            roomOverall.getOcs().getData().getToken(),
+                            roomOverall.ocs!!.data!!.token!!,
                             bundle,
                             bundle,
                             true
                             true
                         )
                         )

+ 7 - 7
app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt

@@ -208,7 +208,7 @@ class ConversationInfoController(args: Bundle) :
     private fun setupWebinaryView() {
     private fun setupWebinaryView() {
         if (CapabilitiesUtil.hasSpreedFeatureCapability(conversationUser, "webinary-lobby") &&
         if (CapabilitiesUtil.hasSpreedFeatureCapability(conversationUser, "webinary-lobby") &&
             webinaryRoomType(conversation!!) &&
             webinaryRoomType(conversation!!) &&
-            conversation!!.canModerate(conversationUser)
+            conversation!!.canModerate(conversationUser!!)
         ) {
         ) {
             binding.webinarInfoView.webinarSettings.visibility = View.VISIBLE
             binding.webinarInfoView.webinarSettings.visibility = View.VISIBLE
 
 
@@ -223,7 +223,7 @@ class ConversationInfoController(args: Bundle) :
                 MaterialDialog(activity!!, BottomSheet(WRAP_CONTENT)).show {
                 MaterialDialog(activity!!, BottomSheet(WRAP_CONTENT)).show {
                     val currentTimeCalendar = Calendar.getInstance()
                     val currentTimeCalendar = Calendar.getInstance()
                     if (conversation!!.lobbyTimer != null && conversation!!.lobbyTimer != 0L) {
                     if (conversation!!.lobbyTimer != null && conversation!!.lobbyTimer != 0L) {
-                        currentTimeCalendar.timeInMillis = conversation!!.lobbyTimer * DateConstants.SECOND_DIVIDER
+                        currentTimeCalendar.timeInMillis = conversation!!.lobbyTimer!! * DateConstants.SECOND_DIVIDER
                     }
                     }
 
 
                     dateTimePicker(
                     dateTimePicker(
@@ -278,7 +278,7 @@ class ConversationInfoController(args: Bundle) :
         ) {
         ) {
             binding.webinarInfoView.startTimePreferences.setSummary(
             binding.webinarInfoView.startTimePreferences.setSummary(
                 DateUtils.getLocalDateStringFromTimestampForLobby(
                 DateUtils.getLocalDateStringFromTimestampForLobby(
-                    conversation!!.lobbyTimer
+                    conversation!!.lobbyTimer!!
                 )
                 )
             )
             )
         } else {
         } else {
@@ -618,7 +618,7 @@ class ConversationInfoController(args: Bundle) :
                 @Suppress("Detekt.TooGenericExceptionCaught")
                 @Suppress("Detekt.TooGenericExceptionCaught")
                 override fun onNext(roomOverall: RoomOverall) {
                 override fun onNext(roomOverall: RoomOverall) {
                     try {
                     try {
-                        conversation = roomOverall.ocs.data
+                        conversation = roomOverall.ocs!!.data
 
 
                         val conversationCopy = conversation
                         val conversationCopy = conversation
 
 
@@ -639,7 +639,7 @@ class ConversationInfoController(args: Bundle) :
 
 
                             setupWebinaryView()
                             setupWebinaryView()
 
 
-                            if (!conversation!!.canLeave(conversationUser)) {
+                            if (!conversation!!.canLeave()) {
                                 binding.leaveConversationAction.visibility = View.GONE
                                 binding.leaveConversationAction.visibility = View.GONE
                             } else {
                             } else {
                                 binding.leaveConversationAction.visibility = View.VISIBLE
                                 binding.leaveConversationAction.visibility = View.VISIBLE
@@ -670,7 +670,7 @@ class ConversationInfoController(args: Bundle) :
 
 
                             binding.displayNameText.text = conversation!!.displayName
                             binding.displayNameText.text = conversation!!.displayName
 
 
-                            if (conversation!!.description != null && !conversation!!.description.isEmpty()) {
+                            if (conversation!!.description != null && !conversation!!.description!!.isEmpty()) {
                                 binding.descriptionText.text = conversation!!.description
                                 binding.descriptionText.text = conversation!!.description
                                 binding.conversationDescription.visibility = View.VISIBLE
                                 binding.conversationDescription.visibility = View.VISIBLE
                             }
                             }
@@ -979,7 +979,7 @@ class ConversationInfoController(args: Bundle) :
     }
     }
 
 
     override fun onItemClick(view: View?, position: Int): Boolean {
     override fun onItemClick(view: View?, position: Int): Boolean {
-        if (!conversation!!.canModerate(conversationUser)) {
+        if (!conversation!!.canModerate(conversationUser!!)) {
             return true
             return true
         }
         }
 
 

+ 13 - 11
app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java

@@ -561,8 +561,10 @@ public class ConversationsListController extends BaseController implements Searc
                 }
                 }
 
 
                 for (Conversation conversation : roomsOverall.getOcs().getData()) {
                 for (Conversation conversation : roomsOverall.getOcs().getData()) {
-                    if (bundle.containsKey(BundleKeys.INSTANCE.getKEY_FORWARD_HIDE_SOURCE_ROOM()) && conversation.roomId.equals(bundle.getString(
-                        BundleKeys.INSTANCE.getKEY_FORWARD_HIDE_SOURCE_ROOM()))) {
+                    if (bundle.containsKey(BundleKeys.INSTANCE.getKEY_FORWARD_HIDE_SOURCE_ROOM()) &&
+                        conversation.getRoomId().equals(bundle.getString(
+                            BundleKeys.INSTANCE.getKEY_FORWARD_HIDE_SOURCE_ROOM()))
+                    ) {
                         continue;
                         continue;
                     }
                     }
 
 
@@ -581,7 +583,7 @@ public class ConversationsListController extends BaseController implements Searc
                             conversation,
                             conversation,
                             currentUser,
                             currentUser,
                             getActivity(),
                             getActivity(),
-                            userStatuses.get(conversation.name));
+                            userStatuses.get(conversation.getName()));
                         conversationItems.add(conversationItem);
                         conversationItems.add(conversationItem);
 
 
                         ConversationItem conversationItemWithHeader = new ConversationItem(
                         ConversationItem conversationItemWithHeader = new ConversationItem(
@@ -589,7 +591,7 @@ public class ConversationsListController extends BaseController implements Searc
                             currentUser,
                             currentUser,
                             getActivity(),
                             getActivity(),
                             callHeaderItems.get(headerTitle),
                             callHeaderItems.get(headerTitle),
-                            userStatuses.get(conversation.name));
+                            userStatuses.get(conversation.getName()));
                         conversationItemsWithHeader.add(conversationItemWithHeader);
                         conversationItemsWithHeader.add(conversationItemWithHeader);
                     }
                     }
                 }
                 }
@@ -628,7 +630,7 @@ public class ConversationsListController extends BaseController implements Searc
             Conversation conversation1 = ((ConversationItem) o1).getModel();
             Conversation conversation1 = ((ConversationItem) o1).getModel();
             Conversation conversation2 = ((ConversationItem) o2).getModel();
             Conversation conversation2 = ((ConversationItem) o2).getModel();
             return new CompareToBuilder()
             return new CompareToBuilder()
-                .append(conversation2.isFavorite(), conversation1.isFavorite())
+                .append(conversation2.getFavorite(), conversation1.getFavorite())
                 .append(conversation2.getLastActivity(), conversation1.getLastActivity())
                 .append(conversation2.getLastActivity(), conversation1.getLastActivity())
                 .toComparison();
                 .toComparison();
         });
         });
@@ -662,7 +664,7 @@ public class ConversationsListController extends BaseController implements Searc
                             currentUser,
                             currentUser,
                             getActivity(),
                             getActivity(),
                             callHeaderItems.get(headerTitle),
                             callHeaderItems.get(headerTitle),
-                            userStatuses.get(conversation.name));
+                            userStatuses.get(conversation.getName()));
 
 
                         openConversationItems.add(conversationItem);
                         openConversationItems.add(conversationItem);
                     }
                     }
@@ -770,9 +772,9 @@ public class ConversationsListController extends BaseController implements Searc
             for (AbstractFlexibleItem flexItem : conversationItems) {
             for (AbstractFlexibleItem flexItem : conversationItems) {
                 Conversation conversationItem = ((ConversationItem) flexItem).getModel();
                 Conversation conversationItem = ((ConversationItem) flexItem).getModel();
                 int position = adapter.getGlobalPositionOf(flexItem);
                 int position = adapter.getGlobalPositionOf(flexItem);
-                if ((conversationItem.unreadMention ||
-                    (conversationItem.unreadMessages > 0 &&
-                        conversationItem.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL)) &&
+                if ((conversationItem.getUnreadMention() ||
+                    (conversationItem.getUnreadMessages() > 0 &&
+                        conversationItem.getType() == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL)) &&
                     position > lastVisibleItem) {
                     position > lastVisibleItem) {
                     nextUnreadConversationScrollPosition = position;
                     nextUnreadConversationScrollPosition = position;
                     if (!newMentionPopupBubble.isShown()) {
                     if (!newMentionPopupBubble.isShown()) {
@@ -874,7 +876,7 @@ public class ConversationsListController extends BaseController implements Searc
 
 
             if (selectedConversation != null && getActivity() != null) {
             if (selectedConversation != null && getActivity() != null) {
                 boolean hasChatPermission =
                 boolean hasChatPermission =
-                    new AttendeePermissionsUtil(selectedConversation.permissions).hasChatPermission(currentUser);
+                    new AttendeePermissionsUtil(selectedConversation.getPermissions()).hasChatPermission(currentUser);
 
 
                 if (showShareToScreen) {
                 if (showShareToScreen) {
                     if (hasChatPermission && !isReadOnlyConversation(selectedConversation)) {
                     if (hasChatPermission && !isReadOnlyConversation(selectedConversation)) {
@@ -902,7 +904,7 @@ public class ConversationsListController extends BaseController implements Searc
     }
     }
 
 
     private Boolean isReadOnlyConversation(Conversation conversation) {
     private Boolean isReadOnlyConversation(Conversation conversation) {
-        return conversation.conversationReadOnlyState ==
+        return conversation.getConversationReadOnlyState() ==
             Conversation.ConversationReadOnlyState.CONVERSATION_READ_ONLY;
             Conversation.ConversationReadOnlyState.CONVERSATION_READ_ONLY;
     }
     }
 
 

+ 5 - 5
app/src/main/java/com/nextcloud/talk/controllers/RingtoneSelectionController.kt

@@ -119,16 +119,16 @@ class RingtoneSelectionController(args: Bundle) :
             try {
             try {
                 val ringtoneSettings: RingtoneSettings =
                 val ringtoneSettings: RingtoneSettings =
                     LoganSquare.parse<RingtoneSettings>(preferencesString, RingtoneSettings::class.java)
                     LoganSquare.parse<RingtoneSettings>(preferencesString, RingtoneSettings::class.java)
-                if (ringtoneSettings.getRingtoneUri() == null) {
+                if (ringtoneSettings.ringtoneUri == null) {
                     adapter!!.toggleSelection(0)
                     adapter!!.toggleSelection(0)
-                } else if (ringtoneSettings.getRingtoneUri().toString() == ringtoneString) {
+                } else if (ringtoneSettings.ringtoneUri!!.toString() == ringtoneString) {
                     adapter!!.toggleSelection(1)
                     adapter!!.toggleSelection(1)
                 } else {
                 } else {
                     var notificationSoundItem: NotificationSoundItem?
                     var notificationSoundItem: NotificationSoundItem?
                     for (i in 2 until adapter!!.itemCount) {
                     for (i in 2 until adapter!!.itemCount) {
                         notificationSoundItem = adapter!!.getItem(i) as NotificationSoundItem?
                         notificationSoundItem = adapter!!.getItem(i) as NotificationSoundItem?
                         if (
                         if (
-                            notificationSoundItem!!.notificationSoundUri == ringtoneSettings.getRingtoneUri().toString()
+                            notificationSoundItem!!.notificationSoundUri == ringtoneSettings.ringtoneUri!!.toString()
                         ) {
                         ) {
                             adapter!!.toggleSelection(i)
                             adapter!!.toggleSelection(i)
                             break
                             break
@@ -199,8 +199,8 @@ class RingtoneSelectionController(args: Bundle) :
         }
         }
         if (adapter!!.selectedPositions.size == 0 || adapter!!.selectedPositions[0] != position) {
         if (adapter!!.selectedPositions.size == 0 || adapter!!.selectedPositions[0] != position) {
             val ringtoneSettings = RingtoneSettings()
             val ringtoneSettings = RingtoneSettings()
-            ringtoneSettings.setRingtoneName(notificationSoundItem.notificationSoundName)
-            ringtoneSettings.setRingtoneUri(ringtoneUri)
+            ringtoneSettings.ringtoneName = notificationSoundItem.notificationSoundName
+            ringtoneSettings.ringtoneUri = ringtoneUri
             if (callNotificationSounds) {
             if (callNotificationSounds) {
                 try {
                 try {
                     appPreferences!!.callRingtoneUri = LoganSquare.serialize(ringtoneSettings)
                     appPreferences!!.callRingtoneUri = LoganSquare.serialize(ringtoneSettings)

+ 4 - 4
app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.kt

@@ -103,7 +103,7 @@ class EntryMenuController(args: Bundle) :
         super.onViewBound(view)
         super.onViewBound(view)
 
 
         if (conversation != null && operation === ConversationOperationEnum.OPS_CODE_RENAME_ROOM) {
         if (conversation != null && operation === ConversationOperationEnum.OPS_CODE_RENAME_ROOM) {
-            binding.textEdit.setText(conversation!!.getName())
+            binding.textEdit.setText(conversation!!.name)
         }
         }
 
 
         binding.textEdit.setOnEditorActionListener { v, actionId, event ->
         binding.textEdit.setOnEditorActionListener { v, actionId, event ->
@@ -127,7 +127,7 @@ class EntryMenuController(args: Bundle) :
             override fun afterTextChanged(s: Editable) {
             override fun afterTextChanged(s: Editable) {
                 if (!TextUtils.isEmpty(s)) {
                 if (!TextUtils.isEmpty(s)) {
                     if (operation === ConversationOperationEnum.OPS_CODE_RENAME_ROOM) {
                     if (operation === ConversationOperationEnum.OPS_CODE_RENAME_ROOM) {
-                        if (conversation!!.getName() == null || !conversation!!.getName().equals(s.toString())) {
+                        if (conversation!!.name == null || !conversation!!.name.equals(s.toString())) {
                             if (!binding.okButton.isEnabled) {
                             if (!binding.okButton.isEnabled) {
                                 binding.okButton.isEnabled = true
                                 binding.okButton.isEnabled = true
                                 binding.okButton.alpha = OPACITY_ENABLED
                                 binding.okButton.alpha = OPACITY_ENABLED
@@ -260,9 +260,9 @@ class EntryMenuController(args: Bundle) :
             if (operation === ConversationOperationEnum.OPS_CODE_CHANGE_PASSWORD ||
             if (operation === ConversationOperationEnum.OPS_CODE_CHANGE_PASSWORD ||
                 operation === ConversationOperationEnum.OPS_CODE_SET_PASSWORD
                 operation === ConversationOperationEnum.OPS_CODE_SET_PASSWORD
             ) {
             ) {
-                conversation!!.setPassword(binding.textEdit.text.toString())
+                conversation!!.password = binding.textEdit.text.toString()
             } else {
             } else {
-                conversation!!.setName(binding.textEdit.text.toString())
+                conversation!!.name = binding.textEdit.text.toString()
             }
             }
             bundle.putParcelable(BundleKeys.KEY_ROOM, Parcels.wrap<Any>(conversation))
             bundle.putParcelable(BundleKeys.KEY_ROOM, Parcels.wrap<Any>(conversation))
             bundle.putSerializable(BundleKeys.KEY_OPERATION_CODE, operation)
             bundle.putSerializable(BundleKeys.KEY_OPERATION_CODE, operation)

+ 27 - 27
app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.kt

@@ -257,9 +257,9 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
             ApiUtils.getUrlForSetChatReadMarker(
             ApiUtils.getUrlForSetChatReadMarker(
                 chatApiVersion(),
                 chatApiVersion(),
                 currentUser!!.baseUrl,
                 currentUser!!.baseUrl,
-                conversation!!.getToken()
+                conversation!!.token
             ),
             ),
-            conversation!!.lastMessage.jsonMessageId
+            conversation!!.lastMessage!!.jsonMessageId
         )
         )
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
             .observeOn(AndroidSchedulers.mainThread())
             .observeOn(AndroidSchedulers.mainThread())
@@ -273,7 +273,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
             ApiUtils.getUrlForRoomPublic(
             ApiUtils.getUrlForRoomPublic(
                 apiVersion(),
                 apiVersion(),
                 currentUser!!.baseUrl,
                 currentUser!!.baseUrl,
-                conversation!!.getToken()
+                conversation!!.token
             )
             )
         )
         )
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
@@ -284,15 +284,15 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
 
 
     private fun operationChangePassword() {
     private fun operationChangePassword() {
         var pass: String? = ""
         var pass: String? = ""
-        if (conversation!!.getPassword() != null) {
-            pass = conversation!!.getPassword()
+        if (conversation!!.password != null) {
+            pass = conversation!!.password
         }
         }
         ncApi.setPassword(
         ncApi.setPassword(
             credentials,
             credentials,
             ApiUtils.getUrlForRoomPassword(
             ApiUtils.getUrlForRoomPassword(
                 apiVersion(),
                 apiVersion(),
                 currentUser!!.baseUrl,
                 currentUser!!.baseUrl,
-                conversation!!.getToken()
+                conversation!!.token
             ),
             ),
             pass
             pass
         )
         )
@@ -308,7 +308,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
             ApiUtils.getUrlForRoomPublic(
             ApiUtils.getUrlForRoomPublic(
                 apiVersion(),
                 apiVersion(),
                 currentUser!!.baseUrl,
                 currentUser!!.baseUrl,
-                conversation!!.getToken()
+                conversation!!.token
             )
             )
         )
         )
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
@@ -323,9 +323,9 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
             ApiUtils.getUrlForRoom(
             ApiUtils.getUrlForRoom(
                 apiVersion(),
                 apiVersion(),
                 currentUser!!.baseUrl,
                 currentUser!!.baseUrl,
-                conversation!!.getToken()
+                conversation!!.token
             ),
             ),
-            conversation!!.getName()
+            conversation!!.name
         )
         )
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
             .observeOn(AndroidSchedulers.mainThread())
             .observeOn(AndroidSchedulers.mainThread())
@@ -342,7 +342,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
                 ApiUtils.getUrlForRoomFavorite(
                 ApiUtils.getUrlForRoomFavorite(
                     apiVersion,
                     apiVersion,
                     currentUser!!.baseUrl,
                     currentUser!!.baseUrl,
-                    conversation!!.getToken()
+                    conversation!!.token
                 )
                 )
             )
             )
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
@@ -355,7 +355,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
                 ApiUtils.getUrlForRoomFavorite(
                 ApiUtils.getUrlForRoomFavorite(
                     apiVersion,
                     apiVersion,
                     currentUser!!.baseUrl,
                     currentUser!!.baseUrl,
-                    conversation!!.getToken()
+                    conversation!!.token
                 )
                 )
             )
             )
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
@@ -391,7 +391,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
                 conversationName
                 conversationName
             )
             )
         }
         }
-        ncApi.createRoom(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
+        ncApi.createRoom(credentials, retrofitBucket.url, retrofitBucket.queryMap)
             .subscribeOn(Schedulers.io())
             .subscribeOn(Schedulers.io())
             .observeOn(AndroidSchedulers.mainThread())
             .observeOn(AndroidSchedulers.mainThread())
             .retry(1)
             .retry(1)
@@ -401,12 +401,12 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
                 }
                 }
 
 
                 override fun onNext(roomOverall: RoomOverall) {
                 override fun onNext(roomOverall: RoomOverall) {
-                    conversation = roomOverall.getOcs().getData()
+                    conversation = roomOverall.ocs!!.data
                     ncApi.getRoom(
                     ncApi.getRoom(
                         credentials,
                         credentials,
                         ApiUtils.getUrlForRoom(
                         ApiUtils.getUrlForRoom(
                             apiVersion, currentUser!!.baseUrl,
                             apiVersion, currentUser!!.baseUrl,
-                            conversation!!.getToken()
+                            conversation!!.token
                         )
                         )
                     )
                     )
                         .subscribeOn(Schedulers.io())
                         .subscribeOn(Schedulers.io())
@@ -419,7 +419,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
                             override fun onNext(
                             override fun onNext(
                                 roomOverall: RoomOverall
                                 roomOverall: RoomOverall
                             ) {
                             ) {
-                                conversation = roomOverall.getOcs().getData()
+                                conversation = roomOverall.ocs!!.data
                                 inviteUsersToAConversation()
                                 inviteUsersToAConversation()
                             }
                             }
 
 
@@ -460,8 +460,8 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
                 }
                 }
 
 
                 override fun onNext(roomOverall: RoomOverall) {
                 override fun onNext(roomOverall: RoomOverall) {
-                    conversation = roomOverall.getOcs().getData()
-                    if (conversation!!.isHasPassword && conversation!!.isGuest) {
+                    conversation = roomOverall.ocs!!.data
+                    if (conversation!!.hasPassword && conversation!!.isGuest) {
                         eventBus.post(ConversationsListFetchDataEvent())
                         eventBus.post(ConversationsListFetchDataEvent())
                         val bundle = Bundle()
                         val bundle = Bundle()
                         bundle.putParcelable(KEY_ROOM, Parcels.wrap(conversation))
                         bundle.putParcelable(KEY_ROOM, Parcels.wrap(conversation))
@@ -504,7 +504,7 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
                                 }
                                 }
 
 
                                 override fun onNext(roomOverall: RoomOverall) {
                                 override fun onNext(roomOverall: RoomOverall) {
-                                    conversation = roomOverall.getOcs().getData()
+                                    conversation = roomOverall.ocs!!.data
                                     initiateConversation()
                                     initiateConversation()
                                 }
                                 }
 
 
@@ -639,10 +639,10 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
             retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipant(
             retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipant(
                 apiVersion,
                 apiVersion,
                 currentUser!!.baseUrl,
                 currentUser!!.baseUrl,
-                conversation!!.getToken(),
+                conversation!!.token,
                 userId
                 userId
             )
             )
-            ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
+            ncApi.addParticipant(credentials, retrofitBucket.url, retrofitBucket.queryMap)
                 .subscribeOn(Schedulers.io())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .observeOn(AndroidSchedulers.mainThread())
                 .retry(1)
                 .retry(1)
@@ -683,11 +683,11 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
                 retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
                 retrofitBucket = ApiUtils.getRetrofitBucketForAddParticipantWithSource(
                     apiVersion,
                     apiVersion,
                     currentUser!!.baseUrl,
                     currentUser!!.baseUrl,
-                    conversation!!.getToken(),
+                    conversation!!.token,
                     "groups",
                     "groups",
                     groupId
                     groupId
                 )
                 )
-                ncApi.addParticipant(credentials, retrofitBucket.getUrl(), retrofitBucket.getQueryMap())
+                ncApi.addParticipant(credentials, retrofitBucket.url, retrofitBucket.queryMap)
                     .subscribeOn(Schedulers.io())
                     .subscribeOn(Schedulers.io())
                     .observeOn(AndroidSchedulers.mainThread())
                     .observeOn(AndroidSchedulers.mainThread())
                     .retry(1)
                     .retry(1)
@@ -718,9 +718,9 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
     private fun initiateConversation() {
     private fun initiateConversation() {
         eventBus.post(ConversationsListFetchDataEvent())
         eventBus.post(ConversationsListFetchDataEvent())
         val bundle = Bundle()
         val bundle = Bundle()
-        bundle.putString(KEY_ROOM_TOKEN, conversation!!.getToken())
-        bundle.putString(KEY_ROOM_ID, conversation!!.getRoomId())
-        bundle.putString(KEY_CONVERSATION_NAME, conversation!!.getDisplayName())
+        bundle.putString(KEY_ROOM_TOKEN, conversation!!.token)
+        bundle.putString(KEY_ROOM_ID, conversation!!.roomId)
+        bundle.putString(KEY_CONVERSATION_NAME, conversation!!.displayName)
         bundle.putParcelable(KEY_USER_ENTITY, currentUser)
         bundle.putParcelable(KEY_USER_ENTITY, currentUser)
         bundle.putParcelable(KEY_ACTIVE_CONVERSATION, Parcels.wrap(conversation))
         bundle.putParcelable(KEY_ACTIVE_CONVERSATION, Parcels.wrap(conversation))
         bundle.putString(KEY_CONVERSATION_PASSWORD, callPassword)
         bundle.putString(KEY_CONVERSATION_PASSWORD, callPassword)
@@ -771,11 +771,11 @@ class OperationsMenuController(args: Bundle) : NewBaseController(
         }
         }
 
 
         override fun onNext(roomOverall: RoomOverall) {
         override fun onNext(roomOverall: RoomOverall) {
-            conversation = roomOverall.getOcs().getData()
+            conversation = roomOverall.ocs!!.data
             if (operation !== ConversationOperationEnum.OPS_CODE_JOIN_ROOM) {
             if (operation !== ConversationOperationEnum.OPS_CODE_JOIN_ROOM) {
                 showResultImage(everythingOK = true, isGuestSupportError = false)
                 showResultImage(everythingOK = true, isGuestSupportError = false)
             } else {
             } else {
-                conversation = roomOverall.getOcs().getData()
+                conversation = roomOverall.ocs!!.data
                 initiateConversation()
                 initiateConversation()
             }
             }
         }
         }

+ 2 - 2
app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java

@@ -170,7 +170,7 @@ public class NotificationWorker extends Worker {
                             }
                             }
                         }
                         }
 
 
-                        muteCall = !(conversation.notificationCalls == 1);
+                        muteCall = !(conversation.getNotificationCalls() == 1);
                     }
                     }
 
 
                     @Override
                     @Override
@@ -510,7 +510,7 @@ public class NotificationWorker extends Worker {
                 signatureVerification = pushUtils.verifySignature(base64DecodedSignature,
                 signatureVerification = pushUtils.verifySignature(base64DecodedSignature,
                         base64DecodedSubject);
                         base64DecodedSubject);
 
 
-                if (signatureVerification.isSignatureValid()) {
+                if (signatureVerification.getSignatureValid()) {
                     Cipher cipher = Cipher.getInstance("RSA/None/PKCS1Padding");
                     Cipher cipher = Cipher.getInstance("RSA/None/PKCS1Padding");
                     cipher.init(Cipher.DECRYPT_MODE, privateKey);
                     cipher.init(Cipher.DECRYPT_MODE, privateKey);
                     byte[] decryptedSubject = cipher.doFinal(base64DecodedSubject);
                     byte[] decryptedSubject = cipher.doFinal(base64DecodedSubject);

+ 0 - 91
app/src/main/java/com/nextcloud/talk/models/ExternalSignalingServer.java

@@ -1,91 +0,0 @@
-/*
- * 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;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-@Parcel
-@JsonObject
-public class ExternalSignalingServer {
-    @JsonField(name = "externalSignalingServer")
-    String externalSignalingServer;
-    @JsonField(name = "externalSignalingTicket")
-    String externalSignalingTicket;
-
-    public String getExternalSignalingServer() {
-        return this.externalSignalingServer;
-    }
-
-    public String getExternalSignalingTicket() {
-        return this.externalSignalingTicket;
-    }
-
-    public void setExternalSignalingServer(String externalSignalingServer) {
-        this.externalSignalingServer = externalSignalingServer;
-    }
-
-    public void setExternalSignalingTicket(String externalSignalingTicket) {
-        this.externalSignalingTicket = externalSignalingTicket;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ExternalSignalingServer)) {
-            return false;
-        }
-        final ExternalSignalingServer other = (ExternalSignalingServer) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$externalSignalingServer = this.getExternalSignalingServer();
-        final Object other$externalSignalingServer = other.getExternalSignalingServer();
-        if (this$externalSignalingServer == null ? other$externalSignalingServer != null : !this$externalSignalingServer.equals(other$externalSignalingServer)) {
-            return false;
-        }
-        final Object this$externalSignalingTicket = this.getExternalSignalingTicket();
-        final Object other$externalSignalingTicket = other.getExternalSignalingTicket();
-
-        return this$externalSignalingTicket == null ? other$externalSignalingTicket == null : this$externalSignalingTicket.equals(other$externalSignalingTicket);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ExternalSignalingServer;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $externalSignalingServer = this.getExternalSignalingServer();
-        result = result * PRIME + ($externalSignalingServer == null ? 43 : $externalSignalingServer.hashCode());
-        final Object $externalSignalingTicket = this.getExternalSignalingTicket();
-        result = result * PRIME + ($externalSignalingTicket == null ? 43 : $externalSignalingTicket.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "ExternalSignalingServer(externalSignalingServer=" + this.getExternalSignalingServer() + ", externalSignalingTicket=" + this.getExternalSignalingTicket() + ")";
-    }
-}

+ 39 - 0
app/src/main/java/com/nextcloud/talk/models/ExternalSignalingServer.kt

@@ -0,0 +1,39 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class ExternalSignalingServer(
+    @JsonField(name = ["externalSignalingServer"])
+    var externalSignalingServer: String? = null,
+    @JsonField(name = ["externalSignalingTicket"])
+    var externalSignalingTicket: String? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 101
app/src/main/java/com/nextcloud/talk/models/LoginData.java

@@ -1,101 +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.models;
-
-import org.parceler.Parcel;
-
-@Parcel
-public class LoginData {
-    String serverUrl;
-    String username;
-    String token;
-
-    public String getServerUrl() {
-        return this.serverUrl;
-    }
-
-    public String getUsername() {
-        return this.username;
-    }
-
-    public String getToken() {
-        return this.token;
-    }
-
-    public void setServerUrl(String serverUrl) {
-        this.serverUrl = serverUrl;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    public void setToken(String token) {
-        this.token = token;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof LoginData)) {
-            return false;
-        }
-        final LoginData other = (LoginData) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$serverUrl = this.getServerUrl();
-        final Object other$serverUrl = other.getServerUrl();
-        if (this$serverUrl == null ? other$serverUrl != null : !this$serverUrl.equals(other$serverUrl)) {
-            return false;
-        }
-        final Object this$username = this.getUsername();
-        final Object other$username = other.getUsername();
-        if (this$username == null ? other$username != null : !this$username.equals(other$username)) {
-            return false;
-        }
-        final Object this$token = this.getToken();
-        final Object other$token = other.getToken();
-
-        return this$token == null ? other$token == null : this$token.equals(other$token);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof LoginData;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $serverUrl = this.getServerUrl();
-        result = result * PRIME + ($serverUrl == null ? 43 : $serverUrl.hashCode());
-        final Object $username = this.getUsername();
-        result = result * PRIME + ($username == null ? 43 : $username.hashCode());
-        final Object $token = this.getToken();
-        result = result * PRIME + ($token == null ? 43 : $token.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "LoginData(serverUrl=" + this.getServerUrl() + ", username=" + this.getUsername() + ", token=" + this.getToken() + ")";
-    }
-}

+ 32 - 0
app/src/main/java/com/nextcloud/talk/models/LoginData.kt

@@ -0,0 +1,32 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class LoginData(
+    var serverUrl: String? = null,
+    var username: String? = null,
+    var token: String? = null
+) : Parcelable

+ 0 - 86
app/src/main/java/com/nextcloud/talk/models/RetrofitBucket.java

@@ -1,86 +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.models;
-
-import org.parceler.Parcel;
-
-import java.util.Map;
-
-@Parcel
-public class RetrofitBucket {
-    public String url;
-    public Map<String, String> queryMap;
-
-    public String getUrl() {
-        return this.url;
-    }
-
-    public Map<String, String> getQueryMap() {
-        return this.queryMap;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public void setQueryMap(Map<String, String> queryMap) {
-        this.queryMap = queryMap;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof RetrofitBucket)) {
-            return false;
-        }
-        final RetrofitBucket other = (RetrofitBucket) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$url = this.getUrl();
-        final Object other$url = other.getUrl();
-        if (this$url == null ? other$url != null : !this$url.equals(other$url)) {
-            return false;
-        }
-        final Object this$queryMap = this.getQueryMap();
-        final Object other$queryMap = other.getQueryMap();
-
-        return this$queryMap == null ? other$queryMap == null : this$queryMap.equals(other$queryMap);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof RetrofitBucket;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $url = this.getUrl();
-        result = result * PRIME + ($url == null ? 43 : $url.hashCode());
-        final Object $queryMap = this.getQueryMap();
-        result = result * PRIME + ($queryMap == null ? 43 : $queryMap.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "RetrofitBucket(url=" + this.getUrl() + ", queryMap=" + this.getQueryMap() + ")";
-    }
-}

+ 31 - 0
app/src/main/java/com/nextcloud/talk/models/RetrofitBucket.kt

@@ -0,0 +1,31 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class RetrofitBucket(
+    var url: String? = null,
+    var queryMap: Map<String, String>? = null
+) : Parcelable

+ 0 - 98
app/src/main/java/com/nextcloud/talk/models/RingtoneSettings.java

@@ -1,98 +0,0 @@
-/*
- * 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;
-
-import android.net.Uri;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.converters.UriTypeConverter;
-
-import org.parceler.Parcel;
-
-import androidx.annotation.Nullable;
-
-@Parcel
-@JsonObject
-public class RingtoneSettings {
-    @JsonField(name = "ringtoneUri", typeConverter = UriTypeConverter.class)
-    @Nullable
-   public Uri ringtoneUri;
-    @JsonField(name = "ringtoneName")
-    public String ringtoneName;
-
-    @Nullable
-    public Uri getRingtoneUri() {
-        return this.ringtoneUri;
-    }
-
-    public String getRingtoneName() {
-        return this.ringtoneName;
-    }
-
-    public void setRingtoneUri(@Nullable Uri ringtoneUri) {
-        this.ringtoneUri = ringtoneUri;
-    }
-
-    public void setRingtoneName(String ringtoneName) {
-        this.ringtoneName = ringtoneName;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof RingtoneSettings)) {
-            return false;
-        }
-        final RingtoneSettings other = (RingtoneSettings) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$ringtoneUri = this.getRingtoneUri();
-        final Object other$ringtoneUri = other.getRingtoneUri();
-        if (this$ringtoneUri == null ? other$ringtoneUri != null : !this$ringtoneUri.equals(other$ringtoneUri)) {
-            return false;
-        }
-        final Object this$ringtoneName = this.getRingtoneName();
-        final Object other$ringtoneName = other.getRingtoneName();
-
-        return this$ringtoneName == null ? other$ringtoneName == null : this$ringtoneName.equals(other$ringtoneName);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof RingtoneSettings;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ringtoneUri = this.getRingtoneUri();
-        result = result * PRIME + ($ringtoneUri == null ? 43 : $ringtoneUri.hashCode());
-        final Object $ringtoneName = this.getRingtoneName();
-        result = result * PRIME + ($ringtoneName == null ? 43 : $ringtoneName.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "RingtoneSettings(ringtoneUri=" + this.getRingtoneUri() + ", ringtoneName=" + this.getRingtoneName() + ")";
-    }
-}

+ 41 - 0
app/src/main/java/com/nextcloud/talk/models/RingtoneSettings.kt

@@ -0,0 +1,41 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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
+
+import android.net.Uri
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.converters.UriTypeConverter
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class RingtoneSettings(
+    @JsonField(name = ["ringtoneUri"], typeConverter = UriTypeConverter::class)
+    var ringtoneUri: Uri? = null,
+    @JsonField(name = ["ringtoneName"])
+    var ringtoneName: String? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 85
app/src/main/java/com/nextcloud/talk/models/SignatureVerification.java

@@ -1,85 +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.models;
-
-
-import com.nextcloud.talk.models.database.UserEntity;
-
-import org.parceler.Parcel;
-
-@Parcel
-public class SignatureVerification {
-    public boolean signatureValid;
-    public UserEntity userEntity;
-
-    public boolean isSignatureValid() {
-        return this.signatureValid;
-    }
-
-    public UserEntity getUserEntity() {
-        return this.userEntity;
-    }
-
-    public void setSignatureValid(boolean signatureValid) {
-        this.signatureValid = signatureValid;
-    }
-
-    public void setUserEntity(UserEntity userEntity) {
-        this.userEntity = userEntity;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof SignatureVerification)) {
-            return false;
-        }
-        final SignatureVerification other = (SignatureVerification) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        if (this.isSignatureValid() != other.isSignatureValid()) {
-            return false;
-        }
-        final Object this$userEntity = this.getUserEntity();
-        final Object other$userEntity = other.getUserEntity();
-
-        return this$userEntity == null ? other$userEntity == null : this$userEntity.equals(other$userEntity);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof SignatureVerification;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        result = result * PRIME + (this.isSignatureValid() ? 79 : 97);
-        final Object $userEntity = this.getUserEntity();
-        result = result * PRIME + ($userEntity == null ? 43 : $userEntity.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "SignatureVerification(signatureValid=" + this.isSignatureValid() + ", userEntity=" + this.getUserEntity() + ")";
-    }
-}

+ 32 - 0
app/src/main/java/com/nextcloud/talk/models/SignatureVerification.kt

@@ -0,0 +1,32 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models
+
+import android.os.Parcelable
+import com.nextcloud.talk.models.database.UserEntity
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class SignatureVerification(
+    var signatureValid: Boolean = false,
+    var userEntity: UserEntity? = null
+) : Parcelable

+ 33 - 0
app/src/main/java/com/nextcloud/talk/models/json/AnyParceler.kt

@@ -0,0 +1,33 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ *
+ * 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.json
+
+import android.os.Parcel
+import kotlinx.android.parcel.Parceler
+
+class AnyParceler : Parceler<Any?> {
+    override fun create(parcel: Parcel): Any? {
+        return parcel.readValue(Any::class.java.getClassLoader())
+    }
+
+    override fun Any?.write(parcel: Parcel, flags: Int) {
+        parcel.writeValue(parcel)
+    }
+}

+ 0 - 694
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.java

@@ -1,694 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Mario Danic
- * @author Tim Krüger
- * Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
- * 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.json.chat;
-
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonIgnore;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.R;
-import com.nextcloud.talk.application.NextcloudTalkApplication;
-import com.nextcloud.talk.models.database.UserEntity;
-import com.nextcloud.talk.models.json.converters.EnumSystemMessageTypeConverter;
-import com.nextcloud.talk.utils.ApiUtils;
-import com.stfalcon.chatkit.commons.models.IUser;
-import com.stfalcon.chatkit.commons.models.MessageContentType;
-
-import org.parceler.Parcel;
-
-import java.security.MessageDigest;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-import androidx.annotation.Nullable;
-import kotlin.text.Charsets;
-
-@Parcel
-@JsonObject
-public class ChatMessage implements MessageContentType, MessageContentType.Image {
-    private static String TAG = "ChatMessage";
-
-    @JsonIgnore
-    public boolean isGrouped;
-    @JsonIgnore
-    public boolean isOneToOneConversation;
-    @JsonIgnore
-    public UserEntity activeUser;
-    @JsonIgnore
-    public Map<String, String> selectedIndividualHashMap;
-    @JsonIgnore
-    public boolean isDeleted;
-    @JsonField(name = "id")
-    public int jsonMessageId;
-    @JsonIgnore
-    public int previousMessageId = -1;
-    @JsonField(name = "token")
-    public String token;
-    // guests or users
-    @JsonField(name = "actorType")
-    public String actorType;
-    @JsonField(name = "actorId")
-    public String actorId;
-    // send when crafting a message
-    @JsonField(name = "actorDisplayName")
-    public String actorDisplayName;
-    @JsonField(name = "timestamp")
-    public long timestamp;
-    // send when crafting a message, max 1000 lines
-    @JsonField(name = "message")
-    public String message;
-    @JsonField(name = "messageParameters")
-    public HashMap<String, HashMap<String, String>> messageParameters;
-    @JsonField(name = "systemMessage", typeConverter = EnumSystemMessageTypeConverter.class)
-    public SystemMessageType systemMessageType;
-    @JsonField(name = "isReplyable")
-    public boolean replyable;
-    @JsonField(name = "parent")
-    public ChatMessage parentMessage;
-    public Enum<ReadStatus> readStatus = ReadStatus.NONE;
-    @JsonField(name = "messageType")
-    public String messageType;
-    @JsonField(name = "reactions")
-    public LinkedHashMap<String, Integer> reactions;
-    @JsonField(name = "reactionsSelf")
-    public ArrayList<String> reactionsSelf;
-
-    public boolean isDownloadingVoiceMessage;
-    public boolean resetVoiceMessage;
-    public boolean isPlayingVoiceMessage;
-    public int voiceMessageDuration;
-    public int voiceMessagePlayedSeconds;
-    public int voiceMessageDownloadProgress;
-
-    @JsonIgnore
-    List<MessageType> messageTypesToIgnore = Arrays.asList(
-        MessageType.REGULAR_TEXT_MESSAGE,
-        MessageType.SYSTEM_MESSAGE,
-        MessageType.SINGLE_LINK_VIDEO_MESSAGE,
-        MessageType.SINGLE_LINK_AUDIO_MESSAGE,
-        MessageType.SINGLE_LINK_MESSAGE,
-        MessageType.SINGLE_NC_GEOLOCATION_MESSAGE,
-        MessageType.VOICE_MESSAGE);
-
-    public boolean hasFileAttachment() {
-        if (messageParameters != null && messageParameters.size() > 0) {
-            for (HashMap.Entry<String, HashMap<String, String>> entry : messageParameters.entrySet()) {
-                Map<String, String> individualHashMap = entry.getValue();
-                if (MessageDigest.isEqual(
-                    Objects.requireNonNull(individualHashMap.get("type")).getBytes(Charsets.UTF_8),
-                    ("file").getBytes(Charsets.UTF_8))) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    public boolean hasGeoLocation() {
-        if (messageParameters != null && messageParameters.size() > 0) {
-            for (HashMap.Entry<String, HashMap<String, String>> entry : messageParameters.entrySet()) {
-                Map<String, String> individualHashMap = entry.getValue();
-
-                if (MessageDigest.isEqual(
-                    Objects.requireNonNull(individualHashMap.get("type")).getBytes(Charsets.UTF_8),
-                    ("geo-location").getBytes(Charsets.UTF_8))) {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-    @Nullable
-    @Override
-    public String getImageUrl() {
-        if (messageParameters != null && messageParameters.size() > 0) {
-            for (HashMap.Entry<String, HashMap<String, String>> entry : messageParameters.entrySet()) {
-                Map<String, String> individualHashMap = entry.getValue();
-                if (MessageDigest.isEqual(
-                    Objects.requireNonNull(individualHashMap.get("type")).getBytes(Charsets.UTF_8),
-                    ("file").getBytes(Charsets.UTF_8))) {
-
-                    // TODO: this selectedIndividualHashMap stuff needs to be analyzed and most likely be refactored!
-                    //  it just feels wrong to fill this here inside getImageUrl()
-                    selectedIndividualHashMap = individualHashMap;
-                    if (!isVoiceMessage()) {
-                        if (getActiveUser() != null && getActiveUser().getBaseUrl() != null) {
-                            return (ApiUtils.getUrlForFilePreviewWithFileId(
-                                getActiveUser().getBaseUrl(),
-                                individualHashMap.get("id"),
-                                NextcloudTalkApplication.Companion.getSharedApplication().getResources().getDimensionPixelSize(R.dimen.maximum_file_preview_size)));
-                        } else {
-                            Log.e(TAG, "getActiveUser() or getActiveUser().getBaseUrl() were null when trying to " +
-                                "getImageUrl()");
-                        }
-                    }
-                }
-            }
-        }
-
-        if (!messageTypesToIgnore.contains(getMessageType())) {
-            return getMessage().trim();
-        }
-
-        return null;
-    }
-
-    public MessageType getMessageType() {
-        if (!TextUtils.isEmpty(getSystemMessage())) {
-            return MessageType.SYSTEM_MESSAGE;
-        }
-
-        if (isVoiceMessage()) {
-            return MessageType.VOICE_MESSAGE;
-        }
-
-        if (hasFileAttachment()) {
-            return MessageType.SINGLE_NC_ATTACHMENT_MESSAGE;
-        }
-
-        if (hasGeoLocation()) {
-            return MessageType.SINGLE_NC_GEOLOCATION_MESSAGE;
-        }
-
-
-        return MessageType.REGULAR_TEXT_MESSAGE;
-    }
-
-    public Map<String, String> getSelectedIndividualHashMap() {
-        return selectedIndividualHashMap;
-    }
-
-    public void setSelectedIndividualHashMap(Map<String, String> selectedIndividualHashMap) {
-        this.selectedIndividualHashMap = selectedIndividualHashMap;
-    }
-
-    @Override
-    public String getId() {
-        return Integer.toString(jsonMessageId);
-    }
-
-    @Override
-    public String getText() {
-        return ChatUtils.Companion.getParsedMessage(getMessage(), getMessageParameters());
-    }
-
-    public String getLastMessageDisplayText() {
-        if (getMessageType().equals(MessageType.REGULAR_TEXT_MESSAGE) || getMessageType().equals(MessageType.SYSTEM_MESSAGE) || getMessageType().equals(MessageType.SINGLE_LINK_MESSAGE)) {
-            return getText();
-        } else {
-            if (MessageType.SINGLE_LINK_GIPHY_MESSAGE == getMessageType()
-                || MessageType.SINGLE_LINK_TENOR_MESSAGE == getMessageType()
-                || MessageType.SINGLE_LINK_GIF_MESSAGE == getMessageType()) {
-                if (getActorId().equals(getActiveUser().getUserId())) {
-                    return (NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_sent_a_gif_you));
-                } else {
-                    return (String.format(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_sent_a_gif),
-                                          !TextUtils.isEmpty(getActorDisplayName()) ? getActorDisplayName() : NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest)));
-                }
-            } else if (MessageType.SINGLE_NC_ATTACHMENT_MESSAGE == getMessageType()) {
-                if (getActorId().equals(getActiveUser().getUserId())) {
-                    return (NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_sent_an_attachment_you));
-                } else {
-                    return (String.format(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_sent_an_attachment),
-                                          !TextUtils.isEmpty(getActorDisplayName()) ? getActorDisplayName() : NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest)));
-                }
-            } else if (MessageType.SINGLE_NC_GEOLOCATION_MESSAGE == getMessageType()) {
-                if (getActorId().equals(getActiveUser().getUserId())) {
-                    return (NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_sent_location_you));
-                } else {
-                    return (String.format(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_sent_location),
-                                          !TextUtils.isEmpty(getActorDisplayName()) ? getActorDisplayName() : NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest)));
-                }
-            } else if (MessageType.VOICE_MESSAGE == getMessageType()) {
-                if (getActorId().equals(getActiveUser().getUserId())) {
-                    return (NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_sent_voice_you));
-                } else {
-                    return (String.format(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_sent_voice),
-                                          !TextUtils.isEmpty(getActorDisplayName()) ? getActorDisplayName() : NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest)));
-                }
-            /*} else if (getMessageType().equals(MessageType.SINGLE_LINK_MESSAGE)) {
-                if (getActorId().equals(getActiveUser().getUserId())) {
-                    return (NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_sent_a_link_you));
-                } else {
-                    return (String.format(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_sent_a_link),
-                            !TextUtils.isEmpty(getActorDisplayName()) ? getActorDisplayName() : NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest)));
-                }*/
-            } else if (MessageType.SINGLE_LINK_AUDIO_MESSAGE == getMessageType()) {
-                if (getActorId().equals(getActiveUser().getUserId())) {
-                    return (NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_sent_an_audio_you));
-                } else {
-                    return (String.format(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_sent_an_audio),
-                                          !TextUtils.isEmpty(getActorDisplayName()) ? getActorDisplayName() : NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest)));
-                }
-            } else if (MessageType.SINGLE_LINK_VIDEO_MESSAGE == getMessageType()) {
-                if (getActorId().equals(getActiveUser().getUserId())) {
-                    return (NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_sent_a_video_you));
-                } else {
-                    return (String.format(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_sent_a_video),
-                                          !TextUtils.isEmpty(getActorDisplayName()) ? getActorDisplayName() : NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest)));
-                }
-            } else if (MessageType.SINGLE_LINK_IMAGE_MESSAGE == getMessageType()) {
-                if (getActorId().equals(getActiveUser().getUserId())) {
-                    return (NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_sent_an_image_you));
-                } else {
-                    return (String.format(NextcloudTalkApplication.Companion.getSharedApplication().getResources().getString(R.string.nc_sent_an_image),
-                                          !TextUtils.isEmpty(getActorDisplayName()) ? getActorDisplayName() : NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest)));
-                }
-            }
-        }
-
-        return "";
-    }
-
-    @Override
-    public IUser getUser() {
-        return new IUser() {
-            @Override
-            public String getId() {
-                return actorType + "/" + actorId;
-            }
-
-            @Override
-            public String getName() {
-                if (!TextUtils.isEmpty(actorDisplayName)) {
-                    return actorDisplayName;
-                }
-
-                return NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest);
-            }
-
-            @Override
-            public String getAvatar() {
-                if (getActiveUser() == null) {
-                    return null;
-                } else if (getActorType().equals("users")) {
-                    return ApiUtils.getUrlForAvatar(getActiveUser().getBaseUrl(), actorId, true);
-                } else if (getActorType().equals("bridged")) {
-                    return ApiUtils.getUrlForAvatar(getActiveUser().getBaseUrl(), "bridge-bot",
-                                                    true);
-                } else {
-                    String apiId =
-                        NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_guest);
-
-                    if (!TextUtils.isEmpty(getActorDisplayName())) {
-                        apiId = getActorDisplayName();
-                    }
-                    return ApiUtils.getUrlForGuestAvatar(getActiveUser().getBaseUrl(), apiId, true);
-                }
-            }
-        };
-    }
-
-    @Override
-    public Date getCreatedAt() {
-        return new Date(timestamp * 1000L);
-    }
-
-    @Override
-    public String getSystemMessage() {
-        return new EnumSystemMessageTypeConverter().convertToString(getSystemMessageType());
-    }
-
-    public boolean isGrouped() {
-        return this.isGrouped;
-    }
-
-    public boolean isOneToOneConversation() {
-        return this.isOneToOneConversation;
-    }
-
-    public UserEntity getActiveUser() {
-        return this.activeUser;
-    }
-
-    public boolean isDeleted() {
-        return this.isDeleted;
-    }
-
-    public int getJsonMessageId() {
-        return this.jsonMessageId;
-    }
-
-    public String getToken() {
-        return this.token;
-    }
-
-    public String getActorType() {
-        return this.actorType;
-    }
-
-    public String getActorId() {
-        return this.actorId;
-    }
-
-    public String getActorDisplayName() {
-        return this.actorDisplayName;
-    }
-
-    public long getTimestamp() {
-        return this.timestamp;
-    }
-
-    public String getMessage() {
-        return this.message;
-    }
-
-    public HashMap<String, HashMap<String, String>> getMessageParameters() {
-        return this.messageParameters;
-    }
-
-    public SystemMessageType getSystemMessageType() {
-        return this.systemMessageType;
-    }
-
-    public boolean isReplyable() {
-        return this.replyable;
-    }
-
-    public ChatMessage getParentMessage() {
-        return this.parentMessage;
-    }
-
-    public Enum<ReadStatus> getReadStatus() {
-        return this.readStatus;
-    }
-
-    public List<MessageType> getMessageTypesToIgnore() {
-        return this.messageTypesToIgnore;
-    }
-
-    public void setGrouped(boolean isGrouped) {
-        this.isGrouped = isGrouped;
-    }
-
-    public void setOneToOneConversation(boolean isOneToOneConversation) {
-        this.isOneToOneConversation = isOneToOneConversation;
-    }
-
-    public void setActiveUser(UserEntity activeUser) {
-        this.activeUser = activeUser;
-    }
-
-    public void setDeleted(boolean isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public void setJsonMessageId(int jsonMessageId) {
-        this.jsonMessageId = jsonMessageId;
-    }
-
-    public void setToken(String token) {
-        this.token = token;
-    }
-
-    public void setActorType(String actorType) {
-        this.actorType = actorType;
-    }
-
-    public void setActorId(String actorId) {
-        this.actorId = actorId;
-    }
-
-    public void setActorDisplayName(String actorDisplayName) {
-        this.actorDisplayName = actorDisplayName;
-    }
-
-    public void setTimestamp(long timestamp) {
-        this.timestamp = timestamp;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public void setMessageParameters(HashMap<String, HashMap<String, String>> messageParameters) {
-        this.messageParameters = messageParameters;
-    }
-
-    public void setSystemMessageType(SystemMessageType systemMessageType) {
-        this.systemMessageType = systemMessageType;
-    }
-
-    public void setReplyable(boolean replyable) {
-        this.replyable = replyable;
-    }
-
-    public void setParentMessage(ChatMessage parentMessage) {
-        this.parentMessage = parentMessage;
-    }
-
-    public void setReadStatus(Enum<ReadStatus> readStatus) {
-        this.readStatus = readStatus;
-    }
-
-    public void setMessageTypesToIgnore(List<MessageType> messageTypesToIgnore) {
-        this.messageTypesToIgnore = messageTypesToIgnore;
-    }
-
-    public void setMessageType(String messageType) {
-        this.messageType = messageType;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatMessage)) {
-            return false;
-        }
-        final ChatMessage other = (ChatMessage) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        if (this.isGrouped() != other.isGrouped()) {
-            return false;
-        }
-        if (this.isOneToOneConversation() != other.isOneToOneConversation()) {
-            return false;
-        }
-        final Object this$activeUser = this.getActiveUser();
-        final Object other$activeUser = other.getActiveUser();
-        if (this$activeUser == null ? other$activeUser != null : !this$activeUser.equals(other$activeUser)) {
-            return false;
-        }
-        final Object this$selectedIndividualHashMap = this.getSelectedIndividualHashMap();
-        final Object other$selectedIndividualHashMap = other.getSelectedIndividualHashMap();
-        if (this$selectedIndividualHashMap == null ? other$selectedIndividualHashMap != null : !this$selectedIndividualHashMap.equals(other$selectedIndividualHashMap)) {
-            return false;
-        }
-        if (this.isDeleted() != other.isDeleted()) {
-            return false;
-        }
-        if (this.getJsonMessageId() != other.getJsonMessageId()) {
-            return false;
-        }
-        final Object this$token = this.getToken();
-        final Object other$token = other.getToken();
-        if (this$token == null ? other$token != null : !this$token.equals(other$token)) {
-            return false;
-        }
-        final Object this$actorType = this.getActorType();
-        final Object other$actorType = other.getActorType();
-        if (this$actorType == null ? other$actorType != null : !this$actorType.equals(other$actorType)) {
-            return false;
-        }
-        final Object this$actorId = this.getActorId();
-        final Object other$actorId = other.getActorId();
-        if (this$actorId == null ? other$actorId != null : !this$actorId.equals(other$actorId)) {
-            return false;
-        }
-        final Object this$actorDisplayName = this.getActorDisplayName();
-        final Object other$actorDisplayName = other.getActorDisplayName();
-        if (this$actorDisplayName == null ? other$actorDisplayName != null : !this$actorDisplayName.equals(other$actorDisplayName)) {
-            return false;
-        }
-        if (this.getTimestamp() != other.getTimestamp()) {
-            return false;
-        }
-        final Object this$message = this.getMessage();
-        final Object other$message = other.getMessage();
-        if (this$message == null ? other$message != null : !this$message.equals(other$message)) {
-            return false;
-        }
-        final Object this$messageParameters = this.getMessageParameters();
-        final Object other$messageParameters = other.getMessageParameters();
-        if (this$messageParameters == null ? other$messageParameters != null : !this$messageParameters.equals(other$messageParameters)) {
-            return false;
-        }
-        final Object this$systemMessageType = this.getSystemMessageType();
-        final Object other$systemMessageType = other.getSystemMessageType();
-        if (this$systemMessageType == null ? other$systemMessageType != null : !this$systemMessageType.equals(other$systemMessageType)) {
-            return false;
-        }
-        if (this.isReplyable() != other.isReplyable()) {
-            return false;
-        }
-        final Object this$parentMessage = this.getParentMessage();
-        final Object other$parentMessage = other.getParentMessage();
-        if (this$parentMessage == null ? other$parentMessage != null : !this$parentMessage.equals(other$parentMessage)) {
-            return false;
-        }
-        final Object this$readStatus = this.getReadStatus();
-        final Object other$readStatus = other.getReadStatus();
-        if (this$readStatus == null ? other$readStatus != null : !this$readStatus.equals(other$readStatus)) {
-            return false;
-        }
-        final Object this$messageTypesToIgnore = this.getMessageTypesToIgnore();
-        final Object other$messageTypesToIgnore = other.getMessageTypesToIgnore();
-
-        return this$messageTypesToIgnore == null ? other$messageTypesToIgnore == null : this$messageTypesToIgnore.equals(other$messageTypesToIgnore);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatMessage;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        result = result * PRIME + (this.isGrouped() ? 79 : 97);
-        result = result * PRIME + (this.isOneToOneConversation() ? 79 : 97);
-        final Object $activeUser = this.getActiveUser();
-        result = result * PRIME + ($activeUser == null ? 43 : $activeUser.hashCode());
-        final Object $selectedIndividualHashMap = this.getSelectedIndividualHashMap();
-        result = result * PRIME + ($selectedIndividualHashMap == null ? 43 : $selectedIndividualHashMap.hashCode());
-        result = result * PRIME + (this.isDeleted() ? 79 : 97);
-        result = result * PRIME + this.getJsonMessageId();
-        final Object $token = this.getToken();
-        result = result * PRIME + ($token == null ? 43 : $token.hashCode());
-        final Object $actorType = this.getActorType();
-        result = result * PRIME + ($actorType == null ? 43 : $actorType.hashCode());
-        final Object $actorId = this.getActorId();
-        result = result * PRIME + ($actorId == null ? 43 : $actorId.hashCode());
-        final Object $actorDisplayName = this.getActorDisplayName();
-        result = result * PRIME + ($actorDisplayName == null ? 43 : $actorDisplayName.hashCode());
-        final long $timestamp = this.getTimestamp();
-        result = result * PRIME + (int) ($timestamp >>> 32 ^ $timestamp);
-        final Object $message = this.getMessage();
-        result = result * PRIME + ($message == null ? 43 : $message.hashCode());
-        final Object $messageParameters = this.getMessageParameters();
-        result = result * PRIME + ($messageParameters == null ? 43 : $messageParameters.hashCode());
-        final Object $systemMessageType = this.getSystemMessageType();
-        result = result * PRIME + ($systemMessageType == null ? 43 : $systemMessageType.hashCode());
-        result = result * PRIME + (this.isReplyable() ? 79 : 97);
-        final Object $parentMessage = this.getParentMessage();
-        result = result * PRIME + ($parentMessage == null ? 43 : $parentMessage.hashCode());
-        final Object $readStatus = this.getReadStatus();
-        result = result * PRIME + ($readStatus == null ? 43 : $readStatus.hashCode());
-        final Object $messageTypesToIgnore = this.getMessageTypesToIgnore();
-        result = result * PRIME + ($messageTypesToIgnore == null ? 43 : $messageTypesToIgnore.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "ChatMessage(isGrouped=" + this.isGrouped() + ", isOneToOneConversation=" + this.isOneToOneConversation() + ", activeUser=" + this.getActiveUser() + ", selectedIndividualHashMap=" + this.getSelectedIndividualHashMap() + ", isDeleted=" + this.isDeleted() + ", jsonMessageId=" + this.getJsonMessageId() + ", token=" + this.getToken() + ", actorType=" + this.getActorType() + ", actorId=" + this.getActorId() + ", actorDisplayName=" + this.getActorDisplayName() + ", timestamp=" + this.getTimestamp() + ", message=" + this.getMessage() + ", messageParameters=" + this.getMessageParameters() + ", systemMessageType=" + this.getSystemMessageType() + ", replyable=" + this.isReplyable() + ", parentMessage=" + this.getParentMessage() + ", readStatus=" + this.getReadStatus() + ", messageTypesToIgnore=" + this.getMessageTypesToIgnore() + ")";
-    }
-
-    public boolean isVoiceMessage() {
-        return "voice-message".equals(messageType);
-    }
-
-    public boolean isCommandMessage() {
-        return "command".equals(messageType);
-    }
-
-    public boolean isDeletedCommentMessage() {
-        return "comment_deleted".equals(messageType);
-    }
-
-    public enum MessageType {
-        REGULAR_TEXT_MESSAGE,
-        SYSTEM_MESSAGE,
-        SINGLE_LINK_GIPHY_MESSAGE,
-        SINGLE_LINK_TENOR_MESSAGE,
-        SINGLE_LINK_GIF_MESSAGE,
-        SINGLE_LINK_MESSAGE,
-        SINGLE_LINK_VIDEO_MESSAGE,
-        SINGLE_LINK_IMAGE_MESSAGE,
-        SINGLE_LINK_AUDIO_MESSAGE,
-        SINGLE_NC_ATTACHMENT_MESSAGE,
-        SINGLE_NC_GEOLOCATION_MESSAGE,
-        VOICE_MESSAGE
-    }
-
-    /**
-     * see https://nextcloud-talk.readthedocs.io/en/latest/chat/#system-messages
-     */
-    public enum SystemMessageType {
-        DUMMY,
-        CONVERSATION_CREATED,
-        CONVERSATION_RENAMED,
-        DESCRIPTION_REMOVED,
-        DESCRIPTION_SET,
-        CALL_STARTED,
-        CALL_JOINED,
-        CALL_LEFT,
-        CALL_ENDED,
-        CALL_ENDED_EVERYONE,
-        CALL_MISSED,
-        CALL_TRIED,
-        READ_ONLY_OFF,
-        READ_ONLY,
-        LISTABLE_NONE,
-        LISTABLE_USERS,
-        LISTABLE_ALL,
-        LOBBY_NONE,
-        LOBBY_NON_MODERATORS,
-        LOBBY_OPEN_TO_EVERYONE,
-        GUESTS_ALLOWED,
-        GUESTS_DISALLOWED,
-        PASSWORD_SET,
-        PASSWORD_REMOVED,
-        USER_ADDED,
-        USER_REMOVED,
-        GROUP_ADDED,
-        GROUP_REMOVED,
-        CIRCLE_ADDED,
-        CIRCLE_REMOVED,
-        MODERATOR_PROMOTED,
-        MODERATOR_DEMOTED,
-        GUEST_MODERATOR_PROMOTED,
-        GUEST_MODERATOR_DEMOTED,
-        MESSAGE_DELETED,
-        FILE_SHARED,
-        OBJECT_SHARED,
-        MATTERBRIDGE_CONFIG_ADDED,
-        MATTERBRIDGE_CONFIG_EDITED,
-        MATTERBRIDGE_CONFIG_REMOVED,
-        MATTERBRIDGE_CONFIG_ENABLED,
-        MATTERBRIDGE_CONFIG_DISABLED,
-        CLEARED_CHAT,
-        REACTION,
-        REACTION_DELETED,
-        REACTION_REVOKED
-    }
-}

+ 473 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatMessage.kt

@@ -0,0 +1,473 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Tim Krüger
+ * @author Marcel Hibbe
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
+ * Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
+ * 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.json.chat
+
+import android.os.Parcelable
+import android.text.TextUtils
+import android.util.Log
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonIgnore
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.R
+import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
+import com.nextcloud.talk.models.database.UserEntity
+import com.nextcloud.talk.models.json.chat.ChatUtils.Companion.getParsedMessage
+import com.nextcloud.talk.models.json.converters.EnumSystemMessageTypeConverter
+import com.nextcloud.talk.utils.ApiUtils
+import com.stfalcon.chatkit.commons.models.IUser
+import com.stfalcon.chatkit.commons.models.MessageContentType
+import kotlinx.android.parcel.Parcelize
+import java.security.MessageDigest
+import java.util.ArrayList
+import java.util.Arrays
+import java.util.Date
+import java.util.HashMap
+import java.util.LinkedHashMap
+
+@Parcelize
+@JsonObject
+data class ChatMessage(
+    @JsonIgnore
+    var isGrouped: Boolean = false,
+
+    @JsonIgnore
+    var isOneToOneConversation: Boolean = false,
+
+    @JsonIgnore
+    var activeUser: UserEntity? = null,
+
+    @JsonIgnore
+    var selectedIndividualHashMap: Map<String?, String?>? = null,
+
+    @JsonIgnore
+    var isDeleted: Boolean = false,
+
+    @JsonField(name = ["id"])
+    var jsonMessageId: Int = 0,
+
+    @JsonIgnore
+    var previousMessageId: Int = -1,
+
+    @JsonField(name = ["token"])
+    var token: String? = null,
+
+    // guests or users
+    @JsonField(name = ["actorType"])
+    var actorType: String? = null,
+
+    @JsonField(name = ["actorId"])
+    var actorId: String? = null,
+
+    // send when crafting a message
+    @JsonField(name = ["actorDisplayName"])
+    var actorDisplayName: String? = null,
+
+    @JsonField(name = ["timestamp"])
+    var timestamp: Long = 0,
+
+    // send when crafting a message, max 1000 lines
+    @JsonField(name = ["message"])
+    var message: String? = null,
+
+    @JsonField(name = ["messageParameters"])
+    var messageParameters: HashMap<String?, HashMap<String?, String?>>? = null,
+
+    @JsonField(name = ["systemMessage"], typeConverter = EnumSystemMessageTypeConverter::class)
+    var systemMessageType: SystemMessageType? = null,
+
+    @JsonField(name = ["isReplyable"])
+    var replyable: Boolean = false,
+
+    @JsonField(name = ["parent"])
+    var parentMessage: ChatMessage? = null,
+
+    var readStatus: Enum<ReadStatus> = ReadStatus.NONE,
+
+    @JsonField(name = ["messageType"])
+    var messageType: String? = null,
+
+    @JsonField(name = ["reactions"])
+    var reactions: LinkedHashMap<String, Int>? = null,
+
+    @JsonField(name = ["reactionsSelf"])
+    var reactionsSelf: ArrayList<String>? = null,
+
+    var isDownloadingVoiceMessage: Boolean = false,
+
+    var resetVoiceMessage: Boolean = false,
+
+    var isPlayingVoiceMessage: Boolean = false,
+
+    var voiceMessageDuration: Int = 0,
+
+    var voiceMessagePlayedSeconds: Int = 0,
+
+    var voiceMessageDownloadProgress: Int = 0,
+) : Parcelable, MessageContentType, MessageContentType.Image {
+    @JsonIgnore
+    var messageTypesToIgnore = Arrays.asList(
+        MessageType.REGULAR_TEXT_MESSAGE,
+        MessageType.SYSTEM_MESSAGE,
+        MessageType.SINGLE_LINK_VIDEO_MESSAGE,
+        MessageType.SINGLE_LINK_AUDIO_MESSAGE,
+        MessageType.SINGLE_LINK_MESSAGE,
+        MessageType.SINGLE_NC_GEOLOCATION_MESSAGE,
+        MessageType.VOICE_MESSAGE
+    )
+
+    fun hasFileAttachment(): Boolean {
+        if (messageParameters != null && messageParameters!!.size > 0) {
+            for ((_, individualHashMap) in messageParameters!!) {
+                if (MessageDigest.isEqual(
+                        individualHashMap["type"]!!.toByteArray(),
+                        "file".toByteArray()
+                    )
+                ) {
+                    return true
+                }
+            }
+        }
+        return false
+    }
+
+    fun hasGeoLocation(): Boolean {
+        if (messageParameters != null && messageParameters!!.size > 0) {
+            for ((_, individualHashMap) in messageParameters!!) {
+                if (MessageDigest.isEqual(
+                        individualHashMap["type"]!!.toByteArray(),
+                        "geo-location".toByteArray()
+                    )
+                ) {
+                    return true
+                }
+            }
+        }
+        return false
+    }
+
+    override fun getImageUrl(): String? {
+        if (messageParameters != null && messageParameters!!.size > 0) {
+            for ((_, individualHashMap) in messageParameters!!) {
+                if (MessageDigest.isEqual(
+                        individualHashMap["type"]!!.toByteArray(),
+                        "file".toByteArray()
+                    )
+                ) {
+                    // FIX-ME: this selectedIndividualHashMap stuff needs to be analyzed and most likely be refactored!
+                    //  it just feels wrong to fill this here inside getImageUrl()
+                    selectedIndividualHashMap = individualHashMap
+                    if (!isVoiceMessage) {
+                        if (activeUser != null && activeUser!!.baseUrl != null) {
+                            return ApiUtils.getUrlForFilePreviewWithFileId(
+                                activeUser!!.baseUrl,
+                                individualHashMap["id"],
+                                sharedApplication!!.resources.getDimensionPixelSize(R.dimen.maximum_file_preview_size)
+                            )
+                        } else {
+                            Log.e(
+                                TAG,
+                                "activeUser or activeUser.getBaseUrl() were null when trying to getImageUrl()"
+                            )
+                        }
+                    }
+                }
+            }
+        }
+        return if (!messageTypesToIgnore.contains(getCalculateMessageType())) {
+            message!!.trim { it <= ' ' }
+        } else null
+    }
+
+    fun getCalculateMessageType(): MessageType {
+        return if (!TextUtils.isEmpty(systemMessage)) {
+            MessageType.SYSTEM_MESSAGE
+        } else if (isVoiceMessage) {
+            MessageType.VOICE_MESSAGE
+        } else if (hasFileAttachment()) {
+            MessageType.SINGLE_NC_ATTACHMENT_MESSAGE
+        } else if (hasGeoLocation()) {
+            MessageType.SINGLE_NC_GEOLOCATION_MESSAGE
+        } else {
+            MessageType.REGULAR_TEXT_MESSAGE
+        }
+    }
+
+    override fun getId(): String {
+        return jsonMessageId.toString()
+    }
+
+    override fun getText(): String {
+        return getParsedMessage(message, messageParameters)!!
+    }
+
+    /*} else if (getCalculateMessageType().equals(MessageType.SINGLE_LINK_MESSAGE)) {
+                if (actorId.equals(activeUser.getUserId())) {
+                    return (
+                    NextcloudTalkApplication
+                    .Companion.getSharedApplication()
+                    .getString(R.string.nc_sent_a_link_you)
+                    );
+                } else {
+                    return (String.format(NextcloudTalkApplication.
+                    Companion.
+                    getSharedApplication().
+                    getResources().
+                    getString(R.string.nc_sent_a_link),
+                            !TextUtils.isEmpty(actorDisplayName) ? actorDisplayName : NextcloudTalkApplication.
+                            Companion.
+                            getSharedApplication().
+                            getString(R.string.nc_guest))
+                            );
+                }*/
+    val lastMessageDisplayText: String
+        get() {
+            if (getCalculateMessageType() == MessageType.REGULAR_TEXT_MESSAGE ||
+                getCalculateMessageType() == MessageType.SYSTEM_MESSAGE ||
+                getCalculateMessageType() == MessageType.SINGLE_LINK_MESSAGE
+            ) {
+                return text
+            } else {
+                if (MessageType.SINGLE_LINK_GIPHY_MESSAGE == getCalculateMessageType() ||
+                    MessageType.SINGLE_LINK_TENOR_MESSAGE == getCalculateMessageType() ||
+                    MessageType.SINGLE_LINK_GIF_MESSAGE == getCalculateMessageType()
+                ) {
+                    return if (actorId == activeUser!!.userId) {
+                        sharedApplication!!.getString(R.string.nc_sent_a_gif_you)
+                    } else {
+                        String.format(
+                            sharedApplication!!.resources.getString(R.string.nc_sent_a_gif),
+                            getNullsafeActorDisplayName()
+                        )
+                    }
+                } else if (MessageType.SINGLE_NC_ATTACHMENT_MESSAGE == getCalculateMessageType()) {
+                    return if (actorId == activeUser!!.userId) {
+                        sharedApplication!!.getString(R.string.nc_sent_an_attachment_you)
+                    } else {
+                        String.format(
+                            sharedApplication!!.resources.getString(R.string.nc_sent_an_attachment),
+                            getNullsafeActorDisplayName()
+                        )
+                    }
+                } else if (MessageType.SINGLE_NC_GEOLOCATION_MESSAGE == getCalculateMessageType()) {
+                    return if (actorId == activeUser!!.userId) {
+                        sharedApplication!!.getString(R.string.nc_sent_location_you)
+                    } else {
+                        String.format(
+                            sharedApplication!!.resources.getString(R.string.nc_sent_location),
+                            getNullsafeActorDisplayName()
+                        )
+                    }
+                } else if (MessageType.VOICE_MESSAGE == getCalculateMessageType()) {
+                    return if (actorId == activeUser!!.userId) {
+                        sharedApplication!!.getString(R.string.nc_sent_voice_you)
+                    } else {
+                        String.format(
+                            sharedApplication!!.resources.getString(R.string.nc_sent_voice),
+                            getNullsafeActorDisplayName()
+                        )
+                    }
+                    /*} else if (getCalculateMessageType().equals(MessageType.SINGLE_LINK_MESSAGE)) {
+                if (actorId.equals(activeUser.getUserId())) {
+                    return (
+                    NextcloudTalkApplication
+                    .Companion
+                    .getSharedApplication()
+                    .getString(R.string.nc_sent_a_link_you)
+                    );
+                } else {
+                    return (String.format(
+                    NextcloudTalkApplication
+                    .Companion
+                    .getSharedApplication()
+                    .getResources()
+                    .getString(R.string.nc_sent_a_link),
+                            !TextUtils.isEmpty(actorDisplayName) ? actorDisplayName : NextcloudTalkApplication.
+                            Companion.
+                            getSharedApplication().
+                            getString(R.string.nc_guest))
+                            );
+                }*/
+                } else if (MessageType.SINGLE_LINK_AUDIO_MESSAGE == getCalculateMessageType()) {
+                    return if (actorId == activeUser!!.userId) {
+                        sharedApplication!!.getString(R.string.nc_sent_an_audio_you)
+                    } else {
+                        String.format(
+                            sharedApplication!!.resources.getString(R.string.nc_sent_an_audio),
+                            getNullsafeActorDisplayName()
+                        )
+                    }
+                } else if (MessageType.SINGLE_LINK_VIDEO_MESSAGE == getCalculateMessageType()) {
+                    return if (actorId == activeUser!!.userId) {
+                        sharedApplication!!.getString(R.string.nc_sent_a_video_you)
+                    } else {
+                        String.format(
+                            sharedApplication!!.resources.getString(R.string.nc_sent_a_video),
+                            getNullsafeActorDisplayName()
+                        )
+                    }
+                } else if (MessageType.SINGLE_LINK_IMAGE_MESSAGE == getCalculateMessageType()) {
+                    return if (actorId == activeUser!!.userId) {
+                        sharedApplication!!.getString(R.string.nc_sent_an_image_you)
+                    } else {
+                        String.format(
+                            sharedApplication!!.resources.getString(R.string.nc_sent_an_image),
+                            getNullsafeActorDisplayName()
+                        )
+                    }
+                }
+            }
+            return ""
+        }
+
+    private fun getNullsafeActorDisplayName() = if (!TextUtils.isEmpty(actorDisplayName)) {
+        actorDisplayName
+    } else {
+        sharedApplication!!.getString(R.string.nc_guest)
+    }
+
+    override fun getUser(): IUser {
+        return object : IUser {
+            override fun getId(): String {
+                return "$actorType/$actorId"
+            }
+
+            override fun getName(): String {
+                return if (!TextUtils.isEmpty(actorDisplayName)) {
+                    actorDisplayName!!
+                } else sharedApplication!!.getString(R.string.nc_guest)
+            }
+
+            override fun getAvatar(): String? {
+                return when {
+                    activeUser == null -> {
+                        null
+                    }
+                    actorType == "users" -> {
+                        ApiUtils.getUrlForAvatar(activeUser!!.baseUrl, actorId, true)
+                    }
+                    actorType == "bridged" -> {
+                        ApiUtils.getUrlForAvatar(
+                            activeUser!!.baseUrl, "bridge-bot",
+                            true
+                        )
+                    }
+                    else -> {
+                        var apiId: String? = sharedApplication!!.getString(R.string.nc_guest)
+                        if (!TextUtils.isEmpty(actorDisplayName)) {
+                            apiId = actorDisplayName
+                        }
+                        ApiUtils.getUrlForGuestAvatar(activeUser!!.baseUrl, apiId, true)
+                    }
+                }
+            }
+        }
+    }
+
+    override fun getCreatedAt(): Date {
+        return Date(timestamp * MILLIES)
+    }
+
+    override fun getSystemMessage(): String {
+        return EnumSystemMessageTypeConverter().convertToString(systemMessageType)
+    }
+
+    val isVoiceMessage: Boolean
+        get() = "voice-message" == messageType
+    val isCommandMessage: Boolean
+        get() = "command" == messageType
+    val isDeletedCommentMessage: Boolean
+        get() = "comment_deleted" == messageType
+
+    enum class MessageType {
+        REGULAR_TEXT_MESSAGE,
+        SYSTEM_MESSAGE,
+        SINGLE_LINK_GIPHY_MESSAGE,
+        SINGLE_LINK_TENOR_MESSAGE,
+        SINGLE_LINK_GIF_MESSAGE,
+        SINGLE_LINK_MESSAGE,
+        SINGLE_LINK_VIDEO_MESSAGE,
+        SINGLE_LINK_IMAGE_MESSAGE,
+        SINGLE_LINK_AUDIO_MESSAGE,
+        SINGLE_NC_ATTACHMENT_MESSAGE,
+        SINGLE_NC_GEOLOCATION_MESSAGE,
+        VOICE_MESSAGE
+    }
+
+    /**
+     * see https://nextcloud-talk.readthedocs.io/en/latest/chat/#system-messages
+     */
+    enum class SystemMessageType {
+        DUMMY, CONVERSATION_CREATED,
+        CONVERSATION_RENAMED,
+        DESCRIPTION_REMOVED,
+        DESCRIPTION_SET,
+        CALL_STARTED,
+        CALL_JOINED,
+        CALL_LEFT,
+        CALL_ENDED,
+        CALL_ENDED_EVERYONE,
+        CALL_MISSED,
+        CALL_TRIED,
+        READ_ONLY_OFF,
+        READ_ONLY,
+        LISTABLE_NONE,
+        LISTABLE_USERS,
+        LISTABLE_ALL,
+        LOBBY_NONE,
+        LOBBY_NON_MODERATORS,
+        LOBBY_OPEN_TO_EVERYONE,
+        GUESTS_ALLOWED,
+        GUESTS_DISALLOWED,
+        PASSWORD_SET,
+        PASSWORD_REMOVED,
+        USER_ADDED,
+        USER_REMOVED,
+        GROUP_ADDED,
+        GROUP_REMOVED,
+        CIRCLE_ADDED,
+        CIRCLE_REMOVED,
+        MODERATOR_PROMOTED,
+        MODERATOR_DEMOTED,
+        GUEST_MODERATOR_PROMOTED,
+        GUEST_MODERATOR_DEMOTED,
+        MESSAGE_DELETED,
+        FILE_SHARED, OBJECT_SHARED,
+        MATTERBRIDGE_CONFIG_ADDED,
+        MATTERBRIDGE_CONFIG_EDITED,
+        MATTERBRIDGE_CONFIG_REMOVED,
+        MATTERBRIDGE_CONFIG_ENABLED,
+        MATTERBRIDGE_CONFIG_DISABLED,
+        CLEARED_CHAT,
+        REACTION,
+        REACTION_DELETED,
+        REACTION_REVOKED
+    }
+
+    companion object {
+        private const val TAG = "ChatMessage"
+        private const val MILLIES: Long = 1000L
+    }
+}

+ 0 - 76
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCS.java

@@ -1,76 +0,0 @@
-/*
- * 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.json.chat;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.generic.GenericOCS;
-
-import org.parceler.Parcel;
-
-import java.util.List;
-
-@Parcel
-@JsonObject
-public class ChatOCS extends GenericOCS {
-    @JsonField(name = "data")
-    public List<ChatMessage> data;
-
-    public List<ChatMessage> getData() {
-        return this.data;
-    }
-
-    public void setData(List<ChatMessage> data) {
-        this.data = data;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatOCS)) {
-            return false;
-        }
-        final ChatOCS other = (ChatOCS) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$data = this.getData();
-        final Object other$data = other.getData();
-
-        return this$data == null ? other$data == null : this$data.equals(other$data);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatOCS;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $data = this.getData();
-        result = result * PRIME + ($data == null ? 43 : $data.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "ChatOCS(data=" + this.getData() + ")";
-    }
-}

+ 40 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCS.kt

@@ -0,0 +1,40 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.json.chat
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.generic.GenericMeta
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class ChatOCS(
+    @JsonField(name = ["meta"])
+    var meta: GenericMeta?,
+    @JsonField(name = ["data"])
+    var data: List<ChatMessage>? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 74
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCSSingleMessage.java

@@ -1,74 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Marcel Hibbe
- * Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
- *
- * 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.json.chat;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.generic.GenericOCS;
-
-import org.parceler.Parcel;
-
-@Parcel
-@JsonObject
-public class ChatOCSSingleMessage extends GenericOCS {
-    @JsonField(name = "data")
-    public ChatMessage data;
-
-    public ChatMessage getData() {
-        return this.data;
-    }
-
-    public void setData(ChatMessage data) {
-        this.data = data;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatOCSSingleMessage)) {
-            return false;
-        }
-        final ChatOCSSingleMessage other = (ChatOCSSingleMessage) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$data = this.getData();
-        final Object other$data = other.getData();
-
-        return this$data == null ? other$data == null : this$data.equals(other$data);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatOCSSingleMessage;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $data = this.getData();
-        result = result * PRIME + ($data == null ? 43 : $data.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "ChatOCSSingleMessage(data=" + this.getData() + ")";
-    }
-}

+ 40 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOCSSingleMessage.kt

@@ -0,0 +1,40 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Marcel Hibbe
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
+ *
+ * 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.json.chat
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.generic.GenericMeta
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class ChatOCSSingleMessage(
+    @JsonField(name = ["meta"])
+    var meta: GenericMeta?,
+    @JsonField(name = ["data"])
+    var data: ChatMessage? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 74
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.java

@@ -1,74 +0,0 @@
-/*
- * 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.json.chat;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-@Parcel
-@JsonObject
-public class ChatOverall {
-    @JsonField(name = "ocs")
-    public ChatOCS ocs;
-
-    public ChatOCS getOcs() {
-        return this.ocs;
-    }
-
-    public void setOcs(ChatOCS ocs) {
-        this.ocs = ocs;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatOverall)) {
-            return false;
-        }
-        final ChatOverall other = (ChatOverall) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$ocs = this.getOcs();
-        final Object other$ocs = other.getOcs();
-
-        return this$ocs == null ? other$ocs == null : this$ocs.equals(other$ocs);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatOverall;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ocs = this.getOcs();
-        result = result * PRIME + ($ocs == null ? 43 : $ocs.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "ChatOverall(ocs=" + this.getOcs() + ")";
-    }
-}

+ 37 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverall.kt

@@ -0,0 +1,37 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.json.chat
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class ChatOverall(
+    @JsonField(name = ["ocs"])
+    var ocs: ChatOCS? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 0 - 74
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.java

@@ -1,74 +0,0 @@
-/*
- * Nextcloud Talk application
- *
- * @author Marcel Hibbe
- * Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
- *
- * 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.json.chat;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-@Parcel
-@JsonObject
-public class ChatOverallSingleMessage {
-    @JsonField(name = "ocs")
-    public ChatOCSSingleMessage ocs;
-
-    public ChatOCSSingleMessage getOcs() {
-        return this.ocs;
-    }
-
-    public void setOcs(ChatOCSSingleMessage ocs) {
-        this.ocs = ocs;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatOverallSingleMessage)) {
-            return false;
-        }
-        final ChatOverallSingleMessage other = (ChatOverallSingleMessage) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$ocs = this.getOcs();
-        final Object other$ocs = other.getOcs();
-
-        return this$ocs == null ? other$ocs == null : this$ocs.equals(other$ocs);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatOverallSingleMessage;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ocs = this.getOcs();
-        result = result * PRIME + ($ocs == null ? 43 : $ocs.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "ChatOverallSingleMessage(ocs=" + this.getOcs() + ")";
-    }
-}

+ 37 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatOverallSingleMessage.kt

@@ -0,0 +1,37 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Marcel Hibbe
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
+ *
+ * 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.json.chat
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class ChatOverallSingleMessage(
+    @JsonField(name = ["ocs"])
+    var ocs: ChatOCSSingleMessage? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 0 - 76
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.java

@@ -1,76 +0,0 @@
-/*
- * 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.json.chat;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.generic.GenericOCS;
-
-import org.parceler.Parcel;
-
-import java.util.HashMap;
-import java.util.Objects;
-
-@Parcel
-@JsonObject
-public class ChatShareOCS {
-    @JsonField(name = "data")
-    public HashMap<String, ChatMessage> data;
-
-    public HashMap<String, ChatMessage> getData() {
-        return this.data;
-    }
-
-    public void setData(HashMap<String, ChatMessage> data) {
-        this.data = data;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatShareOCS)) {
-            return false;
-        }
-        final ChatShareOCS other = (ChatShareOCS) o;
-        if (!other.canEqual(this)) {
-            return false;
-        }
-        final Object this$data = this.getData();
-        final Object other$data = other.getData();
-
-        return Objects.equals(this$data, other$data);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatShareOCS;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $data = this.getData();
-        return result * PRIME + ($data == null ? 43 : $data.hashCode());
-    }
-
-    public String toString() {
-        return "ChatShareOCS(data=" + this.getData() + ")";
-    }
-}

+ 38 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOCS.kt

@@ -0,0 +1,38 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * @author Tim Krüger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
+ *
+ * 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.json.chat
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import java.util.HashMap
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class ChatShareOCS(
+    @JsonField(name = ["data"])
+    var data: HashMap<String, ChatMessage>? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 0 - 75
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.java

@@ -1,75 +0,0 @@
-/*
- * 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.json.chat;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-import java.util.Objects;
-
-@Parcel
-@JsonObject
-public class ChatShareOverall {
-    @JsonField(name = "ocs")
-    public ChatShareOCS ocs;
-
-    public ChatShareOCS getOcs() {
-        return this.ocs;
-    }
-
-    public void setOcs(ChatShareOCS ocs) {
-        this.ocs = ocs;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatShareOverall)) {
-            return false;
-        }
-        final ChatShareOverall other = (ChatShareOverall) o;
-        if (!other.canEqual(this)) {
-            return false;
-        }
-        final Object this$ocs = this.getOcs();
-        final Object other$ocs = other.getOcs();
-
-        return Objects.equals(this$ocs, other$ocs);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatShareOverall;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ocs = this.getOcs();
-        return result * PRIME + ($ocs == null ? 43 : $ocs.hashCode());
-    }
-
-    public String toString() {
-        return "ChatShareOverall(ocs=" + this.getOcs() + ")";
-    }
-}

+ 37 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverall.kt

@@ -0,0 +1,37 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * @author Tim Krüger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
+ *
+ * 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.json.chat
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class ChatShareOverall(
+    @JsonField(name = ["ocs"])
+    var ocs: ChatShareOCS? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 0 - 78
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.java

@@ -1,78 +0,0 @@
-/*
- * 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.json.chat;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Objects;
-
-import androidx.annotation.NonNull;
-
-@Parcel
-@JsonObject
-public class ChatShareOverviewOCS {
-    @JsonField(name = "data")
-    public HashMap<String, List<Object>> data;
-
-    public HashMap<String, List<Object>> getData() {
-        return this.data;
-    }
-
-    public void setData(HashMap<String, List<Object>> data) {
-        this.data = data;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatShareOverviewOCS)) {
-            return false;
-        }
-        final ChatShareOverviewOCS other = (ChatShareOverviewOCS) o;
-        if (!other.canEqual(this)) {
-            return false;
-        }
-        final Object this$data = this.getData();
-        final Object other$data = other.getData();
-
-        return Objects.equals(this$data, other$data);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatShareOverviewOCS;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $data = this.getData();
-        return result * PRIME + ($data == null ? 43 : $data.hashCode());
-    }
-
-    public String toString() {
-        return "ChatShareOverviewOCS(data=" + this.getData() + ")";
-    }
-}

+ 41 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOCS.kt

@@ -0,0 +1,41 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * @author Tim Krüger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
+ *
+ * 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.json.chat
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.AnyParceler
+import kotlinx.android.parcel.Parcelize
+import kotlinx.android.parcel.TypeParceler
+import java.util.HashMap
+
+@Parcelize
+@JsonObject
+@TypeParceler<Any, AnyParceler>
+data class ChatShareOverviewOCS(
+    @JsonField(name = ["data"])
+    var data: HashMap<String, List<Any>>? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 0 - 75
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.java

@@ -1,75 +0,0 @@
-/*
- * 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.json.chat;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-import java.util.Objects;
-
-@Parcel
-@JsonObject
-public class ChatShareOverviewOverall {
-    @JsonField(name = "ocs")
-    public ChatShareOverviewOCS ocs;
-
-    public ChatShareOverviewOCS getOcs() {
-        return this.ocs;
-    }
-
-    public void setOcs(ChatShareOverviewOCS ocs) {
-        this.ocs = ocs;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof ChatShareOverviewOverall)) {
-            return false;
-        }
-        final ChatShareOverviewOverall other = (ChatShareOverviewOverall) o;
-        if (!other.canEqual(this)) {
-            return false;
-        }
-        final Object this$ocs = this.getOcs();
-        final Object other$ocs = other.getOcs();
-
-        return Objects.equals(this$ocs, other$ocs);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof ChatShareOverviewOverall;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ocs = this.getOcs();
-        return result * PRIME + ($ocs == null ? 43 : $ocs.hashCode());
-    }
-
-    public String toString() {
-        return "ChatShareOverviewOverall(ocs=" + this.getOcs() + ")";
-    }
-}

+ 37 - 0
app/src/main/java/com/nextcloud/talk/models/json/chat/ChatShareOverviewOverall.kt

@@ -0,0 +1,37 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * @author Tim Krüger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2022 Tim Krüger <t@timkrueger.me>
+ *
+ * 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.json.chat
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class ChatShareOverviewOverall(
+    @JsonField(name = ["ocs"])
+    var ocs: ChatShareOverviewOCS? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 2 - 3
app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.java → app/src/main/java/com/nextcloud/talk/models/json/chat/ReadStatus.kt

@@ -17,9 +17,8 @@
  * You should have received a copy of the GNU General Public License
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
  */
+package com.nextcloud.talk.models.json.chat
 
 
-package com.nextcloud.talk.models.json.chat;
-
-public enum ReadStatus {
+enum class ReadStatus {
     NONE, SENT, READ
     NONE, SENT, READ
 }
 }

+ 0 - 624
app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.java

@@ -1,624 +0,0 @@
-/*
- *
- *   Nextcloud Talk application
- *
- *   @author Mario Danic
- *   @author Tim Krüger
- *   Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
- *   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.models.json.conversations;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.database.CapabilitiesUtil;
-import com.nextcloud.talk.models.database.UserEntity;
-import com.nextcloud.talk.models.json.chat.ChatMessage;
-import com.nextcloud.talk.models.json.converters.EnumLobbyStateConverter;
-import com.nextcloud.talk.models.json.converters.EnumNotificationLevelConverter;
-import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter;
-import com.nextcloud.talk.models.json.converters.EnumReadOnlyConversationConverter;
-import com.nextcloud.talk.models.json.converters.EnumRoomTypeConverter;
-import com.nextcloud.talk.models.json.participants.Participant;
-
-import org.parceler.Parcel;
-
-import java.util.HashMap;
-import java.util.Objects;
-
-@Parcel
-@JsonObject
-public class Conversation {
-    @JsonField(name = "id")
-    public String roomId;
-    @JsonField(name = "token")
-    public String token;
-    @JsonField(name = "name")
-    public String name;
-    @JsonField(name = "displayName")
-    public String displayName;
-    @JsonField(name = "description")
-    public String description;
-    @JsonField(name = "type", typeConverter = EnumRoomTypeConverter.class)
-    public ConversationType type;
-    @JsonField(name = "lastPing")
-    public long lastPing;
-    @Deprecated
-    @JsonField(name = "participants")
-    public HashMap<String, HashMap<String, Object>> participants;
-    @JsonField(name = "participantType", typeConverter = EnumParticipantTypeConverter.class)
-    public Participant.ParticipantType participantType;
-    @JsonField(name = "hasPassword")
-    public boolean hasPassword;
-    @JsonField(name = "sessionId")
-    public String sessionId;
-    @JsonField(name = "actorId")
-    public String actorId;
-    @JsonField(name = "actorType")
-    public String actorType;
-    public String password;
-    @JsonField(name = "isFavorite")
-    public boolean isFavorite;
-    @JsonField(name = "lastActivity")
-    public long lastActivity;
-    @JsonField(name = "unreadMessages")
-    public int unreadMessages;
-    @JsonField(name = "unreadMention")
-    public boolean unreadMention;
-    @JsonField(name = "lastMessage")
-    public ChatMessage lastMessage;
-    @JsonField(name = "objectType")
-    public String objectType;
-    @JsonField(name = "notificationLevel", typeConverter = EnumNotificationLevelConverter.class)
-    public NotificationLevel notificationLevel;
-    @JsonField(name = "readOnly", typeConverter = EnumReadOnlyConversationConverter.class)
-    public ConversationReadOnlyState conversationReadOnlyState;
-    @JsonField(name = "lobbyState", typeConverter = EnumLobbyStateConverter.class)
-    public LobbyState lobbyState;
-    @JsonField(name = "lobbyTimer")
-    public Long lobbyTimer;
-    @JsonField(name = "lastReadMessage")
-    public int lastReadMessage;
-    @JsonField(name = "hasCall")
-    public boolean hasCall;
-    @JsonField(name = "callFlag")
-    public int callFlag;
-    @JsonField(name = "canStartCall")
-    public boolean canStartCall;
-
-    @JsonField(name = "canLeaveConversation")
-    public Boolean canLeaveConversation;
-
-    @JsonField(name = "canDeleteConversation")
-    public Boolean canDeleteConversation;
-
-    @JsonField(name = "unreadMentionDirect")
-    public Boolean unreadMentionDirect;
-
-    @JsonField(name = "notificationCalls")
-    public Integer notificationCalls;
-
-    @JsonField(name = "permissions")
-    public int permissions;
-
-    public boolean isPublic() {
-        return (ConversationType.ROOM_PUBLIC_CALL.equals(type));
-    }
-
-    public boolean isGuest() {
-        return (Participant.ParticipantType.GUEST.equals(participantType) ||
-                Participant.ParticipantType.GUEST_MODERATOR.equals(participantType) ||
-                Participant.ParticipantType.USER_FOLLOWING_LINK.equals(participantType));
-    }
-
-    private boolean isLockedOneToOne(UserEntity conversationUser) {
-        return (getType() == ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL &&
-                CapabilitiesUtil.hasSpreedFeatureCapability(conversationUser, "locked-one-to-one-rooms"));
-    }
-
-    public boolean canModerate(UserEntity conversationUser) {
-        return (isParticipantOwnerOrModerator() && !isLockedOneToOne(conversationUser));
-    }
-
-    public boolean isParticipantOwnerOrModerator() {
-        return (Participant.ParticipantType.OWNER.equals(participantType) ||
-                Participant.ParticipantType.GUEST_MODERATOR.equals(participantType) ||
-                Participant.ParticipantType.MODERATOR.equals(participantType));
-    }
-
-    public boolean shouldShowLobby(UserEntity conversationUser) {
-        return LobbyState.LOBBY_STATE_MODERATORS_ONLY.equals(getLobbyState()) && !canModerate(conversationUser);
-    }
-
-    public boolean isLobbyViewApplicable(UserEntity conversationUser) {
-        return !canModerate(conversationUser) && (getType() == ConversationType.ROOM_GROUP_CALL || getType() == ConversationType.ROOM_PUBLIC_CALL);
-    }
-
-    public boolean isNameEditable(UserEntity conversationUser) {
-        return (canModerate(conversationUser) && !ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL.equals(type));
-    }
-
-    public boolean canLeave(UserEntity conversationUser) {
-        if (canLeaveConversation != null) {
-            // Available since APIv2
-            return canLeaveConversation;
-        }
-        // Fallback for APIv1
-        return !canModerate(conversationUser) ||
-            (getType() != ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL && this.participants.size() > 1);
-    }
-
-    public boolean canDelete(UserEntity conversationUser) {
-        if (canDeleteConversation != null) {
-            // Available since APIv2
-            return canDeleteConversation;
-        }
-        // Fallback for APIv1
-        return canModerate(conversationUser);
-    }
-
-    public String getRoomId() {
-        return this.roomId;
-    }
-
-    public String getToken() {
-        return this.token;
-    }
-
-    public String getName() {
-        return this.name;
-    }
-
-    public String getDescription() {
-        return this.description;
-    }
-
-    public String getDisplayName() {
-        return this.displayName;
-    }
-
-    public ConversationType getType() {
-        return this.type;
-    }
-
-    public long getLastPing() {
-        return this.lastPing;
-    }
-
-    public Participant.ParticipantType getParticipantType() {
-        return this.participantType;
-    }
-
-    public String getActorId() {
-        return actorId;
-    }
-
-    public String getActorType() {
-        return actorType;
-    }
-
-    public boolean isHasPassword() {
-        return this.hasPassword;
-    }
-
-    public String getSessionId() {
-        return this.sessionId;
-    }
-
-    public String getPassword() {
-        return this.password;
-    }
-
-    public boolean isFavorite() {
-        return this.isFavorite;
-    }
-
-    public long getLastActivity() {
-        return this.lastActivity;
-    }
-
-    public int getUnreadMessages() {
-        return this.unreadMessages;
-    }
-
-    public boolean isUnreadMention() {
-        return this.unreadMention;
-    }
-
-    public ChatMessage getLastMessage() {
-        return this.lastMessage;
-    }
-
-    public String getObjectType() {
-        return this.objectType;
-    }
-
-    public NotificationLevel getNotificationLevel() {
-        return this.notificationLevel;
-    }
-
-    public ConversationReadOnlyState getConversationReadOnlyState() {
-        return this.conversationReadOnlyState;
-    }
-
-    public LobbyState getLobbyState() {
-        return this.lobbyState;
-    }
-
-    public Long getLobbyTimer() {
-        return this.lobbyTimer;
-    }
-
-    public int getLastReadMessage() {
-        return this.lastReadMessage;
-    }
-
-    public boolean getHasCall() {
-        return hasCall;
-    }
-
-    public int getCallFlag() {
-        return this.callFlag;
-    }
-
-    public boolean getCanStartCall() {
-        return canStartCall;
-    }
-
-    public Boolean getUnreadMentionDirect() {
-        return unreadMentionDirect;
-    }
-
-    public Integer getNotificationCalls() { return notificationCalls; }
-
-    public int getPermissions() {
-        return permissions;
-    }
-
-    public void setRoomId(String roomId) {
-        this.roomId = roomId;
-    }
-
-    public void setToken(String token) {
-        this.token = token;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public void setDisplayName(String displayName) {
-        this.displayName = displayName;
-    }
-
-    public void setType(ConversationType type) {
-        this.type = type;
-    }
-
-    public void setLastPing(long lastPing) {
-        this.lastPing = lastPing;
-    }
-
-    @Deprecated
-    public void setParticipants(HashMap<String, HashMap<String, Object>> participants) {
-        this.participants = participants;
-    }
-
-    public void setParticipantType(Participant.ParticipantType participantType) {
-        this.participantType = participantType;
-    }
-
-    public void setActorId(String actorId) {
-        this.actorId = actorId;
-    }
-
-    public void setActorType(String actorType) {
-        this.actorType = actorType;
-    }
-
-    public void setHasPassword(boolean hasPassword) {
-        this.hasPassword = hasPassword;
-    }
-
-    public void setSessionId(String sessionId) {
-        this.sessionId = sessionId;
-    }
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    public void setFavorite(boolean isFavorite) {
-        this.isFavorite = isFavorite;
-    }
-
-    public void setLastActivity(long lastActivity) {
-        this.lastActivity = lastActivity;
-    }
-
-    public void setUnreadMessages(int unreadMessages) {
-        this.unreadMessages = unreadMessages;
-    }
-
-    public void setUnreadMention(boolean unreadMention) {
-        this.unreadMention = unreadMention;
-    }
-
-    public void setLastMessage(ChatMessage lastMessage) {
-        this.lastMessage = lastMessage;
-    }
-
-    public void setObjectType(String objectType) {
-        this.objectType = objectType;
-    }
-
-    public void setNotificationLevel(NotificationLevel notificationLevel) {
-        this.notificationLevel = notificationLevel;
-    }
-
-    public void setConversationReadOnlyState(ConversationReadOnlyState conversationReadOnlyState) {
-        this.conversationReadOnlyState = conversationReadOnlyState;
-    }
-
-    public void setLobbyState(LobbyState lobbyState) {
-        this.lobbyState = lobbyState;
-    }
-
-    public void setLobbyTimer(Long lobbyTimer) {
-        this.lobbyTimer = lobbyTimer;
-    }
-
-    public void setLastReadMessage(int lastReadMessage) {
-        this.lastReadMessage = lastReadMessage;
-    }
-
-    public void setHasCall(boolean hasCall) {
-        this.hasCall = hasCall;
-    }
-
-    public void setCallFlag(int callFlag) {
-        this.callFlag = callFlag;
-    }
-
-    public void setCanStartCall(boolean canStartCall) {
-        this.canStartCall = canStartCall;
-    }
-
-    public void setUnreadMentionDirect(Boolean unreadMentionDirect) {
-        this.unreadMentionDirect = unreadMentionDirect;
-    }
-
-    public void setPermissions(int permissions) {
-        this.permissions = permissions;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-
-        Conversation that = (Conversation) o;
-
-        if (lastPing != that.lastPing) {
-            return false;
-        }
-        if (hasPassword != that.hasPassword) {
-            return false;
-        }
-        if (isFavorite != that.isFavorite) {
-            return false;
-        }
-        if (lastActivity != that.lastActivity) {
-            return false;
-        }
-        if (unreadMessages != that.unreadMessages) {
-            return false;
-        }
-        if (unreadMention != that.unreadMention) {
-            return false;
-        }
-        if (lastReadMessage != that.lastReadMessage) {
-            return false;
-        }
-        if (hasCall != that.hasCall) {
-            return false;
-        }
-        if (callFlag != that.callFlag) {
-            return false;
-        }
-        if (canStartCall != that.canStartCall) {
-            return false;
-        }
-        if (!Objects.equals(roomId, that.roomId)) {
-            return false;
-        }
-        if (!token.equals(that.token)) {
-            return false;
-        }
-        if (!Objects.equals(name, that.name)) {
-            return false;
-        }
-        if (!Objects.equals(displayName, that.displayName)) {
-            return false;
-        }
-        if (!Objects.equals(description, that.description)) {
-            return false;
-        }
-        if (type != that.type) {
-            return false;
-        }
-        if (!Objects.equals(participants, that.participants)) {
-            return false;
-        }
-        if (participantType != that.participantType) {
-            return false;
-        }
-        if (!Objects.equals(sessionId, that.sessionId)) {
-            return false;
-        }
-        if (!Objects.equals(actorId, that.actorId)) {
-            return false;
-        }
-        if (!Objects.equals(actorType, that.actorType)) {
-            return false;
-        }
-        if (!Objects.equals(password, that.password)) {
-            return false;
-        }
-        if (!Objects.equals(lastMessage, that.lastMessage)) {
-            return false;
-        }
-        if (!Objects.equals(objectType, that.objectType)) {
-            return false;
-        }
-        if (notificationLevel != that.notificationLevel) {
-            return false;
-        }
-        if (conversationReadOnlyState != that.conversationReadOnlyState) {
-            return false;
-        }
-        if (lobbyState != that.lobbyState) {
-            return false;
-        }
-        if (!Objects.equals(lobbyTimer, that.lobbyTimer)) {
-            return false;
-        }
-        if (!Objects.equals(canLeaveConversation, that.canLeaveConversation)) {
-            return false;
-        }
-        if (!Objects.equals(notificationCalls, that.notificationCalls)) {
-            return false;
-        }
-        if (permissions != that.permissions) {
-            return false;
-        }
-        return Objects.equals(canDeleteConversation, that.canDeleteConversation);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof Conversation;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = roomId != null ? roomId.hashCode() : 0;
-        result = 31 * result + token.hashCode();
-        result = 31 * result + (name != null ? name.hashCode() : 0);
-        result = 31 * result + (displayName != null ? displayName.hashCode() : 0);
-        result = 31 * result + (description != null ? description.hashCode() : 0);
-        result = 31 * result + type.hashCode();
-        result = 31 * result + (int) (lastPing ^ (lastPing >>> 32));
-        result = 31 * result + (participants != null ? participants.hashCode() : 0);
-        result = 31 * result + (participantType != null ? participantType.hashCode() : 0);
-        result = 31 * result + (actorId != null ? actorId.hashCode() : 0);
-        result = 31 * result + (actorType != null ? actorType.hashCode() : 0);
-        result = 31 * result + (hasPassword ? 1 : 0);
-        result = 31 * result + (sessionId != null ? sessionId.hashCode() : 0);
-        result = 31 * result + (password != null ? password.hashCode() : 0);
-        result = 31 * result + (isFavorite ? 1 : 0);
-        result = 31 * result + (int) (lastActivity ^ (lastActivity >>> 32));
-        result = 31 * result + unreadMessages;
-        result = 31 * result + (unreadMention ? 1 : 0);
-        result = 31 * result + (lastMessage != null ? lastMessage.hashCode() : 0);
-        result = 31 * result + (objectType != null ? objectType.hashCode() : 0);
-        result = 31 * result + (notificationLevel != null ? notificationLevel.hashCode() : 0);
-        result = 31 * result + (conversationReadOnlyState != null ? conversationReadOnlyState.hashCode() : 0);
-        result = 31 * result + (lobbyState != null ? lobbyState.hashCode() : 0);
-        result = 31 * result + (lobbyTimer != null ? lobbyTimer.hashCode() : 0);
-        result = 31 * result + lastReadMessage;
-        result = 31 * result + (hasCall ? 1 : 0);
-        result = 31 * result + callFlag;
-        result = 31 * result + (canStartCall ? 1 : 0);
-        result = 31 * result + (canLeaveConversation != null ? canLeaveConversation.hashCode() : 0);
-        result = 31 * result + (canDeleteConversation != null ? canDeleteConversation.hashCode() : 0);
-        result = 31 * result + (notificationCalls != null ? notificationCalls.hashCode() : 0);
-        result = 31 * result + permissions;
-        return result;
-    }
-
-    @Override
-    public String toString() {
-        return "Conversation{" +
-                "roomId='" + roomId + '\'' +
-                ", token='" + token + '\'' +
-                ", name='" + name + '\'' +
-                ", displayName='" + displayName + '\'' +
-                ", description='" + description + '\'' +
-                ", type=" + type +
-                ", lastPing=" + lastPing +
-                ", participants=" + participants +
-                ", participantType=" + participantType +
-                ", actorId=" + actorId +
-                ", actorType=" + actorType +
-                ", hasPassword=" + hasPassword +
-                ", sessionId='" + sessionId + '\'' +
-                ", password='" + password + '\'' +
-                ", isFavorite=" + isFavorite +
-                ", lastActivity=" + lastActivity +
-                ", unreadMessages=" + unreadMessages +
-                ", unreadMention=" + unreadMention +
-                ", lastMessage=" + lastMessage +
-                ", objectType='" + objectType + '\'' +
-                ", notificationLevel=" + notificationLevel +
-                ", conversationReadOnlyState=" + conversationReadOnlyState +
-                ", lobbyState=" + lobbyState +
-                ", lobbyTimer=" + lobbyTimer +
-                ", lastReadMessage=" + lastReadMessage +
-                ", hasCall=" + hasCall +
-                ", callFlag=" + callFlag +
-                ", canStartCall=" + canStartCall +
-                ", canLeaveConversation=" + canLeaveConversation +
-                ", canDeleteConversation=" + canDeleteConversation +
-                ", notificationCalls=" + notificationCalls +
-                ", permissions=" + permissions +
-                '}';
-    }
-
-    public enum NotificationLevel {
-        DEFAULT,
-        ALWAYS,
-        MENTION,
-        NEVER
-    }
-
-    public enum LobbyState {
-        LOBBY_STATE_ALL_PARTICIPANTS,
-        LOBBY_STATE_MODERATORS_ONLY
-    }
-
-    public enum ConversationReadOnlyState {
-        CONVERSATION_READ_WRITE,
-        CONVERSATION_READ_ONLY
-    }
-
-    @Parcel
-    public enum ConversationType {
-        DUMMY,
-        ROOM_TYPE_ONE_TO_ONE_CALL,
-        ROOM_GROUP_CALL,
-        ROOM_PUBLIC_CALL,
-        ROOM_SYSTEM
-    }
-
-}

+ 198 - 0
app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.kt

@@ -0,0 +1,198 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Tim Krüger
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
+ * 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.models.json.conversations
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.database.CapabilitiesUtil
+import com.nextcloud.talk.models.database.UserEntity
+import com.nextcloud.talk.models.json.chat.ChatMessage
+import com.nextcloud.talk.models.json.converters.EnumLobbyStateConverter
+import com.nextcloud.talk.models.json.converters.EnumNotificationLevelConverter
+import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter
+import com.nextcloud.talk.models.json.converters.EnumReadOnlyConversationConverter
+import com.nextcloud.talk.models.json.converters.EnumRoomTypeConverter
+import com.nextcloud.talk.models.json.participants.Participant.ParticipantType
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class Conversation(
+    @JsonField(name = ["id"])
+    var roomId: String? = null,
+    @JsonField(name = ["token"])
+    var token: String? = null,
+    @JsonField(name = ["name"])
+    var name: String? = null,
+    @JsonField(name = ["displayName"])
+    var displayName: String? = null,
+    @JsonField(name = ["description"])
+    var description: String? = null,
+    @JsonField(name = ["type"], typeConverter = EnumRoomTypeConverter::class)
+    var type: ConversationType? = null,
+    @JsonField(name = ["lastPing"])
+    var lastPing: Long = 0,
+    @JsonField(name = ["participantType"], typeConverter = EnumParticipantTypeConverter::class)
+    var participantType: ParticipantType? = null,
+    @JsonField(name = ["hasPassword"])
+    var hasPassword: Boolean = false,
+    @JsonField(name = ["sessionId"])
+    var sessionId: String? = null,
+    @JsonField(name = ["actorId"])
+    var actorId: String? = null,
+    @JsonField(name = ["actorType"])
+    var actorType: String? = null,
+
+    var password: String? = null,
+
+    @JsonField(name = ["isFavorite"])
+    var favorite: Boolean = false,
+
+    @JsonField(name = ["lastActivity"])
+    var lastActivity: Long = 0,
+
+    @JsonField(name = ["unreadMessages"])
+    var unreadMessages: Int = 0,
+
+    @JsonField(name = ["unreadMention"])
+    var unreadMention: Boolean = false,
+
+    @JsonField(name = ["lastMessage"])
+    var lastMessage: ChatMessage? = null,
+
+    @JsonField(name = ["objectType"])
+    var objectType: String? = null,
+
+    @JsonField(name = ["notificationLevel"], typeConverter = EnumNotificationLevelConverter::class)
+    var notificationLevel: NotificationLevel? = null,
+
+    @JsonField(name = ["readOnly"], typeConverter = EnumReadOnlyConversationConverter::class)
+    var conversationReadOnlyState: ConversationReadOnlyState? = null,
+
+    @JsonField(name = ["lobbyState"], typeConverter = EnumLobbyStateConverter::class)
+    var lobbyState: LobbyState? = null,
+
+    @JsonField(name = ["lobbyTimer"])
+    var lobbyTimer: Long? = null,
+
+    @JsonField(name = ["lastReadMessage"])
+    var lastReadMessage: Int = 0,
+
+    @JsonField(name = ["hasCall"])
+    var hasCall: Boolean = false,
+
+    @JsonField(name = ["callFlag"])
+    var callFlag: Int = 0,
+
+    @JsonField(name = ["canStartCall"])
+    var canStartCall: Boolean = false,
+
+    @JsonField(name = ["canLeaveConversation"])
+    var canLeaveConversation: Boolean? = null,
+
+    @JsonField(name = ["canDeleteConversation"])
+    var canDeleteConversation: Boolean? = null,
+
+    @JsonField(name = ["unreadMentionDirect"])
+    var unreadMentionDirect: Boolean? = null,
+
+    @JsonField(name = ["notificationCalls"])
+    var notificationCalls: Int? = null,
+
+    @JsonField(name = ["permissions"])
+    var permissions: Int = 0
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+
+    val isPublic: Boolean
+        get() = ConversationType.ROOM_PUBLIC_CALL == type
+
+    val isGuest: Boolean
+        get() = ParticipantType.GUEST == participantType ||
+            ParticipantType.GUEST_MODERATOR == participantType ||
+            ParticipantType.USER_FOLLOWING_LINK == participantType
+
+    val isParticipantOwnerOrModerator: Boolean
+        get() = ParticipantType.OWNER == participantType ||
+            ParticipantType.GUEST_MODERATOR == participantType ||
+            ParticipantType.MODERATOR == participantType
+
+    private fun isLockedOneToOne(conversationUser: UserEntity): Boolean {
+        return type == ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL &&
+            CapabilitiesUtil.hasSpreedFeatureCapability(conversationUser, "locked-one-to-one-rooms")
+    }
+
+    fun canModerate(conversationUser: UserEntity): Boolean {
+        return isParticipantOwnerOrModerator && !isLockedOneToOne(conversationUser)
+    }
+
+    fun shouldShowLobby(conversationUser: UserEntity): Boolean {
+        return LobbyState.LOBBY_STATE_MODERATORS_ONLY == lobbyState && !canModerate(conversationUser)
+    }
+
+    fun isLobbyViewApplicable(conversationUser: UserEntity): Boolean {
+        return !canModerate(conversationUser) &&
+            (type == ConversationType.ROOM_GROUP_CALL || type == ConversationType.ROOM_PUBLIC_CALL)
+    }
+
+    fun isNameEditable(conversationUser: UserEntity): Boolean {
+        return canModerate(conversationUser) && ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL != type
+    }
+
+    fun canLeave(): Boolean {
+        return if (canLeaveConversation != null) {
+            // Available since APIv2
+            canLeaveConversation!!
+        } else {
+            true
+        }
+    }
+
+    fun canDelete(conversationUser: UserEntity): Boolean {
+        return if (canDeleteConversation != null) {
+            // Available since APIv2
+            canDeleteConversation!!
+        } else canModerate(conversationUser)
+        // Fallback for APIv1
+    }
+
+    enum class NotificationLevel {
+        DEFAULT, ALWAYS, MENTION, NEVER
+    }
+
+    enum class LobbyState {
+        LOBBY_STATE_ALL_PARTICIPANTS, LOBBY_STATE_MODERATORS_ONLY
+    }
+
+    enum class ConversationReadOnlyState {
+        CONVERSATION_READ_WRITE, CONVERSATION_READ_ONLY
+    }
+
+    @Parcelize
+    enum class ConversationType : Parcelable {
+        DUMMY, ROOM_TYPE_ONE_TO_ONE_CALL, ROOM_GROUP_CALL, ROOM_PUBLIC_CALL, ROOM_SYSTEM
+    }
+}

+ 0 - 72
app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomOCS.java

@@ -1,72 +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.models.json.conversations;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.generic.GenericOCS;
-
-@JsonObject
-public class RoomOCS extends GenericOCS {
-    @JsonField(name = "data")
-    public Conversation data;
-
-    public Conversation getData() {
-        return this.data;
-    }
-
-    public void setData(Conversation data) {
-        this.data = data;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof RoomOCS)) {
-            return false;
-        }
-        final RoomOCS other = (RoomOCS) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$data = this.getData();
-        final Object other$data = other.getData();
-
-        return this$data == null ? other$data == null : this$data.equals(other$data);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof RoomOCS;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $data = this.getData();
-        result = result * PRIME + ($data == null ? 43 : $data.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "RoomOCS(data=" + this.getData() + ")";
-    }
-}

+ 40 - 0
app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomOCS.kt

@@ -0,0 +1,40 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * @author Mario Danic
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.conversations
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.generic.GenericMeta
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class RoomOCS(
+    @JsonField(name = ["meta"])
+    var meta: GenericMeta?,
+    @JsonField(name = ["data"])
+    var data: Conversation? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 71
app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomOverall.java

@@ -1,71 +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.models.json.conversations;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-@JsonObject
-public class RoomOverall {
-    @JsonField(name = "ocs")
-    public RoomOCS ocs;
-
-    public RoomOCS getOcs() {
-        return this.ocs;
-    }
-
-    public void setOcs(RoomOCS ocs) {
-        this.ocs = ocs;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof RoomOverall)) {
-            return false;
-        }
-        final RoomOverall other = (RoomOverall) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$ocs = this.getOcs();
-        final Object other$ocs = other.getOcs();
-
-        return this$ocs == null ? other$ocs == null : this$ocs.equals(other$ocs);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof RoomOverall;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ocs = this.getOcs();
-        result = result * PRIME + ($ocs == null ? 43 : $ocs.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "RoomOverall(ocs=" + this.getOcs() + ")";
-    }
-}

+ 37 - 0
app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomOverall.kt

@@ -0,0 +1,37 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * @author Mario Danic
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.conversations
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class RoomOverall(
+    @JsonField(name = ["ocs"])
+    var ocs: RoomOCS? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 0 - 77
app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomsOCS.java

@@ -1,77 +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.models.json.conversations;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.generic.GenericOCS;
-
-import org.parceler.Parcel;
-
-import java.util.List;
-
-@Parcel
-@JsonObject
-public class RoomsOCS extends GenericOCS {
-    @JsonField(name = "data")
-    public List<Conversation> data;
-
-    public List<Conversation> getData() {
-        return this.data;
-    }
-
-    public void setData(List<Conversation> data) {
-        this.data = data;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof RoomsOCS)) {
-            return false;
-        }
-        final RoomsOCS other = (RoomsOCS) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$data = this.getData();
-        final Object other$data = other.getData();
-
-        return this$data == null ? other$data == null : this$data.equals(other$data);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof RoomsOCS;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $data = this.getData();
-        result = result * PRIME + ($data == null ? 43 : $data.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "RoomsOCS(data=" + this.getData() + ")";
-    }
-}

+ 40 - 0
app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomsOCS.kt

@@ -0,0 +1,40 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * @author Mario Danic
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.conversations
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.generic.GenericMeta
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class RoomsOCS(
+    @JsonField(name = ["meta"])
+    var meta: GenericMeta?,
+    @JsonField(name = ["data"])
+    var data: List<Conversation>? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 74
app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomsOverall.java

@@ -1,74 +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.models.json.conversations;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-@Parcel
-@JsonObject
-public class RoomsOverall {
-    @JsonField(name = "ocs")
-    public RoomsOCS ocs;
-
-    public RoomsOCS getOcs() {
-        return this.ocs;
-    }
-
-    public void setOcs(RoomsOCS ocs) {
-        this.ocs = ocs;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof RoomsOverall)) {
-            return false;
-        }
-        final RoomsOverall other = (RoomsOverall) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$ocs = this.getOcs();
-        final Object other$ocs = other.getOcs();
-
-        return this$ocs == null ? other$ocs == null : this$ocs.equals(other$ocs);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof RoomsOverall;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ocs = this.getOcs();
-        result = result * PRIME + ($ocs == null ? 43 : $ocs.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "RoomsOverall(ocs=" + this.getOcs() + ")";
-    }
-}

+ 37 - 0
app/src/main/java/com/nextcloud/talk/models/json/conversations/RoomsOverall.kt

@@ -0,0 +1,37 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Andy Scherzinger
+ * @author Mario Danic
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.conversations
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class RoomsOverall(
+    @JsonField(name = ["ocs"])
+    var ocs: RoomsOCS? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 1 - 0
app/src/main/java/com/nextcloud/talk/models/json/converters/EnumSystemMessageTypeConverter.kt

@@ -171,6 +171,7 @@ class EnumSystemMessageTypeConverter : StringBasedTypeConverter<ChatMessage.Syst
         }
         }
     }
     }
 
 
+    @Suppress("Detekt.ComplexMethod")
     override fun convertToString(`object`: ChatMessage.SystemMessageType?): String {
     override fun convertToString(`object`: ChatMessage.SystemMessageType?): String {
 
 
         if (`object` == null) {
         if (`object` == null) {

+ 1 - 1
app/src/main/java/com/nextcloud/talk/models/json/generic/GenericMeta.kt

@@ -4,7 +4,7 @@
  * @author Mario Danic
  * @author Mario Danic
  * @author Andy Scherzinger
  * @author Andy Scherzinger
  * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
  * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
- * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
+ * Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
  *
  *
  * This program is free software: you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU General Public License as published by

+ 0 - 38
app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOCS.java

@@ -1,38 +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.models.json.generic;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-/**
- * Legacy class for the remaining java parceler classes
- * that haven't yet been migrated to kotlin data classes
- */
-@Parcel
-@JsonObject
-@Deprecated
-public class GenericOCS {
-    @JsonField(name = "meta")
-    public GenericMeta meta;
-}

+ 15 - 14
app/src/main/java/com/nextcloud/talk/models/json/generic/GenericOverall.kt

@@ -1,22 +1,23 @@
 /*
 /*
+ * Nextcloud Talk application
  *
  *
- *   Nextcloud Talk application
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
  *
  *
- *   @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 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.
  *
  *
- *   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/>.
+ * 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.json.generic
 package com.nextcloud.talk.models.json.generic
 
 

+ 0 - 35
app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOCS.java

@@ -1,35 +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.models.json.participants;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.generic.GenericOCS;
-import com.nextcloud.talk.models.json.conversations.Conversation;
-
-@JsonObject
-public class AddParticipantOCS extends GenericOCS {
-    /*
-        Returned room will have only type set, and sometimes even that will be null
-     */
-    @JsonField(name = "data")
-    Conversation data;
-}

+ 42 - 0
app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOCS.kt

@@ -0,0 +1,42 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.participants
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.conversations.Conversation
+import com.nextcloud.talk.models.json.generic.GenericMeta
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class AddParticipantOCS(
+    @JsonField(name = ["meta"])
+    var meta: GenericMeta?,
+    /* Returned room will have only type set, and sometimes even that will be null */
+    @JsonField(name = ["data"])
+    var data: Conversation? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 72
app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOverall.java

@@ -1,72 +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.models.json.participants;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.conversations.RoomsOCS;
-
-@JsonObject
-public class AddParticipantOverall {
-    @JsonField(name = "ocs")
-    RoomsOCS ocs;
-
-    public RoomsOCS getOcs() {
-        return this.ocs;
-    }
-
-    public void setOcs(RoomsOCS ocs) {
-        this.ocs = ocs;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof AddParticipantOverall)) {
-            return false;
-        }
-        final AddParticipantOverall other = (AddParticipantOverall) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$ocs = this.getOcs();
-        final Object other$ocs = other.getOcs();
-
-        return this$ocs == null ? other$ocs == null : this$ocs.equals(other$ocs);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof AddParticipantOverall;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ocs = this.getOcs();
-        result = result * PRIME + ($ocs == null ? 43 : $ocs.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "AddParticipantOverall(ocs=" + this.getOcs() + ")";
-    }
-}

+ 38 - 0
app/src/main/java/com/nextcloud/talk/models/json/participants/AddParticipantOverall.kt

@@ -0,0 +1,38 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.participants
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.conversations.RoomsOCS
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class AddParticipantOverall(
+    @JsonField(name = ["ocs"])
+    var ocs: RoomsOCS? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 0 - 3
app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.kt

@@ -18,9 +18,6 @@
  *
  *
  * You should have received a copy of the GNU General Public License
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Parts related to account import were either copied from or inspired by the great work done by David Luhmer at:
- * https://github.com/nextcloud/ownCloud-Account-Importer
  */
  */
 package com.nextcloud.talk.models.json.participants
 package com.nextcloud.talk.models.json.participants
 
 

+ 0 - 100
app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.java

@@ -1,100 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.converters.ObjectParcelConverter;
-
-import org.parceler.ParcelPropertyConverter;
-
-@JsonObject
-public class DataChannelMessage {
-    @JsonField(name = "type")
-    String type;
-
-    @ParcelPropertyConverter(ObjectParcelConverter.class)
-    @JsonField(name = "payload")
-    Object payload;
-
-    public DataChannelMessage(String type) {
-        this.type = type;
-    }
-
-    public DataChannelMessage() {
-    }
-
-    public String getType() {
-        return this.type;
-    }
-
-    public Object getPayload() {
-        return this.payload;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public void setPayload(Object payload) {
-        this.payload = payload;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof DataChannelMessage)) {
-            return false;
-        }
-        final DataChannelMessage other = (DataChannelMessage) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$type = this.getType();
-        final Object other$type = other.getType();
-        if (this$type == null ? other$type != null : !this$type.equals(other$type)) {
-            return false;
-        }
-        final Object this$payload = this.getPayload();
-        final Object other$payload = other.getPayload();
-
-        return this$payload == null ? other$payload == null : this$payload.equals(other$payload);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof DataChannelMessage;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $type = this.getType();
-        result = result * PRIME + ($type == null ? 43 : $type.hashCode());
-        final Object $payload = this.getPayload();
-        result = result * PRIME + ($payload == null ? 43 : $payload.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "DataChannelMessage(type=" + this.getType() + ", payload=" + this.getPayload() + ")";
-    }
-}

+ 43 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessage.kt

@@ -0,0 +1,43 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.AnyParceler
+import kotlinx.android.parcel.Parcelize
+import kotlinx.android.parcel.TypeParceler
+
+@Parcelize
+@JsonObject
+@TypeParceler<Any?, AnyParceler>
+data class DataChannelMessage(
+    @JsonField(name = ["type"])
+    var type: String? = null,
+    @JsonField(name = ["payload"])
+    var payload: Any? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+    constructor(type: String) : this(type, null)
+}

+ 0 - 102
app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessageNick.java

@@ -1,102 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.converters.ObjectParcelConverter;
-
-import org.parceler.ParcelPropertyConverter;
-
-import java.util.HashMap;
-
-@JsonObject
-public class DataChannelMessageNick {
-    @JsonField(name = "type")
-    String type;
-
-    @ParcelPropertyConverter(ObjectParcelConverter.class)
-    @JsonField(name = "payload")
-    HashMap<String, String> payload;
-
-    public DataChannelMessageNick(String type) {
-        this.type = type;
-    }
-
-    public DataChannelMessageNick() {
-    }
-
-    public String getType() {
-        return this.type;
-    }
-
-    public HashMap<String, String> getPayload() {
-        return this.payload;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public void setPayload(HashMap<String, String> payload) {
-        this.payload = payload;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof DataChannelMessageNick)) {
-            return false;
-        }
-        final DataChannelMessageNick other = (DataChannelMessageNick) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$type = this.getType();
-        final Object other$type = other.getType();
-        if (this$type == null ? other$type != null : !this$type.equals(other$type)) {
-            return false;
-        }
-        final Object this$payload = this.getPayload();
-        final Object other$payload = other.getPayload();
-
-        return this$payload == null ? other$payload == null : this$payload.equals(other$payload);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof DataChannelMessageNick;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $type = this.getType();
-        result = result * PRIME + ($type == null ? 43 : $type.hashCode());
-        final Object $payload = this.getPayload();
-        result = result * PRIME + ($payload == null ? 43 : $payload.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "DataChannelMessageNick(type=" + this.getType() + ", payload=" + this.getPayload() + ")";
-    }
-}

+ 40 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/DataChannelMessageNick.kt

@@ -0,0 +1,40 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import java.util.HashMap
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class DataChannelMessageNick(
+    @JsonField(name = ["type"])
+    var type: String? = null,
+    @JsonField(name = ["payload"])
+    var payload: HashMap<String, String>? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 107
app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.java

@@ -1,107 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-@JsonObject
-@Parcel
-public class NCIceCandidate {
-    @JsonField(name = "sdpMLineIndex")
-    int sdpMLineIndex;
-
-    @JsonField(name = "sdpMid")
-    String sdpMid;
-
-    @JsonField(name = "candidate")
-    String candidate;
-
-    public int getSdpMLineIndex() {
-        return this.sdpMLineIndex;
-    }
-
-    public String getSdpMid() {
-        return this.sdpMid;
-    }
-
-    public String getCandidate() {
-        return this.candidate;
-    }
-
-    public void setSdpMLineIndex(int sdpMLineIndex) {
-        this.sdpMLineIndex = sdpMLineIndex;
-    }
-
-    public void setSdpMid(String sdpMid) {
-        this.sdpMid = sdpMid;
-    }
-
-    public void setCandidate(String candidate) {
-        this.candidate = candidate;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof NCIceCandidate)) {
-            return false;
-        }
-        final NCIceCandidate other = (NCIceCandidate) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        if (this.getSdpMLineIndex() != other.getSdpMLineIndex()) {
-            return false;
-        }
-        final Object this$sdpMid = this.getSdpMid();
-        final Object other$sdpMid = other.getSdpMid();
-        if (this$sdpMid == null ? other$sdpMid != null : !this$sdpMid.equals(other$sdpMid)) {
-            return false;
-        }
-        final Object this$candidate = this.getCandidate();
-        final Object other$candidate = other.getCandidate();
-
-        return this$candidate == null ? other$candidate == null : this$candidate.equals(other$candidate);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof NCIceCandidate;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        result = result * PRIME + this.getSdpMLineIndex();
-        final Object $sdpMid = this.getSdpMid();
-        result = result * PRIME + ($sdpMid == null ? 43 : $sdpMid.hashCode());
-        final Object $candidate = this.getCandidate();
-        result = result * PRIME + ($candidate == null ? 43 : $candidate.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "NCIceCandidate(sdpMLineIndex=" + this.getSdpMLineIndex() + ", sdpMid=" + this.getSdpMid() + ", candidate=" + this.getCandidate() + ")";
-    }
-}

+ 41 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/NCIceCandidate.kt

@@ -0,0 +1,41 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class NCIceCandidate(
+    @JsonField(name = ["sdpMLineIndex"])
+    var sdpMLineIndex: Int = 0,
+    @JsonField(name = ["sdpMid"])
+    var sdpMid: String? = null,
+    @JsonField(name = ["candidate"])
+    var candidate: String? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(0, null, null)
+}

+ 0 - 146
app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.java

@@ -1,146 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-@JsonObject
-@Parcel
-public class NCMessagePayload {
-    @JsonField(name = "type")
-    String type;
-
-    @JsonField(name = "sdp")
-    String sdp;
-
-    @JsonField(name = "nick")
-    String nick;
-
-    @JsonField(name = "candidate")
-    NCIceCandidate iceCandidate;
-
-    @JsonField(name = "name")
-    String name;
-
-    public String getType() {
-        return this.type;
-    }
-
-    public String getSdp() {
-        return this.sdp;
-    }
-
-    public String getNick() {
-        return this.nick;
-    }
-
-    public NCIceCandidate getIceCandidate() {
-        return this.iceCandidate;
-    }
-
-    public String getName() {
-        return this.name;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public void setSdp(String sdp) {
-        this.sdp = sdp;
-    }
-
-    public void setNick(String nick) {
-        this.nick = nick;
-    }
-
-    public void setIceCandidate(NCIceCandidate iceCandidate) {
-        this.iceCandidate = iceCandidate;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof NCMessagePayload)) {
-            return false;
-        }
-        final NCMessagePayload other = (NCMessagePayload) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$type = this.getType();
-        final Object other$type = other.getType();
-        if (this$type == null ? other$type != null : !this$type.equals(other$type)) {
-            return false;
-        }
-        final Object this$sdp = this.getSdp();
-        final Object other$sdp = other.getSdp();
-        if (this$sdp == null ? other$sdp != null : !this$sdp.equals(other$sdp)) {
-            return false;
-        }
-        final Object this$nick = this.getNick();
-        final Object other$nick = other.getNick();
-        if (this$nick == null ? other$nick != null : !this$nick.equals(other$nick)) {
-            return false;
-        }
-        final Object this$iceCandidate = this.getIceCandidate();
-        final Object other$iceCandidate = other.getIceCandidate();
-        if (this$iceCandidate == null ? other$iceCandidate != null : !this$iceCandidate.equals(other$iceCandidate)) {
-            return false;
-        }
-        final Object this$name = this.getName();
-        final Object other$name = other.getName();
-
-        return this$name == null ? other$name == null : this$name.equals(other$name);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof NCMessagePayload;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $type = this.getType();
-        result = result * PRIME + ($type == null ? 43 : $type.hashCode());
-        final Object $sdp = this.getSdp();
-        result = result * PRIME + ($sdp == null ? 43 : $sdp.hashCode());
-        final Object $nick = this.getNick();
-        result = result * PRIME + ($nick == null ? 43 : $nick.hashCode());
-        final Object $iceCandidate = this.getIceCandidate();
-        result = result * PRIME + ($iceCandidate == null ? 43 : $iceCandidate.hashCode());
-        final Object $name = this.getName();
-        result = result * PRIME + ($name == null ? 43 : $name.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "NCMessagePayload(type=" + this.getType() + ", sdp=" + this.getSdp() + ", nick=" + this.getNick() + ", iceCandidate=" + this.getIceCandidate() + ", name=" + this.getName() + ")";
-    }
-}

+ 45 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessagePayload.kt

@@ -0,0 +1,45 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class NCMessagePayload(
+    @JsonField(name = ["type"])
+    var type: String? = null,
+    @JsonField(name = ["sdp"])
+    var sdp: String? = null,
+    @JsonField(name = ["nick"])
+    var nick: String? = null,
+    @JsonField(name = ["candidate"])
+    var iceCandidate: NCIceCandidate? = null,
+    @JsonField(name = ["name"])
+    var name: String? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null, null, null, null)
+}

+ 0 - 111
app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.java

@@ -1,111 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-@JsonObject
-@Parcel
-public class NCMessageWrapper {
-    @JsonField(name = "fn")
-    NCSignalingMessage signalingMessage;
-
-    // always a "message"
-    @JsonField(name = "ev")
-    String ev;
-
-    @JsonField(name = "sessionId")
-    String sessionId;
-
-    public NCSignalingMessage getSignalingMessage() {
-        return this.signalingMessage;
-    }
-
-    public String getEv() {
-        return this.ev;
-    }
-
-    public String getSessionId() {
-        return this.sessionId;
-    }
-
-    public void setSignalingMessage(NCSignalingMessage signalingMessage) {
-        this.signalingMessage = signalingMessage;
-    }
-
-    public void setEv(String ev) {
-        this.ev = ev;
-    }
-
-    public void setSessionId(String sessionId) {
-        this.sessionId = sessionId;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof NCMessageWrapper)) {
-            return false;
-        }
-        final NCMessageWrapper other = (NCMessageWrapper) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$signalingMessage = this.getSignalingMessage();
-        final Object other$signalingMessage = other.getSignalingMessage();
-        if (this$signalingMessage == null ? other$signalingMessage != null : !this$signalingMessage.equals(other$signalingMessage)) {
-            return false;
-        }
-        final Object this$ev = this.getEv();
-        final Object other$ev = other.getEv();
-        if (this$ev == null ? other$ev != null : !this$ev.equals(other$ev)) {
-            return false;
-        }
-        final Object this$sessionId = this.getSessionId();
-        final Object other$sessionId = other.getSessionId();
-
-        return this$sessionId == null ? other$sessionId == null : this$sessionId.equals(other$sessionId);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof NCMessageWrapper;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $signalingMessage = this.getSignalingMessage();
-        result = result * PRIME + ($signalingMessage == null ? 43 : $signalingMessage.hashCode());
-        final Object $ev = this.getEv();
-        result = result * PRIME + ($ev == null ? 43 : $ev.hashCode());
-        final Object $sessionId = this.getSessionId();
-        result = result * PRIME + ($sessionId == null ? 43 : $sessionId.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "NCMessageWrapper(signalingMessage=" + this.getSignalingMessage() + ", ev=" + this.getEv() + ", sessionId=" + this.getSessionId() + ")";
-    }
-}

+ 42 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/NCMessageWrapper.kt

@@ -0,0 +1,42 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class NCMessageWrapper(
+    @JsonField(name = ["fn"])
+    var signalingMessage: NCSignalingMessage? = null,
+    /** always a "message" */
+    @JsonField(name = ["ev"])
+    var ev: String? = null,
+    @JsonField(name = ["sessionId"])
+    var sessionId: String? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null, null)
+}

+ 0 - 176
app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.java

@@ -1,176 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import org.parceler.Parcel;
-
-@JsonObject
-@Parcel
-public class NCSignalingMessage {
-    @JsonField(name = "from")
-    String from;
-    @JsonField(name = "to")
-    String to;
-    @JsonField(name = "type")
-    String type;
-    @JsonField(name = "payload")
-    NCMessagePayload payload;
-    @JsonField(name = "roomType")
-    String roomType;
-    @JsonField(name = "sid")
-    String sid;
-    @JsonField(name = "prefix")
-    String prefix;
-
-    public String getFrom() {
-        return this.from;
-    }
-
-    public String getTo() {
-        return this.to;
-    }
-
-    public String getType() {
-        return this.type;
-    }
-
-    public NCMessagePayload getPayload() {
-        return this.payload;
-    }
-
-    public String getRoomType() {
-        return this.roomType;
-    }
-
-    public String getSid() {
-        return this.sid;
-    }
-
-    public String getPrefix() {
-        return this.prefix;
-    }
-
-    public void setFrom(String from) {
-        this.from = from;
-    }
-
-    public void setTo(String to) {
-        this.to = to;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public void setPayload(NCMessagePayload payload) {
-        this.payload = payload;
-    }
-
-    public void setRoomType(String roomType) {
-        this.roomType = roomType;
-    }
-
-    public void setSid(String sid) {
-        this.sid = sid;
-    }
-
-    public void setPrefix(String prefix) {
-        this.prefix = prefix;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof NCSignalingMessage)) {
-            return false;
-        }
-        final NCSignalingMessage other = (NCSignalingMessage) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$from = this.getFrom();
-        final Object other$from = other.getFrom();
-        if (this$from == null ? other$from != null : !this$from.equals(other$from)) {
-            return false;
-        }
-        final Object this$to = this.getTo();
-        final Object other$to = other.getTo();
-        if (this$to == null ? other$to != null : !this$to.equals(other$to)) {
-            return false;
-        }
-        final Object this$type = this.getType();
-        final Object other$type = other.getType();
-        if (this$type == null ? other$type != null : !this$type.equals(other$type)) {
-            return false;
-        }
-        final Object this$payload = this.getPayload();
-        final Object other$payload = other.getPayload();
-        if (this$payload == null ? other$payload != null : !this$payload.equals(other$payload)) {
-            return false;
-        }
-        final Object this$roomType = this.getRoomType();
-        final Object other$roomType = other.getRoomType();
-        if (this$roomType == null ? other$roomType != null : !this$roomType.equals(other$roomType)) {
-            return false;
-        }
-        final Object this$sid = this.getSid();
-        final Object other$sid = other.getSid();
-        if (this$sid == null ? other$sid != null : !this$sid.equals(other$sid)) {
-            return false;
-        }
-        final Object this$prefix = this.getPrefix();
-        final Object other$prefix = other.getPrefix();
-
-        return this$prefix == null ? other$prefix == null : this$prefix.equals(other$prefix);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof NCSignalingMessage;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $from = this.getFrom();
-        result = result * PRIME + ($from == null ? 43 : $from.hashCode());
-        final Object $to = this.getTo();
-        result = result * PRIME + ($to == null ? 43 : $to.hashCode());
-        final Object $type = this.getType();
-        result = result * PRIME + ($type == null ? 43 : $type.hashCode());
-        final Object $payload = this.getPayload();
-        result = result * PRIME + ($payload == null ? 43 : $payload.hashCode());
-        final Object $roomType = this.getRoomType();
-        result = result * PRIME + ($roomType == null ? 43 : $roomType.hashCode());
-        final Object $sid = this.getSid();
-        result = result * PRIME + ($sid == null ? 43 : $sid.hashCode());
-        final Object $prefix = this.getPrefix();
-        result = result * PRIME + ($prefix == null ? 43 : $prefix.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "NCSignalingMessage(from=" + this.getFrom() + ", to=" + this.getTo() + ", type=" + this.getType() + ", payload=" + this.getPayload() + ", roomType=" + this.getRoomType() + ", sid=" + this.getSid() + ", prefix=" + this.getPrefix() + ")";
-    }
-}

+ 49 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/NCSignalingMessage.kt

@@ -0,0 +1,49 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class NCSignalingMessage(
+    @JsonField(name = ["from"])
+    var from: String? = null,
+    @JsonField(name = ["to"])
+    var to: String? = null,
+    @JsonField(name = ["type"])
+    var type: String? = null,
+    @JsonField(name = ["payload"])
+    var payload: NCMessagePayload? = null,
+    @JsonField(name = ["roomType"])
+    var roomType: String? = null,
+    @JsonField(name = ["sid"])
+    var sid: String? = null,
+    @JsonField(name = ["prefix"])
+    var prefix: String? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null, null, null, null, null, null)
+}

+ 0 - 93
app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.java

@@ -1,93 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-/**
- * Created by mdjanic on 30/10/2017.
- */
-
-@JsonObject
-public class Signaling {
-    @JsonField(name = "type")
-    String type;
-    //can be NCMessageWrapper or List<HashMap<String,String>>
-    @JsonField(name = "data")
-    Object messageWrapper;
-
-    public String getType() {
-        return this.type;
-    }
-
-    public Object getMessageWrapper() {
-        return this.messageWrapper;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public void setMessageWrapper(Object messageWrapper) {
-        this.messageWrapper = messageWrapper;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof Signaling)) {
-            return false;
-        }
-        final Signaling other = (Signaling) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$type = this.getType();
-        final Object other$type = other.getType();
-        if (this$type == null ? other$type != null : !this$type.equals(other$type)) {
-            return false;
-        }
-        final Object this$messageWrapper = this.getMessageWrapper();
-        final Object other$messageWrapper = other.getMessageWrapper();
-
-        return this$messageWrapper == null ? other$messageWrapper == null : this$messageWrapper.equals(other$messageWrapper);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof Signaling;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $type = this.getType();
-        result = result * PRIME + ($type == null ? 43 : $type.hashCode());
-        final Object $messageWrapper = this.getMessageWrapper();
-        result = result * PRIME + ($messageWrapper == null ? 43 : $messageWrapper.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "Signaling(type=" + this.getType() + ", messageWrapper=" + this.getMessageWrapper() + ")";
-    }
-}

+ 43 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/Signaling.kt

@@ -0,0 +1,43 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.AnyParceler
+import kotlinx.android.parcel.Parcelize
+import kotlinx.android.parcel.TypeParceler
+
+@Parcelize
+@JsonObject
+@TypeParceler<Any?, AnyParceler>
+data class Signaling(
+    @JsonField(name = ["type"])
+    var type: String? = null,
+    /** can be NCMessageWrapper or List<HashMap<String,String>> */
+    @JsonField(name = ["data"])
+    var messageWrapper: Any? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 74
app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.java

@@ -1,74 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.generic.GenericOCS;
-
-import java.util.List;
-
-@JsonObject
-public class SignalingOCS extends GenericOCS {
-    @JsonField(name = "data")
-    List<Signaling> signalings;
-
-    public List<Signaling> getSignalings() {
-        return this.signalings;
-    }
-
-    public void setSignalings(List<Signaling> signalings) {
-        this.signalings = signalings;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof SignalingOCS)) {
-            return false;
-        }
-        final SignalingOCS other = (SignalingOCS) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$signalings = this.getSignalings();
-        final Object other$signalings = other.getSignalings();
-
-        return this$signalings == null ? other$signalings == null : this$signalings.equals(other$signalings);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof SignalingOCS;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $signalings = this.getSignalings();
-        result = result * PRIME + ($signalings == null ? 43 : $signalings.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "SignalingOCS(signalings=" + this.getSignalings() + ")";
-    }
-}

+ 40 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOCS.kt

@@ -0,0 +1,40 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import com.nextcloud.talk.models.json.generic.GenericMeta
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+class SignalingOCS(
+    @JsonField(name = ["meta"])
+    var meta: GenericMeta?,
+    @JsonField(name = ["data"])
+    var signalings: List<Signaling>? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null)
+}

+ 0 - 71
app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.java

@@ -1,71 +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.models.json.signaling;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-@JsonObject
-public class SignalingOverall {
-    @JsonField(name = "ocs")
-    SignalingOCS ocs;
-
-    public SignalingOCS getOcs() {
-        return this.ocs;
-    }
-
-    public void setOcs(SignalingOCS ocs) {
-        this.ocs = ocs;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof SignalingOverall)) {
-            return false;
-        }
-        final SignalingOverall other = (SignalingOverall) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$ocs = this.getOcs();
-        final Object other$ocs = other.getOcs();
-
-        return this$ocs == null ? other$ocs == null : this$ocs.equals(other$ocs);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof SignalingOverall;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $ocs = this.getOcs();
-        result = result * PRIME + ($ocs == null ? 43 : $ocs.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "SignalingOverall(ocs=" + this.getOcs() + ")";
-    }
-}

+ 37 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/SignalingOverall.kt

@@ -0,0 +1,37 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+class SignalingOverall(
+    @JsonField(name = ["ocs"])
+    var ocs: SignalingOCS? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null)
+}

+ 0 - 129
app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.java

@@ -1,129 +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.models.json.signaling.settings;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import java.util.List;
-
-@JsonObject
-public class IceServer {
-    @Deprecated
-    @JsonField(name = "url")
-    String url;
-
-    @JsonField(name = "urls")
-    List<String> urls;
-
-    @JsonField(name = "username")
-    String username;
-
-    @JsonField(name = "credential")
-    String credential;
-
-    @Deprecated
-    public String getUrl() {
-        return this.url;
-    }
-
-    public List<String> getUrls() {
-        return this.urls;
-    }
-
-    public String getUsername() {
-        return this.username;
-    }
-
-    public String getCredential() {
-        return this.credential;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public void setUrls(List<String> urls) {
-        this.urls = urls;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    public void setCredential(String credential) {
-        this.credential = credential;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof IceServer)) {
-            return false;
-        }
-        final IceServer other = (IceServer) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$url = this.getUrl();
-        final Object other$url = other.getUrl();
-        if (this$url == null ? other$url != null : !this$url.equals(other$url)) {
-            return false;
-        }
-        final Object this$urls = this.getUrls();
-        final Object other$urls = other.getUrls();
-        if (this$urls == null ? other$urls != null : !this$urls.equals(other$urls)) {
-            return false;
-        }
-        final Object this$username = this.getUsername();
-        final Object other$username = other.getUsername();
-        if (this$username == null ? other$username != null : !this$username.equals(other$username)) {
-            return false;
-        }
-        final Object this$credential = this.getCredential();
-        final Object other$credential = other.getCredential();
-
-        return this$credential == null ? other$credential == null : this$credential.equals(other$credential);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof IceServer;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $url = this.getUrl();
-        result = result * PRIME + ($url == null ? 43 : $url.hashCode());
-        final Object $urls = this.getUrls();
-        result = result * PRIME + ($urls == null ? 43 : $urls.hashCode());
-        final Object $username = this.getUsername();
-        result = result * PRIME + ($username == null ? 43 : $username.hashCode());
-        final Object $credential = this.getCredential();
-        result = result * PRIME + ($credential == null ? 43 : $credential.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "IceServer(url=" + this.getUrl() + ", urls=" + this.getUrls() + ", username=" + this.getUsername() + ", credential=" + this.getCredential() + ")";
-    }
-}

+ 44 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/IceServer.kt

@@ -0,0 +1,44 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling.settings
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class IceServer(
+    @Deprecated("")
+    @JsonField(name = ["url"])
+    var url: String? = null,
+    @JsonField(name = ["urls"])
+    var urls: List<String>? = null,
+    @JsonField(name = ["username"])
+    var username: String? = null,
+    @JsonField(name = ["credential"])
+    var credential: String? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null, null)
+}

+ 0 - 127
app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.java

@@ -1,127 +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.models.json.signaling.settings;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-
-import java.util.List;
-
-@JsonObject
-public class Settings {
-    @JsonField(name = "stunservers")
-    List<IceServer> stunServers;
-
-    @JsonField(name = "turnservers")
-    List<IceServer> turnServers;
-
-    @JsonField(name = "server")
-    String externalSignalingServer;
-
-    @JsonField(name = "ticket")
-    String externalSignalingTicket;
-
-    public List<IceServer> getStunServers() {
-        return this.stunServers;
-    }
-
-    public List<IceServer> getTurnServers() {
-        return this.turnServers;
-    }
-
-    public String getExternalSignalingServer() {
-        return this.externalSignalingServer;
-    }
-
-    public String getExternalSignalingTicket() {
-        return this.externalSignalingTicket;
-    }
-
-    public void setStunServers(List<IceServer> stunServers) {
-        this.stunServers = stunServers;
-    }
-
-    public void setTurnServers(List<IceServer> turnServers) {
-        this.turnServers = turnServers;
-    }
-
-    public void setExternalSignalingServer(String externalSignalingServer) {
-        this.externalSignalingServer = externalSignalingServer;
-    }
-
-    public void setExternalSignalingTicket(String externalSignalingTicket) {
-        this.externalSignalingTicket = externalSignalingTicket;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof Settings)) {
-            return false;
-        }
-        final Settings other = (Settings) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$stunServers = this.getStunServers();
-        final Object other$stunServers = other.getStunServers();
-        if (this$stunServers == null ? other$stunServers != null : !this$stunServers.equals(other$stunServers)) {
-            return false;
-        }
-        final Object this$turnServers = this.getTurnServers();
-        final Object other$turnServers = other.getTurnServers();
-        if (this$turnServers == null ? other$turnServers != null : !this$turnServers.equals(other$turnServers)) {
-            return false;
-        }
-        final Object this$externalSignalingServer = this.getExternalSignalingServer();
-        final Object other$externalSignalingServer = other.getExternalSignalingServer();
-        if (this$externalSignalingServer == null ? other$externalSignalingServer != null : !this$externalSignalingServer.equals(other$externalSignalingServer)) {
-            return false;
-        }
-        final Object this$externalSignalingTicket = this.getExternalSignalingTicket();
-        final Object other$externalSignalingTicket = other.getExternalSignalingTicket();
-
-        return this$externalSignalingTicket == null ? other$externalSignalingTicket == null : this$externalSignalingTicket.equals(other$externalSignalingTicket);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof Settings;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $stunServers = this.getStunServers();
-        result = result * PRIME + ($stunServers == null ? 43 : $stunServers.hashCode());
-        final Object $turnServers = this.getTurnServers();
-        result = result * PRIME + ($turnServers == null ? 43 : $turnServers.hashCode());
-        final Object $externalSignalingServer = this.getExternalSignalingServer();
-        result = result * PRIME + ($externalSignalingServer == null ? 43 : $externalSignalingServer.hashCode());
-        final Object $externalSignalingTicket = this.getExternalSignalingTicket();
-        result = result * PRIME + ($externalSignalingTicket == null ? 43 : $externalSignalingTicket.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "Settings(stunServers=" + this.getStunServers() + ", turnServers=" + this.getTurnServers() + ", externalSignalingServer=" + this.getExternalSignalingServer() + ", externalSignalingTicket=" + this.getExternalSignalingTicket() + ")";
-    }
-}

+ 43 - 0
app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/Settings.kt

@@ -0,0 +1,43 @@
+/*
+ * Nextcloud Talk application
+ *
+ * @author Mario Danic
+ * @author Andy Scherzinger
+ * Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
+ * 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.models.json.signaling.settings
+
+import android.os.Parcelable
+import com.bluelinelabs.logansquare.annotation.JsonField
+import com.bluelinelabs.logansquare.annotation.JsonObject
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+@JsonObject
+data class Settings(
+    @JsonField(name = ["stunservers"])
+    var stunServers: List<IceServer>? = null,
+    @JsonField(name = ["turnservers"])
+    var turnServers: List<IceServer>? = null,
+    @JsonField(name = ["server"])
+    var externalSignalingServer: String? = null,
+    @JsonField(name = ["ticket"])
+    var externalSignalingTicket: String? = null
+) : Parcelable {
+    // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
+    constructor() : this(null, null, null)
+}

+ 0 - 72
app/src/main/java/com/nextcloud/talk/models/json/signaling/settings/SignalingSettingsOcs.java

@@ -1,72 +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.models.json.signaling.settings;
-
-import com.bluelinelabs.logansquare.annotation.JsonField;
-import com.bluelinelabs.logansquare.annotation.JsonObject;
-import com.nextcloud.talk.models.json.generic.GenericOCS;
-
-@JsonObject
-public class SignalingSettingsOcs extends GenericOCS {
-    @JsonField(name = "data")
-    Settings settings;
-
-    public Settings getSettings() {
-        return this.settings;
-    }
-
-    public void setSettings(Settings settings) {
-        this.settings = settings;
-    }
-
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof SignalingSettingsOcs)) {
-            return false;
-        }
-        final SignalingSettingsOcs other = (SignalingSettingsOcs) o;
-        if (!other.canEqual((Object) this)) {
-            return false;
-        }
-        final Object this$settings = this.getSettings();
-        final Object other$settings = other.getSettings();
-
-        return this$settings == null ? other$settings == null : this$settings.equals(other$settings);
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof SignalingSettingsOcs;
-    }
-
-    public int hashCode() {
-        final int PRIME = 59;
-        int result = 1;
-        final Object $settings = this.getSettings();
-        result = result * PRIME + ($settings == null ? 43 : $settings.hashCode());
-        return result;
-    }
-
-    public String toString() {
-        return "SignalingSettingsOcs(settings=" + this.getSettings() + ")";
-    }
-}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно