From 4629d02dc48c23672416606a25f10597e98fb785 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Wed, 19 Jan 2022 13:16:39 +0100 Subject: [PATCH] add copyright + minor refactoring Signed-off-by: Marcel Hibbe --- .../talk/utils/ClosedInterfaceImpl.java | 5 ++++ .../talk/jobs/GetFirebasePushTokenWorker.kt | 1 - .../talk/utils/ClosedInterfaceImpl.kt | 23 ++++++++++++++++++- .../application/NextcloudTalkApplication.kt | 6 +++-- .../talk/interfaces/ClosedInterface.kt | 2 ++ .../talk/jobs/PushRegistrationWorker.java | 2 ++ .../com/nextcloud/talk/utils/PushUtils.java | 12 +++++----- app/src/main/res/values/setup.xml | 2 ++ .../talk/utils/ClosedInterfaceImpl.java | 2 ++ 9 files changed, 45 insertions(+), 10 deletions(-) diff --git a/app/src/generic/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.java b/app/src/generic/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.java index 71c25e757..19ca5448b 100644 --- a/app/src/generic/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.java +++ b/app/src/generic/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.java @@ -2,7 +2,9 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Marcel Hibbe * Copyright (C) 2017-2018 Mario Danic + * Copyright (C) 2022 Marcel Hibbe * * 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 @@ -37,5 +39,8 @@ public class ClosedInterfaceImpl implements ClosedInterface { @Override public void setUpPushTokenRegistration() { // no push notifications for generic build flavour :( + // If you want to develop push notifications without google play services, here is a good place to start... + // Also have a look at app/src/gplay/AndroidManifest.xml to see how to include a service that handles push + // notifications. } } diff --git a/app/src/gplay/java/com/nextcloud/talk/jobs/GetFirebasePushTokenWorker.kt b/app/src/gplay/java/com/nextcloud/talk/jobs/GetFirebasePushTokenWorker.kt index 89e3bd64a..236e50a43 100644 --- a/app/src/gplay/java/com/nextcloud/talk/jobs/GetFirebasePushTokenWorker.kt +++ b/app/src/gplay/java/com/nextcloud/talk/jobs/GetFirebasePushTokenWorker.kt @@ -48,7 +48,6 @@ class GetFirebasePushTokenWorker(val context: Context, workerParameters: WorkerP } val token = task.result - Log.d(TAG, "Fetching FCM registration token succeeded. token = $token") appPreferences?.pushToken = token val pushRegistrationWork = OneTimeWorkRequest.Builder(PushRegistrationWorker::class.java).build() diff --git a/app/src/gplay/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.kt b/app/src/gplay/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.kt index 7ab19d8bb..3c19854d4 100644 --- a/app/src/gplay/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.kt +++ b/app/src/gplay/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.kt @@ -1,3 +1,24 @@ +/* + * Nextcloud Talk application + * + * @author Mario Danic + * @author Marcel Hibbe + * Copyright (C) 2017-2019 Mario Danic + * Copyright (C) 2022 Marcel Hibbe + * + * 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.utils import android.content.Intent @@ -84,4 +105,4 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi periodicTokenRefreshFromFCM ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt b/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt index 66c766c34..02b26ed4b 100644 --- a/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt +++ b/app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt @@ -2,8 +2,10 @@ * * Nextcloud Talk application * - * @author Mario Danic - * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com) + * @author Mario Danic + * @author Marcel Hibbe + * Copyright (C) 2017 Mario Danic + * Copyright (C) 2022 Marcel Hibbe * * 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 diff --git a/app/src/main/java/com/nextcloud/talk/interfaces/ClosedInterface.kt b/app/src/main/java/com/nextcloud/talk/interfaces/ClosedInterface.kt index fee12d99b..6ece537a1 100644 --- a/app/src/main/java/com/nextcloud/talk/interfaces/ClosedInterface.kt +++ b/app/src/main/java/com/nextcloud/talk/interfaces/ClosedInterface.kt @@ -2,7 +2,9 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Marcel Hibbe * Copyright (C) 2017-2018 Mario Danic + * Copyright (C) 2022 Marcel Hibbe * * 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 diff --git a/app/src/main/java/com/nextcloud/talk/jobs/PushRegistrationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/PushRegistrationWorker.java index a4a917b70..583bf7ed4 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/PushRegistrationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/PushRegistrationWorker.java @@ -2,7 +2,9 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Marcel Hibbe * Copyright (C) 2017 Mario Danic + * Copyright (C) 2022 Marcel Hibbe * * 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 diff --git a/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java b/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java index a5f06573e..f92b0a5ce 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/PushUtils.java @@ -2,7 +2,9 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Marcel Hibbe * Copyright (C) 2017 Mario Danic + * Copyright (C) 2022 Marcel Hibbe * * 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 @@ -254,7 +256,8 @@ public class PushUtils { ncApi.registerDeviceForNotificationsWithNextcloud( credentials, - ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()), nextcloudRegisterPushMap) + ApiUtils.getUrlNextcloudPush(userEntity.getBaseUrl()), + nextcloudRegisterPushMap) .subscribe(new Observer() { @Override public void onSubscribe(@NonNull Disposable d) { @@ -263,8 +266,7 @@ public class PushUtils { @Override public void onNext(@NonNull PushRegistrationOverall pushRegistrationOverall) { - Log.d(TAG, - "pushToken successfully registered at nextcloud server. pushToken= " + token.substring(0,5) + "..."); + Log.d(TAG, "pushToken successfully registered at nextcloud server."); Map proxyMap = new HashMap<>(); proxyMap.put("pushToken", token); @@ -303,9 +305,7 @@ public class PushUtils { @Override public void onNext(@NonNull Void aVoid) { try { - Log.d(TAG, - "pushToken successfully registered at pushproxy. pushToken= " + proxyMap.get("pushToken").substring(0,5) + - "..."); + Log.d(TAG, "pushToken successfully registered at pushproxy."); createOrUpdateUser(proxyMap, userEntity); } catch (IOException e) { Log.e(TAG, "IOException while updating user", e); diff --git a/app/src/main/res/values/setup.xml b/app/src/main/res/values/setup.xml index fd304c3c0..8bf763543 100644 --- a/app/src/main/res/values/setup.xml +++ b/app/src/main/res/values/setup.xml @@ -3,7 +3,9 @@ ~ Nextcloud Talk application ~ ~ @author Mario Danic + ~ @author Marcel Hibbe ~ Copyright (C) 2017-2019 Mario Danic + ~ Copyright (C) 2022 Marcel Hibbe ~ ~ 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 diff --git a/app/src/qa/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.java b/app/src/qa/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.java index 34c10d888..1625c9867 100644 --- a/app/src/qa/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.java +++ b/app/src/qa/java/com/nextcloud/talk/utils/ClosedInterfaceImpl.java @@ -2,7 +2,9 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Marcel Hibbe * Copyright (C) 2017-2018 Mario Danic + * Copyright (C) 2022 Marcel Hibbe * * 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