mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 07:05:49 +03:00
Merge pull request #11546 from nextcloud/remoteOperation
Use resultData for Push and Notifications
This commit is contained in:
commit
36e3f42e33
3 changed files with 7 additions and 10 deletions
|
@ -220,14 +220,14 @@ public final class PushUtils {
|
|||
OwnCloudClient client = OwnCloudClientManagerFactory.getDefaultSingleton().
|
||||
getClientFor(ocAccount, context);
|
||||
|
||||
RemoteOperationResult remoteOperationResult =
|
||||
RemoteOperationResult<PushResponse> remoteOperationResult =
|
||||
new RegisterAccountDeviceForNotificationsOperation(pushTokenHash,
|
||||
publicKey,
|
||||
context.getResources().getString(R.string.push_server_url))
|
||||
.execute(client);
|
||||
|
||||
if (remoteOperationResult.isSuccess()) {
|
||||
PushResponse pushResponse = remoteOperationResult.getPushResponseData();
|
||||
PushResponse pushResponse = remoteOperationResult.getResultData();
|
||||
|
||||
RemoteOperationResult resultProxy = new RegisterAccountDeviceForProxyOperation(
|
||||
context.getResources().getString(R.string.push_server_url),
|
||||
|
|
|
@ -256,7 +256,7 @@ class NotificationWork constructor(
|
|||
val result = GetNotificationRemoteOperation(decryptedPushMessage.nid)
|
||||
.execute(client)
|
||||
if (result.isSuccess) {
|
||||
val notification = result.notificationData[0]
|
||||
val notification = result.resultData
|
||||
sendNotification(notification, account)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
|
|
@ -40,7 +40,6 @@ import com.owncloud.android.databinding.NotificationsLayoutBinding;
|
|||
import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperation;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.common.utils.Log_OC;
|
||||
import com.owncloud.android.lib.resources.notifications.GetNotificationsRemoteOperation;
|
||||
|
@ -226,13 +225,11 @@ public class NotificationsActivity extends DrawerActivity implements Notificatio
|
|||
Thread t = new Thread(() -> {
|
||||
initializeAdapter();
|
||||
|
||||
RemoteOperation getRemoteNotificationOperation = new GetNotificationsRemoteOperation();
|
||||
final RemoteOperationResult result = getRemoteNotificationOperation.execute(client);
|
||||
GetNotificationsRemoteOperation getRemoteNotificationOperation = new GetNotificationsRemoteOperation();
|
||||
final RemoteOperationResult<List<Notification>> result = getRemoteNotificationOperation.execute(client);
|
||||
|
||||
if (result.isSuccess() && result.getNotificationData() != null) {
|
||||
final List<Notification> notifications = result.getNotificationData();
|
||||
|
||||
runOnUiThread(() -> populateList(notifications));
|
||||
if (result.isSuccess() && result.getResultData() != null) {
|
||||
runOnUiThread(() -> populateList(result.getResultData()));
|
||||
} else {
|
||||
Log_OC.d(TAG, result.getLogMessage());
|
||||
// show error
|
||||
|
|
Loading…
Reference in a new issue