Browse Source

Clean up push

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 7 years ago
parent
commit
f89afa4131

+ 2 - 7
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.application.NextcloudTalkApplication;
 import com.nextcloud.talk.models.SignatureVerification;
 import com.nextcloud.talk.models.SignatureVerification;
 import com.nextcloud.talk.models.json.push.DecryptedPushMessage;
 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.NotificationUtils;
 import com.nextcloud.talk.utils.PushUtils;
 import com.nextcloud.talk.utils.PushUtils;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
 import com.nextcloud.talk.utils.bundle.BundleKeys;
@@ -77,12 +76,8 @@ public class NotificationJob extends Job {
         if (!TextUtils.isEmpty(subject) && !TextUtils.isEmpty(signature)) {
         if (!TextUtils.isEmpty(subject) && !TextUtils.isEmpty(signature)) {
 
 
             try {
             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();
                 PushUtils pushUtils = new PushUtils();
                 PrivateKey privateKey = (PrivateKey) pushUtils.readKeyFromFile(false);
                 PrivateKey privateKey = (PrivateKey) pushUtils.readKeyFromFile(false);
 
 

+ 0 - 32
app/src/main/java/com/nextcloud/talk/models/json/push/PushMessage.java

@@ -1,32 +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 org.parceler.Parcel;
-
-import lombok.Data;
-
-@Data
-@Parcel
-public class PushMessage {
-    String subject;
-    String signature;
-}