mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-01 20:22:03 +00:00
add copyright + minor refactoring
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
76cab3b9a0
commit
4629d02dc4
@ -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.
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
@ -3,7 +3,9 @@
|
||||
* Nextcloud Talk application
|
||||
*
|
||||
* @author Mario Danic
|
||||
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
||||
* @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,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,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
|
||||
|
@ -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);
|
||||
|
@ -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,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
|
||||
|
Loading…
Reference in New Issue
Block a user