浏览代码

add copyright + minor refactoring

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 3 年之前
父节点
当前提交
4629d02dc4

+ 5 - 0
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 <mario@lovelyhq.com>
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
  *
  * 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.
     }
 }

+ 0 - 1
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()

+ 22 - 1
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 <mario@lovelyhq.com>
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
+ *
+ * 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.utils
 
 import android.content.Intent
@@ -84,4 +105,4 @@ class ClosedInterfaceImpl : ClosedInterface, ProviderInstaller.ProviderInstallLi
                 periodicTokenRefreshFromFCM
             )
     }
-}
+}

+ 4 - 2
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 <mario@lovelyhq.com>
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
  *
  *   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

+ 2 - 0
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 <mario@lovelyhq.com>
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
  *
  * 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

+ 2 - 0
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 <mario@lovelyhq.com>
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
  *
  * 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

+ 6 - 6
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 <mario@lovelyhq.com>
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
  *
  * 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<PushRegistrationOverall>() {
                 @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<String, String> 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);

+ 2 - 0
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 <mario@lovelyhq.com>
+  ~ Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
   ~
   ~ 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

+ 2 - 0
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 <mario@lovelyhq.com>
+ * Copyright (C) 2022 Marcel Hibbe <dev@mhibbe.de>
  *
  * 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