Mark as read - SpotBugs

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
This commit is contained in:
Dariusz Olszewski 2022-07-11 21:46:54 +02:00 committed by Marcel Hibbe (Rebase PR Action)
parent f91d45e2db
commit 97ea95c30f

View File

@ -499,7 +499,7 @@ public class NotificationWorker extends Worker {
MessagingStyle newStyle = new MessagingStyle(person); MessagingStyle newStyle = new MessagingStyle(person);
newStyle.setConversationTitle(decryptedPushMessage.getSubject()); newStyle.setConversationTitle(decryptedPushMessage.getSubject());
newStyle.setGroupConversation(!conversationType.equals("one2one")); newStyle.setGroupConversation(!"one2one".equals(conversationType));
if (style != null) { if (style != null) {
style.getMessages().forEach(message -> newStyle.addMessage( style.getMessages().forEach(message -> newStyle.addMessage(
@ -512,7 +512,7 @@ public class NotificationWorker extends Worker {
return newStyle; return newStyle;
} }
private int parseMessageId(@NonNull String objectId) throws NumberFormatException { private int parseMessageId(@NonNull String objectId) {
String[] objectIdParts = objectId.split("/"); String[] objectIdParts = objectId.split("/");
if (objectIdParts.length < 2) { if (objectIdParts.length < 2) {
throw new NumberFormatException("Invalid objectId, doesn't contain at least one '/'"); throw new NumberFormatException("Invalid objectId, doesn't contain at least one '/'");
@ -531,7 +531,7 @@ public class NotificationWorker extends Worker {
return; return;
} }
if (!notification.category.equals(Notification.CATEGORY_CALL) || !muteCall) { if (!Notification.CATEGORY_CALL.equals(notification.category) || !muteCall) {
Uri soundUri = NotificationUtils.INSTANCE.getMessageRingtoneUri(context, appPreferences); Uri soundUri = NotificationUtils.INSTANCE.getMessageRingtoneUri(context, appPreferences);
if (soundUri != null && !ApplicationWideCurrentRoomHolder.getInstance().isInCall() && if (soundUri != null && !ApplicationWideCurrentRoomHolder.getInstance().isInCall() &&
(DoNotDisturbUtils.INSTANCE.shouldPlaySound() || importantConversation)) { (DoNotDisturbUtils.INSTANCE.shouldPlaySound() || importantConversation)) {
@ -611,14 +611,14 @@ public class NotificationWorker extends Worker {
ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(new ncApi = retrofit.newBuilder().client(okHttpClient.newBuilder().cookieJar(new
JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class); JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class);
boolean shouldShowNotification = decryptedPushMessage.getApp().equals("spreed"); boolean shouldShowNotification = "spreed".equals(decryptedPushMessage.getApp());
if (shouldShowNotification) { if (shouldShowNotification) {
Intent intent; Intent intent;
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
boolean startACall = decryptedPushMessage.getType().equals("call"); boolean startACall = "call".equals(decryptedPushMessage.getType());
if (startACall) { if (startACall) {
intent = new Intent(context, CallActivity.class); intent = new Intent(context, CallActivity.class);
} else { } else {