From a617f104739cb5825a122e91aa7902a507f13df1 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 16 May 2022 23:06:29 +0200 Subject: [PATCH 1/7] Migrate participant to kotlin data class Signed-off-by: Andy Scherzinger --- .../talk/activities/CallActivity.java | 4 +- .../activities/CallNotificationActivity.java | 4 +- .../talk/adapters/items/AdvancedUserItem.java | 2 +- .../talk/adapters/items/ContactItem.java | 20 +- .../talk/adapters/items/ParticipantItem.java | 50 +-- .../talk/controllers/ContactsController.kt | 92 ++--- .../controllers/ConversationInfoController.kt | 20 +- .../controllers/SwitchAccountController.kt | 12 +- .../models/json/participants/Participant.java | 341 ------------------ .../models/json/participants/Participant.kt | 140 +++++++ .../talk/webrtc/MagicWebSocketInstance.java | 4 +- 11 files changed, 244 insertions(+), 445 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 4ceefb3fd..b4430b314 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -2240,8 +2240,8 @@ public class CallActivity extends CallBaseActivity { String userId = ""; if (hasMCU) { userId = webSocketClient.getUserIdForSession(session); - } else if (participantMap.get(session).getActorType() == Participant.ActorType.USERS) { - userId = participantMap.get(session).getActorId(); + } else if (participantMap.get(session).getCalculatedActorType() == Participant.ActorType.USERS) { + userId = participantMap.get(session).getCalculatedActorId(); } String urlForAvatar; diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java index 075888eea..34a73294b 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java @@ -238,8 +238,8 @@ public class CallNotificationActivity extends CallBaseActivity { if (hasParticipantsInCall) { for (Participant participant : participantList) { - if (participant.getActorType() == Participant.ActorType.USERS && - participant.getActorId().equals(userBeingCalled.getUserId())) { + if (participant.getCalculatedActorType() == Participant.ActorType.USERS && + participant.getCalculatedActorId().equals(userBeingCalled.getUserId())) { inCallOnDifferentDevice = true; break; } diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java b/app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java index 6a5d5118a..b7eddf345 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/AdvancedUserItem.java @@ -140,7 +140,7 @@ public class AdvancedUserItem extends AbstractFlexibleItem 0) { holder.binding.videoCallIcon.setImageResource(R.drawable.ic_call_grey_600_24dp); holder.binding.videoCallIcon.setVisibility(View.VISIBLE); holder.binding.videoCallIcon.setContentDescription( - resources.getString(R.string.nc_call_state_with_phone, participant.displayName)); + resources.getString(R.string.nc_call_state_with_phone, participant.getDisplayName())); } else if ((inCallFlag & InCallFlags.WITH_VIDEO) > 0) { holder.binding.videoCallIcon.setImageResource(R.drawable.ic_videocam_grey_600_24dp); holder.binding.videoCallIcon.setVisibility(View.VISIBLE); holder.binding.videoCallIcon.setContentDescription( - resources.getString(R.string.nc_call_state_with_video, participant.displayName)); + resources.getString(R.string.nc_call_state_with_video, participant.getDisplayName())); } else if (inCallFlag > InCallFlags.DISCONNECTED) { holder.binding.videoCallIcon.setImageResource(R.drawable.ic_mic_grey_600_24dp); holder.binding.videoCallIcon.setVisibility(View.VISIBLE); holder.binding.videoCallIcon.setContentDescription( - resources.getString(R.string.nc_call_state_in_call, participant.displayName)); + resources.getString(R.string.nc_call_state_in_call, participant.getDisplayName())); } else { holder.binding.videoCallIcon.setVisibility(View.GONE); } @@ -226,13 +226,13 @@ public class ParticipantItem extends AbstractFlexibleItem { + participant.calculatedActorType == Participant.ActorType.GROUPS -> { resources!!.getString(R.string.nc_groups) } - participant.getActorType() == Participant.ActorType.CIRCLES -> { + participant.calculatedActorType == Participant.ActorType.CIRCLES -> { resources!!.getString(R.string.nc_circles) } else -> { - participant.getDisplayName().substring(0, 1).toUpperCase(Locale.getDefault()) + participant.displayName!!.substring(0, 1).toUpperCase(Locale.getDefault()) } } } @@ -541,10 +541,10 @@ class ContactsController(args: Bundle) : actorTypeConverter: EnumActorTypeConverter ): Participant { val participant = Participant() - participant.setActorId(autocompleteUser.id) - participant.setActorType(actorTypeConverter.getFromString(autocompleteUser.source)) - participant.setDisplayName(autocompleteUser.label) - participant.setSource(autocompleteUser.source) + participant.actorId = autocompleteUser.id + participant.actorType = actorTypeConverter.getFromString(autocompleteUser.source) + participant.displayName = autocompleteUser.label + participant.source = autocompleteUser.source return participant } @@ -554,18 +554,18 @@ class ContactsController(args: Bundle) : newUserItemList, { o1: AbstractFlexibleItem<*>, o2: AbstractFlexibleItem<*> -> val firstName: String = if (o1 is ContactItem) { - (o1 as ContactItem).model.getDisplayName() + (o1 as ContactItem).model.displayName!! } else { (o1 as GenericTextHeaderItem).model } val secondName: String = if (o2 is ContactItem) { - (o2 as ContactItem).model.getDisplayName() + (o2 as ContactItem).model.displayName!! } else { (o2 as GenericTextHeaderItem).model } if (o1 is ContactItem && o2 is ContactItem) { - val firstSource: String = (o1 as ContactItem).model.getSource() - val secondSource: String = (o2 as ContactItem).model.getSource() + val firstSource: String = (o1 as ContactItem).model.source!! + val secondSource: String = (o2 as ContactItem).model.source!! if (firstSource == secondSource) { return@sort firstName.compareTo(secondName, ignoreCase = true) } @@ -602,23 +602,23 @@ class ContactsController(args: Bundle) : contactItems ) { o1: AbstractFlexibleItem<*>, o2: AbstractFlexibleItem<*> -> val firstName: String = if (o1 is ContactItem) { - (o1 as ContactItem).model.getDisplayName() + (o1 as ContactItem).model.displayName!! } else { (o1 as GenericTextHeaderItem).model } val secondName: String = if (o2 is ContactItem) { - (o2 as ContactItem).model.getDisplayName() + (o2 as ContactItem).model.displayName!! } else { (o2 as GenericTextHeaderItem).model } if (o1 is ContactItem && o2 is ContactItem) { - if ("groups" == (o1 as ContactItem).model.getSource() && - "groups" == (o2 as ContactItem).model.getSource() + if ("groups" == (o1 as ContactItem).model.source && + "groups" == (o2 as ContactItem).model.source ) { return@sort firstName.compareTo(secondName, ignoreCase = true) - } else if ("groups" == (o1 as ContactItem).model.getSource()) { + } else if ("groups" == (o1 as ContactItem).model.source) { return@sort -1 - } else if ("groups" == (o2 as ContactItem).model.getSource()) { + } else if ("groups" == (o2 as ContactItem).model.source) { return@sort 1 } } @@ -776,7 +776,7 @@ class ContactsController(args: Bundle) : } private fun updateSelection(contactItem: ContactItem) { - contactItem.model.isSelected = !contactItem.model.isSelected + contactItem.model.selected = !contactItem.model.selected updateSelectionLists(contactItem.model) if (CapabilitiesUtil.hasSpreedFeatureCapability(currentUser, "last-room-activity") && !CapabilitiesUtil.hasSpreedFeatureCapability(currentUser, "invite-groups-and-mails") && @@ -786,12 +786,12 @@ class ContactsController(args: Bundle) : var internalParticipant: Participant for (i in currentItems.indices) { internalParticipant = currentItems[i].model - if (internalParticipant.getActorId() == contactItem.model.getActorId() && - internalParticipant.getActorType() == Participant.ActorType.GROUPS && - internalParticipant.isSelected + if (internalParticipant.calculatedActorId == contactItem.model.calculatedActorId && + internalParticipant.calculatedActorType == Participant.ActorType.GROUPS && + internalParticipant.selected ) { - internalParticipant.isSelected = false - selectedGroupIds.remove(internalParticipant.getActorId()) + internalParticipant.selected = false + selectedGroupIds.remove(internalParticipant.calculatedActorId!!) } } } @@ -801,7 +801,7 @@ class ContactsController(args: Bundle) : private fun createRoom(contactItem: ContactItem) { var roomType = "1" - if ("groups" == contactItem.model.getSource()) { + if ("groups" == contactItem.model.source) { roomType = "2" } val apiVersion: Int = ApiUtils.getConversationApiVersion(currentUser, intArrayOf(ApiUtils.APIv4, 1)) @@ -810,7 +810,7 @@ class ContactsController(args: Bundle) : currentUser!!.baseUrl, roomType, null, - contactItem.model.getActorId(), + contactItem.model.calculatedActorId, null ) ncApi.createRoom( @@ -853,29 +853,29 @@ class ContactsController(args: Bundle) : } private fun updateSelectionLists(participant: Participant) { - if ("groups" == participant.getSource()) { - if (participant.isSelected) { - selectedGroupIds.add(participant.getActorId()) + if ("groups" == participant.source) { + if (participant.selected) { + selectedGroupIds.add(participant.calculatedActorId!!) } else { - selectedGroupIds.remove(participant.getActorId()) + selectedGroupIds.remove(participant.calculatedActorId!!) } - } else if ("emails" == participant.getSource()) { - if (participant.isSelected) { - selectedEmails.add(participant.getActorId()) + } else if ("emails" == participant.source) { + if (participant.selected) { + selectedEmails.add(participant.calculatedActorId!!) } else { - selectedEmails.remove(participant.getActorId()) + selectedEmails.remove(participant.calculatedActorId!!) } - } else if ("circles" == participant.getSource()) { - if (participant.isSelected) { - selectedCircleIds.add(participant.getActorId()) + } else if ("circles" == participant.source) { + if (participant.selected) { + selectedCircleIds.add(participant.calculatedActorId!!) } else { - selectedCircleIds.remove(participant.getActorId()) + selectedCircleIds.remove(participant.calculatedActorId!!) } } else { - if (participant.isSelected) { - selectedUserIds.add(participant.getActorId()) + if (participant.selected) { + selectedUserIds.add(participant.calculatedActorId!!) } else { - selectedUserIds.remove(participant.getActorId()) + selectedUserIds.remove(participant.calculatedActorId!!) } } } @@ -885,7 +885,7 @@ class ContactsController(args: Bundle) : participant: Participant, adapter: FlexibleAdapter<*>? ): Boolean { - return "groups" == contactItem.model.getSource() && participant.isSelected && adapter?.selectedItemCount!! > 1 + return "groups" == contactItem.model.source && participant.selected && adapter?.selectedItemCount!! > 1 } private fun joinConversationViaLink() { @@ -917,11 +917,11 @@ class ContactsController(args: Bundle) : for (i in currentItems.indices) { if (currentItems[i] is ContactItem) { internalParticipant = (currentItems[i] as ContactItem).model - if (internalParticipant.getActorType() == Participant.ActorType.GROUPS && - internalParticipant.isSelected + if (internalParticipant.calculatedActorType == Participant.ActorType.GROUPS && + internalParticipant.selected ) { - internalParticipant.isSelected = false - selectedGroupIds.remove(internalParticipant.getActorId()) + internalParticipant.selected = false + selectedGroupIds.remove(internalParticipant.calculatedActorId) } } } @@ -931,7 +931,7 @@ class ContactsController(args: Bundle) : for (i in 0 until adapter!!.itemCount) { if (adapter?.getItem(i) is ContactItem) { val contactItem: ContactItem = adapter?.getItem(i) as ContactItem - if ("groups" == contactItem.model.getSource()) { + if ("groups" == contactItem.model.source) { contactItem.isEnabled = !isPublicCall } } diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt index b60ed878a..fe8f19b01 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt @@ -413,7 +413,7 @@ class ConversationInfoController(args: Bundle) : userItem.isOnline = !participant.sessionIds!!.isEmpty() } - if (participant.getActorType() == USERS && participant.getActorId() == conversationUser!!.userId) { + if (participant.calculatedActorType == USERS && participant.calculatedActorId == conversationUser!!.userId) { ownUserItem = userItem ownUserItem.model.sessionId = "-1" ownUserItem.isOnline = true @@ -494,8 +494,8 @@ class ConversationInfoController(args: Bundle) : val existingParticipantsId = arrayListOf() for (userItem in userItems) { - if (userItem.model.getActorType() == USERS) { - existingParticipantsId.add(userItem.model.getActorId()) + if (userItem.model.calculatedActorType == USERS) { + existingParticipantsId.add(userItem.model.calculatedActorId!!) } } @@ -986,7 +986,7 @@ class ConversationInfoController(args: Bundle) : val apiVersion = ApiUtils.getConversationApiVersion(conversationUser, intArrayOf(ApiUtils.APIv4, 1)) - if (participant.getActorType() == USERS && participant.getActorId() == conversationUser!!.userId) { + if (participant.calculatedActorType == USERS && participant.calculatedActorId == conversationUser!!.userId) { if (participant.attendeePin?.isNotEmpty() == true) { val items = mutableListOf( BasicListItemWithImage( @@ -1013,7 +1013,7 @@ class ConversationInfoController(args: Bundle) : return true } - if (participant.getActorType() == GROUPS) { + if (participant.calculatedActorType == GROUPS) { val items = mutableListOf( BasicListItemWithImage( R.drawable.ic_delete_grey600_24dp, @@ -1033,7 +1033,7 @@ class ConversationInfoController(args: Bundle) : return true } - if (participant.getActorType() == CIRCLES) { + if (participant.calculatedActorType == CIRCLES) { val items = mutableListOf( BasicListItemWithImage( R.drawable.ic_delete_grey600_24dp, @@ -1086,7 +1086,7 @@ class ConversationInfoController(args: Bundle) : items.removeAt(1) } - if (participant.attendeePin == null || participant.attendeePin.isEmpty()) { + if (participant.attendeePin == null || participant.attendeePin!!.isEmpty()) { items.removeAt(0) } @@ -1097,7 +1097,7 @@ class ConversationInfoController(args: Bundle) : title(text = participant.displayName) listItemsWithImage(items = items) { dialog, index, _ -> var actionToTrigger = index - if (participant.attendeePin == null || participant.attendeePin.isEmpty()) { + if (participant.attendeePin == null || participant.attendeePin!!.isEmpty()) { actionToTrigger++ } if (participant.type == Participant.ParticipantType.USER_FOLLOWING_LINK) { @@ -1166,8 +1166,8 @@ class ConversationInfoController(args: Bundle) : return 1 } - return left.model.displayName.toLowerCase(Locale.ROOT).compareTo( - right.model.displayName.toLowerCase(Locale.ROOT) + return left.model.displayName!!.toLowerCase(Locale.ROOT).compareTo( + right.model.displayName!!.toLowerCase(Locale.ROOT) ) } } diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.kt b/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.kt index f29c4be87..a66cffd54 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/SwitchAccountController.kt @@ -156,9 +156,9 @@ class SwitchAccountController(args: Bundle? = null) : userEntity.username } participant = Participant() - participant.setActorType(Participant.ActorType.USERS) - participant.setActorId(userId) - participant.setDisplayName(userEntity.displayName) + participant.actorType = Participant.ActorType.USERS + participant.actorId = userId + participant.displayName = userEntity.displayName userItems.add(AdvancedUserItem(participant, userEntity, null)) } } @@ -171,9 +171,9 @@ class SwitchAccountController(args: Bundle? = null) : account = accountObject importAccount = getInformationFromAccount(account) participant = Participant() - participant.setActorType(Participant.ActorType.USERS) - participant.setActorId(importAccount.getUsername()) - participant.setDisplayName(importAccount.getUsername()) + participant.actorType = Participant.ActorType.USERS + participant.actorId = importAccount.getUsername() + participant.displayName = importAccount.getUsername() userEntity = UserEntity() userEntity.baseUrl = importAccount.getBaseUrl() userItems.add(AdvancedUserItem(participant, userEntity, account)) diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.java b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.java deleted file mode 100644 index 9465e0936..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * - * Nextcloud Talk application - * - * @author Mario Danic - * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.nextcloud.talk.models.json.participants; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; -import com.nextcloud.talk.models.json.converters.EnumActorTypeConverter; -import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter; -import com.nextcloud.talk.models.json.converters.ObjectParcelConverter; - -import org.parceler.Parcel; -import org.parceler.ParcelPropertyConverter; - -import java.util.Arrays; - -@Parcel -@JsonObject -public class Participant { - @JsonField(name = "attendeeId") - public Long attendeeId; - - @JsonField(name = "actorType", typeConverter = EnumActorTypeConverter.class) - public ActorType actorType; - - @JsonField(name = "actorId") - public String actorId; - - @JsonField(name = "attendeePin") - public String attendeePin; - - @Deprecated - @JsonField(name = "userId") - public String userId; - - @JsonField(name = {"type", "participantType"}, typeConverter = EnumParticipantTypeConverter.class) - public ParticipantType type; - - @Deprecated - @JsonField(name = "name") - public String name; - - @JsonField(name = "displayName") - public String displayName; - - @JsonField(name = "lastPing") - public long lastPing; - - @Deprecated - @JsonField(name = "sessionId") - public String sessionId; - - @JsonField(name = "sessionIds") - public String[] sessionIds; - - @Deprecated - @JsonField(name = "roomId") - public long roomId; - - @ParcelPropertyConverter(ObjectParcelConverter.class) - @JsonField(name = "inCall") - public Object inCall; - - @JsonField(name = "status") - public String status; - - @JsonField(name = "statusIcon") - public String statusIcon; - - @JsonField(name = "statusMessage") - public String statusMessage; - - public String source; - - public boolean selected; - - public Long getAttendeeId() { - return attendeeId; - } - - public ActorType getActorType() { - if (this.actorType == null) { - if (this.userId != null) { - return ActorType.USERS; - } else { - return ActorType.GUESTS; - } - } - return actorType; - } - - public String getActorId() { - if (this.actorId == null) { - return this.userId; - } - return actorId; - } - - public String getAttendeePin() { - return attendeePin; - } - - public ParticipantType getType() { - return this.type; - } - - public String getDisplayName() { - return this.displayName; - } - - public long getLastPing() { - return this.lastPing; - } - - @Deprecated - public String getSessionId() { - return this.sessionId; - } - - public String[] getSessionIds() { - return sessionIds; - } - - public Long getInCall() { - if (inCall instanceof Long) { - return (Long) this.inCall; - } - - if (this.inCall instanceof Boolean) { - if ((boolean) inCall) { - return 1L; - } else { - return 0L; - } - } - return 0L; - } - - public String getSource() { - return this.source; - } - - public boolean isSelected() { - return this.selected; - } - - public void setAttendeeId(Long attendeeId) { - this.attendeeId = attendeeId; - } - - public void setActorType(ActorType actorType) { - this.actorType = actorType; - } - - public void setActorId(String actorId) { - this.actorId = actorId; - } - - public void setAttendeePin(String attendeePin) { - this.attendeePin = attendeePin; - } - - public void setType(ParticipantType type) { - this.type = type; - } - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - public void setLastPing(long lastPing) { - this.lastPing = lastPing; - } - - @Deprecated - public void setSessionId(String sessionId) { - this.sessionId = sessionId; - } - - public void setInCall(Object inCall) { - this.inCall = inCall; - } - - public void setSource(String source) { - this.source = source; - } - - public void setSelected(boolean selected) { - this.selected = selected; - } - - public void setSessionIds(String[] sessionIds) { - this.sessionIds = sessionIds; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - Participant that = (Participant) o; - - if (lastPing != that.lastPing) { - return false; - } - if (roomId != that.roomId) { - return false; - } - if (selected != that.selected) { - return false; - } - if (!attendeeId.equals(that.attendeeId)) { - return false; - } - if (!actorType.equals(that.actorType)) { - return false; - } - if (!actorId.equals(that.actorId)) { - return false; - } - if (!attendeePin.equals(that.attendeePin)) { - return false; - } - if (!userId.equals(that.userId)) { - return false; - } - if (type != that.type) { - return false; - } - if (!name.equals(that.name)) { - return false; - } - if (displayName != null ? !displayName.equals(that.displayName) : that.displayName != null) { - return false; - } - if (!sessionId.equals(that.sessionId)) { - return false; - } - // Probably incorrect - comparing Object[] arrays with Arrays.equals - if (!Arrays.equals(sessionIds, that.sessionIds)) { - return false; - } - if (inCall != null ? !inCall.equals(that.inCall) : that.inCall != null) { - return false; - } - return source != null ? source.equals(that.source) : that.source == null; - } - - protected boolean canEqual(final Object other) { - return other instanceof Participant; - } - - @Override - public int hashCode() { - int result = (attendeeId != null ? attendeeId.hashCode() : 0); - result = 31 * result + (actorType != null ? actorType.hashCode() : 0); - result = 31 * result + (actorId != null ? actorId.hashCode() : 0); - result = 31 * result + (attendeePin != null ? attendeePin.hashCode() : 0); - result = 31 * result + (userId != null ? userId.hashCode() : 0); - result = 31 * result + (type != null ? type.hashCode() : 0); - result = 31 * result + (name != null ? name.hashCode() : 0); - result = 31 * result + (displayName != null ? displayName.hashCode() : 0); - result = 31 * result + (int) (lastPing ^ (lastPing >>> 32)); - result = 31 * result + (sessionId != null ? sessionId.hashCode() : 0); - result = 31 * result + Arrays.hashCode(sessionIds); - result = 31 * result + (int) (roomId ^ (roomId >>> 32)); - result = 31 * result + (inCall != null ? inCall.hashCode() : 0); - result = 31 * result + (source != null ? source.hashCode() : 0); - result = 31 * result + (selected ? 1 : 0); - return result; - } - - @Override - public String toString() { - return "Participant{" + - "attendeeId=" + attendeeId + - ", actorType='" + actorType + '\'' + - ", actorId='" + actorId + '\'' + - ", attendeePin='" + attendeePin + '\'' + - ", userId='" + userId + '\'' + - ", type=" + type + - ", name='" + name + '\'' + - ", displayName='" + displayName + '\'' + - ", lastPing=" + lastPing + - ", sessionId='" + sessionId + '\'' + - ", sessionIds=" + Arrays.toString(sessionIds) + - ", roomId=" + roomId + - ", inCall=" + inCall + - ", source='" + source + '\'' + - ", selected=" + selected + - '}'; - } - - public enum ActorType { - DUMMY, - EMAILS, - GROUPS, - GUESTS, - USERS, - CIRCLES, - } - - public enum ParticipantType { - DUMMY, - OWNER, - MODERATOR, - USER, - GUEST, - USER_FOLLOWING_LINK, - GUEST_MODERATOR - } - - public static class InCallFlags { - public static final int DISCONNECTED = 0; - public static final int IN_CALL = 1; - public static final int WITH_AUDIO = 2; - public static final int WITH_VIDEO = 4; - public static final int WITH_PHONE = 8; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt new file mode 100644 index 000000000..016980d32 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt @@ -0,0 +1,140 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.nextcloud.talk.models.json.participants + +import android.os.Parcel +import android.os.Parcelable +import android.util.Log +import com.bluelinelabs.logansquare.annotation.JsonField +import com.bluelinelabs.logansquare.annotation.JsonObject +import com.nextcloud.talk.models.json.converters.EnumActorTypeConverter +import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter +import com.nextcloud.talk.models.json.signaling.DataChannelMessage +import kotlinx.android.parcel.Parceler +import kotlinx.android.parcel.Parcelize +import kotlinx.android.parcel.WriteWith +import java.util.ArrayList + +@Parcelize +@JsonObject +data class Participant( + @JsonField(name = ["attendeeId"]) + var attendeeId: Long? = null, + + @JsonField(name = ["actorType"], typeConverter = EnumActorTypeConverter::class) + var actorType: ActorType? = null, + + @JsonField(name = ["actorId"]) + var actorId: String? = null, + + @JsonField(name = ["attendeePin"]) + var attendeePin: String? = null, + + @Deprecated("") + @JsonField(name = ["userId"]) + var userId: String? = null, + + @JsonField(name = ["type", "participantType"], typeConverter = EnumParticipantTypeConverter::class) + var type: ParticipantType? = null, + + @Deprecated("") + @JsonField(name = ["name"]) + var name: String? = null, + + @JsonField(name = ["displayName"]) + var displayName: String? = null, + + @JsonField(name = ["lastPing"]) + var lastPing: Long = 0, + + @Deprecated("") + @JsonField(name = ["sessionId"]) + var sessionId: String? = null, + + @JsonField(name = ["sessionIds"]) + var sessionIds: ArrayList = ArrayList(0), + + @Deprecated("") + @JsonField(name = ["roomId"]) + var roomId: Long = 0, + + @JsonField(name = ["inCall"]) + var inCall: Long = 0, + + @JsonField(name = ["status"]) + var status: String? = null, + + @JsonField(name = ["statusIcon"]) + var statusIcon: String? = null, + + @JsonField(name = ["statusMessage"]) + var statusMessage: String? = null, + + var source: String? = null, + + var selected: Boolean = false +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this( + null, null, null, null, null, null, null, null, + 0, null, ArrayList(0), 0, 0, null, + null, null + ) + + /** + * actorType is only guaranteed in APIv3+ so use calculatedActorId + * + * https://github.com/nextcloud/spreed/blob/stable21/lib/Controller/RoomController.php#L1145-L1148 + */ + val calculatedActorType: ActorType + get() = if (actorType == null) { + if (userId != null) { + ActorType.USERS + } else { + ActorType.GUESTS + } + } else actorType!! + + /** + * actorId is only guaranteed in APIv3+ so use calculatedActorId. + */ + val calculatedActorId: String? + get() = if (actorId == null) { + userId + } else actorId + + enum class ActorType { + DUMMY, EMAILS, GROUPS, GUESTS, USERS, CIRCLES + } + + enum class ParticipantType { + DUMMY, OWNER, MODERATOR, USER, GUEST, USER_FOLLOWING_LINK, GUEST_MODERATOR + } + + object InCallFlags { + const val DISCONNECTED = 0 + const val IN_CALL = 1 + const val WITH_AUDIO = 2 + const val WITH_VIDEO = 4 + const val WITH_PHONE = 8 + } +} diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java b/app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java index 84a3d76e7..0c1fba332 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java @@ -457,8 +457,8 @@ public class MagicWebSocketInstance extends WebSocketListener { public String getUserIdForSession(String session) { Participant participant = usersHashMap.get(session); if (participant != null) { - if (participant.getActorType() == USERS) { - return participant.getActorId(); + if (participant.getCalculatedActorType() == USERS) { + return participant.getCalculatedActorId(); } } From 0ec07410cb0e817930bb1535fa05d05b9b1c32de Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 16 May 2022 23:07:02 +0200 Subject: [PATCH 2/7] remove unused interface Signed-off-by: Andy Scherzinger --- .../talk/models/json/generic/IGenericOCS.kt | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/generic/IGenericOCS.kt diff --git a/app/src/main/java/com/nextcloud/talk/models/json/generic/IGenericOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/generic/IGenericOCS.kt deleted file mode 100644 index fc147be49..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/generic/IGenericOCS.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Andy Scherzinger - * Copyright (C) 2022 Andy Scherzinger - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.nextcloud.talk.models.json.generic - -interface IGenericOCS { - fun getGenericMeta(): GenericMeta? -} From 67f06c8d6e6ea97c75cafbf5f07d54f2fd7bd6ad Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 16 May 2022 23:10:30 +0200 Subject: [PATCH 3/7] Migrate ParticipantsOCS to kotlin Signed-off-by: Andy Scherzinger --- .../controllers/ConversationInfoController.kt | 2 +- .../json/participants/ParticipantsOCS.java | 77 ------------------- .../json/participants/ParticipantsOCS.kt | 39 ++++++++++ 3 files changed, 40 insertions(+), 78 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.kt diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt index fe8f19b01..3f5254150 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt @@ -471,7 +471,7 @@ class ConversationInfoController(args: Bundle) : @Suppress("Detekt.TooGenericExceptionCaught") override fun onNext(participantsOverall: ParticipantsOverall) { try { - handleParticipants(participantsOverall.ocs.data) + handleParticipants(participantsOverall.ocs.data!!) } catch (npe: NullPointerException) { // view binding can be null // since this is called asynchronously and UI might have been destroyed in the meantime diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.java b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.java deleted file mode 100644 index d82257fab..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.java +++ /dev/null @@ -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 . - */ -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 org.parceler.Parcel; - -import java.util.List; - -@Parcel -@JsonObject -public class ParticipantsOCS extends GenericOCS { - @JsonField(name = "data") - public List data; - - public List getData() { - return this.data; - } - - public void setData(List data) { - this.data = data; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ParticipantsOCS)) { - return false; - } - final ParticipantsOCS other = (ParticipantsOCS) 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 ParticipantsOCS; - } - - 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 "ParticipantsOCS(data=" + this.getData() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.kt new file mode 100644 index 000000000..35b020b56 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.kt @@ -0,0 +1,39 @@ +/* + * + * Nextcloud Talk application + * + * @author Mario Danic + * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.nextcloud.talk.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.generic.GenericMeta +import kotlinx.android.parcel.Parcelize + +@Parcelize +@JsonObject +data class ParticipantsOCS( + @JsonField(name = ["meta"]) + var meta: GenericMeta?, + @JsonField(name = ["data"]) + var data: List? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null, null) +} From b27096eece823a0c60707d07723561a79c5fcba5 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 16 May 2022 23:13:12 +0200 Subject: [PATCH 4/7] Migrate ParticipantsOCS to kotlin Signed-off-by: Andy Scherzinger --- .../controllers/ConversationInfoController.kt | 2 +- .../json/participants/ParticipantsOCS.kt | 30 ++++---- .../participants/ParticipantsOverall.java | 74 ------------------- .../json/participants/ParticipantsOverall.kt | 40 ++++++++++ 4 files changed, 58 insertions(+), 88 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.java create mode 100644 app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.kt diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt index 3f5254150..1a681b99a 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt @@ -471,7 +471,7 @@ class ConversationInfoController(args: Bundle) : @Suppress("Detekt.TooGenericExceptionCaught") override fun onNext(participantsOverall: ParticipantsOverall) { try { - handleParticipants(participantsOverall.ocs.data!!) + handleParticipants(participantsOverall.ocs!!.data!!) } catch (npe: NullPointerException) { // view binding can be null // since this is called asynchronously and UI might have been destroyed in the meantime diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.kt b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.kt index 35b020b56..36f37b6a8 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOCS.kt @@ -1,22 +1,26 @@ /* + * Nextcloud Talk application * - * Nextcloud Talk application + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2017 Mario Danic * - * @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 . * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * 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 diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.java b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.java deleted file mode 100644 index 438a6748b..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.java +++ /dev/null @@ -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 . - */ -package com.nextcloud.talk.models.json.participants; - -import com.bluelinelabs.logansquare.annotation.JsonField; -import com.bluelinelabs.logansquare.annotation.JsonObject; - -import org.parceler.Parcel; - -@Parcel -@JsonObject -public class ParticipantsOverall { - @JsonField(name = "ocs") - public ParticipantsOCS ocs; - - public ParticipantsOCS getOcs() { - return this.ocs; - } - - public void setOcs(ParticipantsOCS ocs) { - this.ocs = ocs; - } - - public boolean equals(final Object o) { - if (o == this) { - return true; - } - if (!(o instanceof ParticipantsOverall)) { - return false; - } - final ParticipantsOverall other = (ParticipantsOverall) 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 ParticipantsOverall; - } - - 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 "ParticipantsOverall(ocs=" + this.getOcs() + ")"; - } -} diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.kt b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.kt new file mode 100644 index 000000000..ed3d0b768 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/ParticipantsOverall.kt @@ -0,0 +1,40 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Andy Scherzinger + * Copyright (C) 2022 Andy Scherzinger + * Copyright (C) 2017 Mario Danic + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * 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 + +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 ParticipantsOverall( + @JsonField(name = ["ocs"]) + var ocs: ParticipantsOCS? = null +) : Parcelable { + // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' + constructor() : this(null) +} From 981c885bfc3d91ebcd815387568537d99cd38152 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 17 May 2022 10:02:41 +0200 Subject: [PATCH 5/7] fix MagicFirebaseMessagingService Signed-off-by: Andy Scherzinger --- .../talk/services/firebase/MagicFirebaseMessagingService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt b/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt index 24d1740a3..87a41d545 100644 --- a/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt +++ b/app/src/gplay/java/com/nextcloud/talk/services/firebase/MagicFirebaseMessagingService.kt @@ -294,7 +294,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() { } override fun onNext(participantsOverall: ParticipantsOverall) { - val participantList: List = participantsOverall.ocs.data + val participantList: List = participantsOverall.ocs!!.data!! hasParticipantsInCall = participantList.isNotEmpty() if (hasParticipantsInCall) { for (participant in participantList) { From 98d4de7c322841a77ac87d87a3db1b6bbfb983cb Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Tue, 17 May 2022 10:15:08 +0200 Subject: [PATCH 6/7] format code Signed-off-by: Andy Scherzinger --- .../nextcloud/talk/controllers/ConversationInfoController.kt | 4 +++- .../nextcloud/talk/models/json/participants/Participant.kt | 5 ----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt index 1a681b99a..c04d17140 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.kt @@ -413,7 +413,9 @@ class ConversationInfoController(args: Bundle) : userItem.isOnline = !participant.sessionIds!!.isEmpty() } - if (participant.calculatedActorType == USERS && participant.calculatedActorId == conversationUser!!.userId) { + if (participant.calculatedActorType == USERS && + participant.calculatedActorId == conversationUser!!.userId + ) { ownUserItem = userItem ownUserItem.model.sessionId = "-1" ownUserItem.isOnline = true diff --git a/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt index 016980d32..d9500d8f5 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt +++ b/app/src/main/java/com/nextcloud/talk/models/json/participants/Participant.kt @@ -21,17 +21,12 @@ */ package com.nextcloud.talk.models.json.participants -import android.os.Parcel import android.os.Parcelable -import android.util.Log import com.bluelinelabs.logansquare.annotation.JsonField import com.bluelinelabs.logansquare.annotation.JsonObject import com.nextcloud.talk.models.json.converters.EnumActorTypeConverter import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter -import com.nextcloud.talk.models.json.signaling.DataChannelMessage -import kotlinx.android.parcel.Parceler import kotlinx.android.parcel.Parcelize -import kotlinx.android.parcel.WriteWith import java.util.ArrayList @Parcelize From 7c94b03c1c008b332e8d1655ade9bdcb8a56b42d Mon Sep 17 00:00:00 2001 From: drone Date: Tue, 17 May 2022 09:08:08 +0000 Subject: [PATCH 7/7] Drone: update FindBugs results to reflect reduced error/warning count [skip ci] Signed-off-by: drone --- scripts/analysis/findbugs-results.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/analysis/findbugs-results.txt b/scripts/analysis/findbugs-results.txt index e24b797f8..ef491079a 100644 --- a/scripts/analysis/findbugs-results.txt +++ b/scripts/analysis/findbugs-results.txt @@ -1 +1 @@ -361 \ No newline at end of file +337 \ No newline at end of file