mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
Merge pull request #1849 from nextcloud/bugfix/noid/migratePushToKotlin
Migrate Push to Kotlin
This commit is contained in:
commit
34b82f8da2
@ -178,7 +178,7 @@ class MagicFirebaseMessagingService : FirebaseMessagingService() {
|
|||||||
} 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,
|
||||||
|
@ -71,6 +71,7 @@ import com.nextcloud.talk.utils.preferences.AppPreferences;
|
|||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.parceler.Parcels;
|
import org.parceler.Parcels;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -255,7 +256,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
adapter = new FlexibleAdapter<>(contactItems, getActivity(), false);
|
adapter = new FlexibleAdapter<>(contactItems, getActivity(), false);
|
||||||
|
|
||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
fetchData(true);
|
fetchData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,7 +460,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchData(boolean startFromScratch) {
|
private void fetchData() {
|
||||||
dispose(null);
|
dispose(null);
|
||||||
|
|
||||||
alreadyFetching = true;
|
alreadyFetching = true;
|
||||||
@ -506,12 +507,12 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
.retry(3)
|
.retry(3)
|
||||||
.subscribe(new Observer<ResponseBody>() {
|
.subscribe(new Observer<ResponseBody>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(@NotNull Disposable d) {
|
||||||
contactsQueryDisposable = d;
|
contactsQueryDisposable = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(ResponseBody responseBody) {
|
public void onNext(@NotNull ResponseBody responseBody) {
|
||||||
if (responseBody != null) {
|
if (responseBody != null) {
|
||||||
Participant participant;
|
Participant participant;
|
||||||
|
|
||||||
@ -636,7 +637,8 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (o1 instanceof ContactItem && o2 instanceof ContactItem) {
|
if (o1 instanceof ContactItem && o2 instanceof ContactItem) {
|
||||||
if ("groups".equals(((ContactItem) o1).getModel().getSource()) && "groups".equals(((ContactItem) o2).getModel().getSource())) {
|
if ("groups".equals(((ContactItem) o1).getModel().getSource()) &&
|
||||||
|
"groups".equals(((ContactItem) o2).getModel().getSource())) {
|
||||||
return firstName.compareToIgnoreCase(secondName);
|
return firstName.compareToIgnoreCase(secondName);
|
||||||
} else if ("groups".equals(((ContactItem) o1).getModel().getSource())) {
|
} else if ("groups".equals(((ContactItem) o1).getModel().getSource())) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -661,7 +663,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(@NotNull Throwable e) {
|
||||||
if (swipeRefreshLayout != null) {
|
if (swipeRefreshLayout != null) {
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
}
|
}
|
||||||
@ -679,7 +681,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
disengageProgressBar();
|
disengageProgressBar();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareViews() {
|
private void prepareViews() {
|
||||||
@ -688,7 +689,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
recyclerView.setHasFixedSize(true);
|
recyclerView.setHasFixedSize(true);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
swipeRefreshLayout.setOnRefreshListener(() -> fetchData(true));
|
swipeRefreshLayout.setOnRefreshListener(this::fetchData);
|
||||||
swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
|
swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
|
||||||
swipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.refresh_spinner_background);
|
swipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.refresh_spinner_background);
|
||||||
|
|
||||||
@ -759,7 +760,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
if (!newText.equals("") && adapter.hasNewFilter(newText)) {
|
if (!newText.equals("") && adapter.hasNewFilter(newText)) {
|
||||||
adapter.setFilter(newText);
|
adapter.setFilter(newText);
|
||||||
fetchData(true);
|
fetchData();
|
||||||
} else if (newText.equals("")) {
|
} else if (newText.equals("")) {
|
||||||
adapter.setFilter("");
|
adapter.setFilter("");
|
||||||
adapter.updateDataSet(contactItems);
|
adapter.updateDataSet(contactItems);
|
||||||
|
@ -374,7 +374,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
@io.reactivex.annotations.NonNull RoomOverall roomOverall
|
@io.reactivex.annotations.NonNull RoomOverall roomOverall
|
||||||
) {
|
) {
|
||||||
conversation = roomOverall.getOcs().getData();
|
conversation = roomOverall.getOcs().getData();
|
||||||
initiateConversation(false);
|
initiateConversation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -388,7 +388,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
initiateConversation(false);
|
initiateConversation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,7 +594,6 @@ public class OperationsMenuController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void inviteUsersToAConversation() {
|
private void inviteUsersToAConversation() {
|
||||||
RetrofitBucket retrofitBucket;
|
|
||||||
final ArrayList<String> localInvitedUsers = invitedUsers;
|
final ArrayList<String> localInvitedUsers = invitedUsers;
|
||||||
final ArrayList<String> localInvitedGroups = invitedGroups;
|
final ArrayList<String> localInvitedGroups = invitedGroups;
|
||||||
if (localInvitedGroups.size() > 0) {
|
if (localInvitedGroups.size() > 0) {
|
||||||
@ -608,7 +607,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
addGroupsToConversation(localInvitedUsers, localInvitedGroups, apiVersion);
|
addGroupsToConversation(localInvitedUsers, localInvitedGroups, apiVersion);
|
||||||
addUsersToConversation(localInvitedUsers, localInvitedGroups, apiVersion);
|
addUsersToConversation(localInvitedUsers, localInvitedGroups, apiVersion);
|
||||||
} else {
|
} else {
|
||||||
initiateConversation(true);
|
initiateConversation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -653,7 +652,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (localInvitedGroups.size() == 0 && localInvitedUsers.size() == 0) {
|
if (localInvitedGroups.size() == 0 && localInvitedUsers.size() == 0) {
|
||||||
initiateConversation(true);
|
initiateConversation();
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
@ -707,7 +706,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (localInvitedGroups.size() == 0 && localInvitedUsers.size() == 0) {
|
if (localInvitedGroups.size() == 0 && localInvitedUsers.size() == 0) {
|
||||||
initiateConversation(true);
|
initiateConversation();
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
@ -717,7 +716,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initiateConversation(boolean dismissView) {
|
private void initiateConversation() {
|
||||||
eventBus.post(new ConversationsListFetchDataEvent());
|
eventBus.post(new ConversationsListFetchDataEvent());
|
||||||
|
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
@ -787,7 +786,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
showResultImage(true, false);
|
showResultImage(true, false);
|
||||||
} else {
|
} else {
|
||||||
conversation = roomOverall.getOcs().getData();
|
conversation = roomOverall.getOcs().getData();
|
||||||
initiateConversation(true);
|
initiateConversation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,9 @@ import com.nextcloud.talk.utils.ApiUtils;
|
|||||||
import com.nextcloud.talk.utils.database.arbitrarystorage.ArbitraryStorageUtils;
|
import com.nextcloud.talk.utils.database.arbitrarystorage.ArbitraryStorageUtils;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.nextcloud.talk.webrtc.WebSocketConnectionHelper;
|
import com.nextcloud.talk.webrtc.WebSocketConnectionHelper;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import io.reactivex.CompletableObserver;
|
import io.reactivex.CompletableObserver;
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
@ -100,16 +103,17 @@ public class AccountRemovalWorker extends Worker {
|
|||||||
.getBaseUrl()))
|
.getBaseUrl()))
|
||||||
.blockingSubscribe(new Observer<GenericOverall>() {
|
.blockingSubscribe(new Observer<GenericOverall>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(Disposable d) {
|
public void onSubscribe(@NotNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(GenericOverall genericOverall) {
|
public void onNext(@NotNull GenericOverall genericOverall) {
|
||||||
if (genericOverall.getOcs().getMeta().getStatusCode() == 200
|
if (genericOverall.getOcs().getMeta().getStatusCode() == 200
|
||||||
|| genericOverall.getOcs().getMeta().getStatusCode() == 202) {
|
|| genericOverall.getOcs().getMeta().getStatusCode() == 202) {
|
||||||
HashMap<String, String> queryMap = new HashMap<>();
|
HashMap<String, String> queryMap = new HashMap<>();
|
||||||
queryMap.put("deviceIdentifier", finalPushConfigurationState.deviceIdentifier);
|
queryMap.put("deviceIdentifier",
|
||||||
|
finalPushConfigurationState.getDeviceIdentifier());
|
||||||
queryMap.put("userPublicKey", finalPushConfigurationState.getUserPublicKey());
|
queryMap.put("userPublicKey", finalPushConfigurationState.getUserPublicKey());
|
||||||
queryMap.put("deviceIdentifierSignature",
|
queryMap.put("deviceIdentifierSignature",
|
||||||
finalPushConfigurationState.getDeviceIdentifierSignature());
|
finalPushConfigurationState.getDeviceIdentifierSignature());
|
||||||
@ -118,7 +122,7 @@ public class AccountRemovalWorker extends Worker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(@NotNull Throwable e) {
|
||||||
Log.e(TAG, "error while trying to unregister Device For Notifications", e);
|
Log.e(TAG, "error while trying to unregister Device For Notifications", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,11 +513,11 @@ public class NotificationWorker extends Worker {
|
|||||||
DecryptedPushMessage.class);
|
DecryptedPushMessage.class);
|
||||||
|
|
||||||
decryptedPushMessage.setTimestamp(System.currentTimeMillis());
|
decryptedPushMessage.setTimestamp(System.currentTimeMillis());
|
||||||
if (decryptedPushMessage.isDelete()) {
|
if (decryptedPushMessage.getDelete()) {
|
||||||
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), decryptedPushMessage.getNotificationId());
|
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), decryptedPushMessage.getNotificationId());
|
||||||
} else if (decryptedPushMessage.isDeleteAll()) {
|
} else if (decryptedPushMessage.getDeleteAll()) {
|
||||||
NotificationUtils.INSTANCE.cancelAllNotificationsForAccount(context, signatureVerification.getUserEntity());
|
NotificationUtils.INSTANCE.cancelAllNotificationsForAccount(context, signatureVerification.getUserEntity());
|
||||||
} else if (decryptedPushMessage.isDeleteMultiple()) {
|
} else if (decryptedPushMessage.getDeleteMultiple()) {
|
||||||
for (long notificationId : decryptedPushMessage.getNotificationIds()) {
|
for (long notificationId : decryptedPushMessage.getNotificationIds()) {
|
||||||
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), notificationId);
|
NotificationUtils.INSTANCE.cancelExistingNotificationWithId(context, signatureVerification.getUserEntity(), notificationId);
|
||||||
}
|
}
|
||||||
|
@ -1,249 +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.push;
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonIgnore;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
||||||
|
|
||||||
import org.parceler.Parcel;
|
|
||||||
|
|
||||||
@Parcel
|
|
||||||
@JsonObject
|
|
||||||
public class DecryptedPushMessage {
|
|
||||||
@JsonField(name = "app")
|
|
||||||
public String app;
|
|
||||||
|
|
||||||
@JsonField(name = "type")
|
|
||||||
public String type;
|
|
||||||
|
|
||||||
@JsonField(name = "subject")
|
|
||||||
public String subject;
|
|
||||||
|
|
||||||
@JsonField(name = "id")
|
|
||||||
public String id;
|
|
||||||
|
|
||||||
@JsonField(name = "nid")
|
|
||||||
public long notificationId;
|
|
||||||
|
|
||||||
@JsonField(name = "nids")
|
|
||||||
public long[] notificationIds;
|
|
||||||
|
|
||||||
@JsonField(name = "delete")
|
|
||||||
public boolean delete;
|
|
||||||
|
|
||||||
@JsonField(name = "delete-all")
|
|
||||||
public boolean deleteAll;
|
|
||||||
|
|
||||||
@JsonField(name = "delete-multiple")
|
|
||||||
public boolean deleteMultiple;
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public NotificationUser notificationUser;
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public String text;
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public long timestamp;
|
|
||||||
|
|
||||||
public String getApp() {
|
|
||||||
return this.app;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return this.type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSubject() {
|
|
||||||
return this.subject;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getNotificationId() {
|
|
||||||
return this.notificationId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDelete() {
|
|
||||||
return this.delete;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDeleteAll() {
|
|
||||||
return this.deleteAll;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NotificationUser getNotificationUser() {
|
|
||||||
return this.notificationUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getText() {
|
|
||||||
return this.text;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getTimestamp() {
|
|
||||||
return this.timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long[] getNotificationIds() {
|
|
||||||
return notificationIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDeleteMultiple() {
|
|
||||||
return deleteMultiple;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApp(String app) {
|
|
||||||
this.app = app;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSubject(String subject) {
|
|
||||||
this.subject = subject;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNotificationId(long notificationId) {
|
|
||||||
this.notificationId = notificationId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDelete(boolean delete) {
|
|
||||||
this.delete = delete;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeleteAll(boolean deleteAll) {
|
|
||||||
this.deleteAll = deleteAll;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNotificationUser(NotificationUser notificationUser) {
|
|
||||||
this.notificationUser = notificationUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setText(String text) {
|
|
||||||
this.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTimestamp(long timestamp) {
|
|
||||||
this.timestamp = timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNotificationIds(long[] notificationIds) {
|
|
||||||
this.notificationIds = notificationIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeleteMultiple(boolean deleteMultiple) {
|
|
||||||
this.deleteMultiple = deleteMultiple;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(final Object o) {
|
|
||||||
if (o == this) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!(o instanceof DecryptedPushMessage)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final DecryptedPushMessage other = (DecryptedPushMessage) o;
|
|
||||||
if (!other.canEqual((Object) this)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$app = this.getApp();
|
|
||||||
final Object other$app = other.getApp();
|
|
||||||
if (this$app == null ? other$app != null : !this$app.equals(other$app)) {
|
|
||||||
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$subject = this.getSubject();
|
|
||||||
final Object other$subject = other.getSubject();
|
|
||||||
if (this$subject == null ? other$subject != null : !this$subject.equals(other$subject)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$id = this.getId();
|
|
||||||
final Object other$id = other.getId();
|
|
||||||
if (this$id == null ? other$id != null : !this$id.equals(other$id)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.getNotificationId() != other.getNotificationId()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.isDelete() != other.isDelete()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.isDeleteAll() != other.isDeleteAll()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$notificationUser = this.getNotificationUser();
|
|
||||||
final Object other$notificationUser = other.getNotificationUser();
|
|
||||||
if (this$notificationUser == null ? other$notificationUser != null : !this$notificationUser.equals(other$notificationUser)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$text = this.getText();
|
|
||||||
final Object other$text = other.getText();
|
|
||||||
if (this$text == null ? other$text != null : !this$text.equals(other$text)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.getTimestamp() == other.getTimestamp();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean canEqual(final Object other) {
|
|
||||||
return other instanceof DecryptedPushMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int hashCode() {
|
|
||||||
final int PRIME = 59;
|
|
||||||
int result = 1;
|
|
||||||
final Object $app = this.getApp();
|
|
||||||
result = result * PRIME + ($app == null ? 43 : $app.hashCode());
|
|
||||||
final Object $type = this.getType();
|
|
||||||
result = result * PRIME + ($type == null ? 43 : $type.hashCode());
|
|
||||||
final Object $subject = this.getSubject();
|
|
||||||
result = result * PRIME + ($subject == null ? 43 : $subject.hashCode());
|
|
||||||
final Object $id = this.getId();
|
|
||||||
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
|
|
||||||
final long $notificationId = this.getNotificationId();
|
|
||||||
result = result * PRIME + (int) ($notificationId >>> 32 ^ $notificationId);
|
|
||||||
result = result * PRIME + (this.isDelete() ? 79 : 97);
|
|
||||||
result = result * PRIME + (this.isDeleteAll() ? 79 : 97);
|
|
||||||
final Object $notificationUser = this.getNotificationUser();
|
|
||||||
result = result * PRIME + ($notificationUser == null ? 43 : $notificationUser.hashCode());
|
|
||||||
final Object $text = this.getText();
|
|
||||||
result = result * PRIME + ($text == null ? 43 : $text.hashCode());
|
|
||||||
final long $timestamp = this.getTimestamp();
|
|
||||||
result = result * PRIME + (int) ($timestamp >>> 32 ^ $timestamp);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return "DecryptedPushMessage(app=" + this.getApp() + ", type=" + this.getType() + ", subject=" + this.getSubject() + ", id=" + this.getId() + ", notificationId=" + this.getNotificationId() + ", delete=" + this.isDelete() + ", deleteAll=" + this.isDeleteAll() + ", notificationUser=" + this.getNotificationUser() + ", text=" + this.getText() + ", timestamp=" + this.getTimestamp() + ")";
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* 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.push
|
||||||
|
|
||||||
|
import android.os.Parcelable
|
||||||
|
import com.bluelinelabs.logansquare.annotation.JsonField
|
||||||
|
import com.bluelinelabs.logansquare.annotation.JsonIgnore
|
||||||
|
import com.bluelinelabs.logansquare.annotation.JsonObject
|
||||||
|
import kotlinx.android.parcel.Parcelize
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
@JsonObject
|
||||||
|
data class DecryptedPushMessage(
|
||||||
|
@JsonField(name = ["app"])
|
||||||
|
var app: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["type"])
|
||||||
|
var type: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["subject"])
|
||||||
|
var subject: String,
|
||||||
|
|
||||||
|
@JsonField(name = ["id"])
|
||||||
|
var id: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["nid"])
|
||||||
|
var notificationId: Long?,
|
||||||
|
|
||||||
|
@JsonField(name = ["nids"])
|
||||||
|
var notificationIds: LongArray?,
|
||||||
|
|
||||||
|
@JsonField(name = ["delete"])
|
||||||
|
var delete: Boolean,
|
||||||
|
|
||||||
|
@JsonField(name = ["delete-all"])
|
||||||
|
var deleteAll: Boolean,
|
||||||
|
|
||||||
|
@JsonField(name = ["delete-multiple"])
|
||||||
|
var deleteMultiple: Boolean,
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
var notificationUser: NotificationUser?,
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
var text: String?,
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
var timestamp: Long
|
||||||
|
) : Parcelable {
|
||||||
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
|
constructor() : this(null, null, "", null, 0, null, false, false, false, null, null, 0)
|
||||||
|
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
if (this === other) return true
|
||||||
|
if (javaClass != other?.javaClass) return false
|
||||||
|
|
||||||
|
other as DecryptedPushMessage
|
||||||
|
|
||||||
|
if (app != other.app) return false
|
||||||
|
if (type != other.type) return false
|
||||||
|
if (subject != other.subject) return false
|
||||||
|
if (id != other.id) return false
|
||||||
|
if (notificationId != other.notificationId) return false
|
||||||
|
if (notificationIds != null) {
|
||||||
|
if (other.notificationIds == null) return false
|
||||||
|
if (!notificationIds.contentEquals(other.notificationIds)) return false
|
||||||
|
} else if (other.notificationIds != null) return false
|
||||||
|
if (delete != other.delete) return false
|
||||||
|
if (deleteAll != other.deleteAll) return false
|
||||||
|
if (deleteMultiple != other.deleteMultiple) return false
|
||||||
|
if (notificationUser != other.notificationUser) return false
|
||||||
|
if (text != other.text) return false
|
||||||
|
if (timestamp != other.timestamp) return false
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hashCode(): Int {
|
||||||
|
var result = app?.hashCode() ?: 0
|
||||||
|
result = 31 * result + (type?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (subject?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (id?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (notificationId?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (notificationIds?.contentHashCode() ?: 0)
|
||||||
|
result = 31 * result + (delete?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (deleteAll?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (deleteMultiple?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (notificationUser?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (text?.hashCode() ?: 0)
|
||||||
|
result = 31 * result + (timestamp?.hashCode() ?: 0)
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
@ -1,110 +0,0 @@
|
|||||||
/*
|
|
||||||
* Nextcloud Talk application
|
|
||||||
*
|
|
||||||
* @author Mario Danic
|
|
||||||
* Copyright (C) 2017-2019 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.push;
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
||||||
|
|
||||||
import org.parceler.Parcel;
|
|
||||||
|
|
||||||
@Parcel
|
|
||||||
@JsonObject
|
|
||||||
public class NotificationUser {
|
|
||||||
@JsonField(name = "type")
|
|
||||||
String type;
|
|
||||||
|
|
||||||
@JsonField(name = "id")
|
|
||||||
String id;
|
|
||||||
|
|
||||||
@JsonField(name = "name")
|
|
||||||
String name;
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return this.type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getId() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(String id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(final Object o) {
|
|
||||||
if (o == this) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!(o instanceof NotificationUser)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final NotificationUser other = (NotificationUser) 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$id = this.getId();
|
|
||||||
final Object other$id = other.getId();
|
|
||||||
if (this$id == null ? other$id != null : !this$id.equals(other$id)) {
|
|
||||||
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 NotificationUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 $id = this.getId();
|
|
||||||
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
|
|
||||||
final Object $name = this.getName();
|
|
||||||
result = result * PRIME + ($name == null ? 43 : $name.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return "NotificationUser(type=" + this.getType() + ", id=" + this.getId() + ", name=" + this.getName() + ")";
|
|
||||||
}
|
|
||||||
}
|
|
@ -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.push
|
||||||
|
|
||||||
|
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 NotificationUser(
|
||||||
|
@JsonField(name = ["type"])
|
||||||
|
var type: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["id"])
|
||||||
|
var id: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["name"])
|
||||||
|
var name: String?
|
||||||
|
) : Parcelable {
|
||||||
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
|
constructor() : this(null, null, null)
|
||||||
|
}
|
@ -1,143 +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.push;
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
||||||
|
|
||||||
import org.parceler.Parcel;
|
|
||||||
|
|
||||||
@Parcel
|
|
||||||
@JsonObject
|
|
||||||
public class PushConfigurationState {
|
|
||||||
@JsonField(name = "pushToken")
|
|
||||||
public String pushToken;
|
|
||||||
|
|
||||||
@JsonField(name = "deviceIdentifier")
|
|
||||||
public String deviceIdentifier;
|
|
||||||
|
|
||||||
@JsonField(name = "deviceIdentifierSignature")
|
|
||||||
public String deviceIdentifierSignature;
|
|
||||||
|
|
||||||
@JsonField(name = "userPublicKey")
|
|
||||||
public String userPublicKey;
|
|
||||||
|
|
||||||
@JsonField(name = "usesRegularPass")
|
|
||||||
public boolean usesRegularPass;
|
|
||||||
|
|
||||||
public String getPushToken() {
|
|
||||||
return this.pushToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDeviceIdentifier() {
|
|
||||||
return this.deviceIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDeviceIdentifierSignature() {
|
|
||||||
return this.deviceIdentifierSignature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserPublicKey() {
|
|
||||||
return this.userPublicKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUsesRegularPass() {
|
|
||||||
return this.usesRegularPass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPushToken(String pushToken) {
|
|
||||||
this.pushToken = pushToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeviceIdentifier(String deviceIdentifier) {
|
|
||||||
this.deviceIdentifier = deviceIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeviceIdentifierSignature(String deviceIdentifierSignature) {
|
|
||||||
this.deviceIdentifierSignature = deviceIdentifierSignature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserPublicKey(String userPublicKey) {
|
|
||||||
this.userPublicKey = userPublicKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUsesRegularPass(boolean usesRegularPass) {
|
|
||||||
this.usesRegularPass = usesRegularPass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(final Object o) {
|
|
||||||
if (o == this) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!(o instanceof PushConfigurationState)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final PushConfigurationState other = (PushConfigurationState) o;
|
|
||||||
if (!other.canEqual((Object) this)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$pushToken = this.getPushToken();
|
|
||||||
final Object other$pushToken = other.getPushToken();
|
|
||||||
if (this$pushToken == null ? other$pushToken != null : !this$pushToken.equals(other$pushToken)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$deviceIdentifier = this.getDeviceIdentifier();
|
|
||||||
final Object other$deviceIdentifier = other.getDeviceIdentifier();
|
|
||||||
if (this$deviceIdentifier == null ? other$deviceIdentifier != null : !this$deviceIdentifier.equals(other$deviceIdentifier)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$deviceIdentifierSignature = this.getDeviceIdentifierSignature();
|
|
||||||
final Object other$deviceIdentifierSignature = other.getDeviceIdentifierSignature();
|
|
||||||
if (this$deviceIdentifierSignature == null ? other$deviceIdentifierSignature != null : !this$deviceIdentifierSignature.equals(other$deviceIdentifierSignature)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$userPublicKey = this.getUserPublicKey();
|
|
||||||
final Object other$userPublicKey = other.getUserPublicKey();
|
|
||||||
if (this$userPublicKey == null ? other$userPublicKey != null : !this$userPublicKey.equals(other$userPublicKey)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.isUsesRegularPass() == other.isUsesRegularPass();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean canEqual(final Object other) {
|
|
||||||
return other instanceof PushConfigurationState;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int hashCode() {
|
|
||||||
final int PRIME = 59;
|
|
||||||
int result = 1;
|
|
||||||
final Object $pushToken = this.getPushToken();
|
|
||||||
result = result * PRIME + ($pushToken == null ? 43 : $pushToken.hashCode());
|
|
||||||
final Object $deviceIdentifier = this.getDeviceIdentifier();
|
|
||||||
result = result * PRIME + ($deviceIdentifier == null ? 43 : $deviceIdentifier.hashCode());
|
|
||||||
final Object $deviceIdentifierSignature = this.getDeviceIdentifierSignature();
|
|
||||||
result = result * PRIME + ($deviceIdentifierSignature == null ? 43 : $deviceIdentifierSignature.hashCode());
|
|
||||||
final Object $userPublicKey = this.getUserPublicKey();
|
|
||||||
result = result * PRIME + ($userPublicKey == null ? 43 : $userPublicKey.hashCode());
|
|
||||||
result = result * PRIME + (this.isUsesRegularPass() ? 79 : 97);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return "PushConfigurationState(pushToken=" + this.getPushToken() + ", deviceIdentifier=" + this.getDeviceIdentifier() + ", deviceIdentifierSignature=" + this.getDeviceIdentifierSignature() + ", userPublicKey=" + this.getUserPublicKey() + ", usesRegularPass=" + this.isUsesRegularPass() + ")";
|
|
||||||
}
|
|
||||||
}
|
|
@ -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.push
|
||||||
|
|
||||||
|
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 PushConfigurationState(
|
||||||
|
@JsonField(name = ["pushToken"])
|
||||||
|
var pushToken: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["deviceIdentifier"])
|
||||||
|
var deviceIdentifier: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["deviceIdentifierSignature"])
|
||||||
|
var deviceIdentifierSignature: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["userPublicKey"])
|
||||||
|
var userPublicKey: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["usesRegularPass"])
|
||||||
|
var usesRegularPass: Boolean?
|
||||||
|
) : Parcelable {
|
||||||
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
|
constructor() : this(null, null, null, null, false)
|
||||||
|
}
|
@ -1,112 +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.push;
|
|
||||||
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
||||||
|
|
||||||
import org.parceler.Parcel;
|
|
||||||
|
|
||||||
@Parcel
|
|
||||||
@JsonObject
|
|
||||||
public class PushRegistration {
|
|
||||||
@JsonField(name = "publicKey")
|
|
||||||
String publicKey;
|
|
||||||
|
|
||||||
@JsonField(name = "deviceIdentifier")
|
|
||||||
String deviceIdentifier;
|
|
||||||
|
|
||||||
@JsonField(name = "signature")
|
|
||||||
String signature;
|
|
||||||
|
|
||||||
public String getPublicKey() {
|
|
||||||
return this.publicKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDeviceIdentifier() {
|
|
||||||
return this.deviceIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSignature() {
|
|
||||||
return this.signature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPublicKey(String publicKey) {
|
|
||||||
this.publicKey = publicKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeviceIdentifier(String deviceIdentifier) {
|
|
||||||
this.deviceIdentifier = deviceIdentifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSignature(String signature) {
|
|
||||||
this.signature = signature;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(final Object o) {
|
|
||||||
if (o == this) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!(o instanceof PushRegistration)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final PushRegistration other = (PushRegistration) o;
|
|
||||||
if (!other.canEqual((Object) this)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$publicKey = this.getPublicKey();
|
|
||||||
final Object other$publicKey = other.getPublicKey();
|
|
||||||
if (this$publicKey == null ? other$publicKey != null : !this$publicKey.equals(other$publicKey)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$deviceIdentifier = this.getDeviceIdentifier();
|
|
||||||
final Object other$deviceIdentifier = other.getDeviceIdentifier();
|
|
||||||
if (this$deviceIdentifier == null ? other$deviceIdentifier != null : !this$deviceIdentifier.equals(other$deviceIdentifier)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final Object this$signature = this.getSignature();
|
|
||||||
final Object other$signature = other.getSignature();
|
|
||||||
|
|
||||||
return this$signature == null ? other$signature == null : this$signature.equals(other$signature);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean canEqual(final Object other) {
|
|
||||||
return other instanceof PushRegistration;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int hashCode() {
|
|
||||||
final int PRIME = 59;
|
|
||||||
int result = 1;
|
|
||||||
final Object $publicKey = this.getPublicKey();
|
|
||||||
result = result * PRIME + ($publicKey == null ? 43 : $publicKey.hashCode());
|
|
||||||
final Object $deviceIdentifier = this.getDeviceIdentifier();
|
|
||||||
result = result * PRIME + ($deviceIdentifier == null ? 43 : $deviceIdentifier.hashCode());
|
|
||||||
final Object $signature = this.getSignature();
|
|
||||||
result = result * PRIME + ($signature == null ? 43 : $signature.hashCode());
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return "PushRegistration(publicKey=" + this.getPublicKey() + ", deviceIdentifier=" + this.getDeviceIdentifier() + ", signature=" + this.getSignature() + ")";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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.push
|
||||||
|
|
||||||
|
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 PushRegistration(
|
||||||
|
@JsonField(name = ["publicKey"])
|
||||||
|
var publicKey: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["deviceIdentifier"])
|
||||||
|
var deviceIdentifier: String?,
|
||||||
|
|
||||||
|
@JsonField(name = ["signature"])
|
||||||
|
var signature: String?
|
||||||
|
) : Parcelable {
|
||||||
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
|
constructor() : this(null, null, null)
|
||||||
|
}
|
@ -1,75 +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.push;
|
|
||||||
|
|
||||||
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 PushRegistrationOCS extends GenericOCS {
|
|
||||||
@JsonField(name = "data")
|
|
||||||
PushRegistration data;
|
|
||||||
|
|
||||||
public PushRegistration getData() {
|
|
||||||
return this.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setData(PushRegistration data) {
|
|
||||||
this.data = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(final Object o) {
|
|
||||||
if (o == this) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!(o instanceof PushRegistrationOCS)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final PushRegistrationOCS other = (PushRegistrationOCS) 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 PushRegistrationOCS;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 "PushRegistrationOCS(data=" + this.getData() + ")";
|
|
||||||
}
|
|
||||||
}
|
|
@ -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.push
|
||||||
|
|
||||||
|
import android.os.Parcelable
|
||||||
|
import com.bluelinelabs.logansquare.annotation.JsonField
|
||||||
|
import com.bluelinelabs.logansquare.annotation.JsonObject
|
||||||
|
import com.nextcloud.talk.models.json.generic.GenericOCS
|
||||||
|
import kotlinx.android.parcel.Parcelize
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
@JsonObject
|
||||||
|
data class PushRegistrationOCS(
|
||||||
|
@JsonField(name = ["data"])
|
||||||
|
var data: PushRegistration?
|
||||||
|
) : GenericOCS(), Parcelable {
|
||||||
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
|
constructor() : this(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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.nextcloud.talk.models.json.push;
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
||||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
||||||
|
|
||||||
import org.parceler.Parcel;
|
|
||||||
|
|
||||||
@Parcel
|
|
||||||
@JsonObject
|
|
||||||
public class PushRegistrationOverall {
|
|
||||||
@JsonField(name = "ocs")
|
|
||||||
PushRegistrationOCS ocs;
|
|
||||||
|
|
||||||
public PushRegistrationOCS getOcs() {
|
|
||||||
return this.ocs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOcs(PushRegistrationOCS ocs) {
|
|
||||||
this.ocs = ocs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(final Object o) {
|
|
||||||
if (o == this) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!(o instanceof PushRegistrationOverall)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final PushRegistrationOverall other = (PushRegistrationOverall) 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 PushRegistrationOverall;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 "PushRegistrationOverall(ocs=" + this.getOcs() + ")";
|
|
||||||
}
|
|
||||||
}
|
|
@ -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.push
|
||||||
|
|
||||||
|
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 PushRegistrationOverall(
|
||||||
|
@JsonField(name = ["ocs"])
|
||||||
|
var ocs: PushRegistrationOCS?
|
||||||
|
) : Parcelable {
|
||||||
|
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||||
|
constructor() : this(null)
|
||||||
|
}
|
@ -193,7 +193,7 @@ object NotificationUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun cancelExistingNotificationWithId(context: Context?, conversationUser: UserEntity, notificationId: Long) {
|
fun cancelExistingNotificationWithId(context: Context?, conversationUser: UserEntity, notificationId: Long?) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && conversationUser.id != -1L &&
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && conversationUser.id != -1L &&
|
||||||
context != null
|
context != null
|
||||||
) {
|
) {
|
||||||
|
@ -331,7 +331,7 @@ public class PushUtils {
|
|||||||
pushConfigurationState.setDeviceIdentifier(proxyMap.get("deviceIdentifier"));
|
pushConfigurationState.setDeviceIdentifier(proxyMap.get("deviceIdentifier"));
|
||||||
pushConfigurationState.setDeviceIdentifierSignature(proxyMap.get("deviceIdentifierSignature"));
|
pushConfigurationState.setDeviceIdentifierSignature(proxyMap.get("deviceIdentifierSignature"));
|
||||||
pushConfigurationState.setUserPublicKey(proxyMap.get("userPublicKey"));
|
pushConfigurationState.setUserPublicKey(proxyMap.get("userPublicKey"));
|
||||||
pushConfigurationState.setUsesRegularPass(false);
|
pushConfigurationState.setUsesRegularPass(Boolean.FALSE);
|
||||||
|
|
||||||
userUtils.createOrUpdateUser(null,
|
userUtils.createOrUpdateUser(null,
|
||||||
null,
|
null,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
build:
|
build:
|
||||||
maxIssues: 223
|
maxIssues: 217
|
||||||
weights:
|
weights:
|
||||||
# complexity: 2
|
# complexity: 2
|
||||||
# LongParameterList: 1
|
# LongParameterList: 1
|
||||||
|
@ -1 +1 @@
|
|||||||
448
|
446
|
Loading…
Reference in New Issue
Block a user