From f89afa4131899c4bce431c1e35fed9d7c38524a9 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Thu, 22 Mar 2018 18:11:53 +0100 Subject: [PATCH] Clean up push Signed-off-by: Mario Danic --- .../nextcloud/talk/jobs/NotificationJob.java | 9 ++---- .../talk/models/json/push/PushMessage.java | 32 ------------------- 2 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java diff --git a/app/src/main/java/com/nextcloud/talk/jobs/NotificationJob.java b/app/src/main/java/com/nextcloud/talk/jobs/NotificationJob.java index 9a7191863..21c8a9d2b 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/NotificationJob.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/NotificationJob.java @@ -44,7 +44,6 @@ import com.nextcloud.talk.activities.CallActivity; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.models.SignatureVerification; import com.nextcloud.talk.models.json.push.DecryptedPushMessage; -import com.nextcloud.talk.models.json.push.PushMessage; import com.nextcloud.talk.utils.NotificationUtils; import com.nextcloud.talk.utils.PushUtils; import com.nextcloud.talk.utils.bundle.BundleKeys; @@ -77,12 +76,8 @@ public class NotificationJob extends Job { if (!TextUtils.isEmpty(subject) && !TextUtils.isEmpty(signature)) { try { - PushMessage pushMessage = new PushMessage(); - pushMessage.setSubject(subject); - pushMessage.setSignature(signature); - - byte[] base64DecodedSubject = Base64.decode(pushMessage.getSubject(), Base64.DEFAULT); - byte[] base64DecodedSignature = Base64.decode(pushMessage.getSignature(), Base64.DEFAULT); + byte[] base64DecodedSubject = Base64.decode(subject, Base64.DEFAULT); + byte[] base64DecodedSignature = Base64.decode(signature, Base64.DEFAULT); PushUtils pushUtils = new PushUtils(); PrivateKey privateKey = (PrivateKey) pushUtils.readKeyFromFile(false); diff --git a/app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java b/app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java deleted file mode 100644 index cc8f39932..000000000 --- a/app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Nextcloud Talk application - * - * @author Mario Danic - * 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 . - */ - -package com.nextcloud.talk.models.json.push; - -import org.parceler.Parcel; - -import lombok.Data; - -@Data -@Parcel -public class PushMessage { - String subject; - String signature; -}