mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-25 06:25:40 +03:00
Refactoring & fix for earlier Nc versions
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
eade532f79
commit
530e8b0547
1 changed files with 8 additions and 5 deletions
|
@ -93,7 +93,6 @@ import java.net.CookieManager;
|
|||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.PrivateKey;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.zip.CRC32;
|
||||
|
||||
|
@ -113,7 +112,7 @@ public class NotificationWorker extends Worker {
|
|||
@Inject
|
||||
OkHttpClient okHttpClient;
|
||||
|
||||
NcApi ncApi;
|
||||
private NcApi ncApi;
|
||||
|
||||
private DecryptedPushMessage decryptedPushMessage;
|
||||
private Context context;
|
||||
|
@ -161,7 +160,11 @@ public class NotificationWorker extends Worker {
|
|||
} else {
|
||||
conversationType = "public";
|
||||
}
|
||||
showMessageNotificationWithObjectData(intent);
|
||||
if (decryptedPushMessage.getNotificationId() != Long.MIN_VALUE) {
|
||||
showNotificationWithObjectData(intent);
|
||||
} else {
|
||||
showNotification(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,7 +180,7 @@ public class NotificationWorker extends Worker {
|
|||
}
|
||||
}
|
||||
|
||||
private void showMessageNotificationWithObjectData(Intent intent) {
|
||||
private void showNotificationWithObjectData(Intent intent) {
|
||||
UserEntity userEntity = signatureVerification.getUserEntity();
|
||||
ncApi.getNotification(credentials, ApiUtils.getUrlForNotificationWithId(userEntity.getBaseUrl(),
|
||||
Long.toString(decryptedPushMessage.getNotificationId())))
|
||||
|
@ -584,7 +587,7 @@ public class NotificationWorker extends Worker {
|
|||
break;
|
||||
case "chat":
|
||||
if (decryptedPushMessage.getNotificationId() != Long.MIN_VALUE) {
|
||||
showMessageNotificationWithObjectData(intent);
|
||||
showNotificationWithObjectData(intent);
|
||||
} else {
|
||||
showNotification(intent);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue