Fix in-the-same-conversation detection
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Родитель
b4662b78ec
Коммит
8dba5aa889
|
@ -1059,6 +1059,7 @@ public class CallController extends BaseController {
|
|||
}
|
||||
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomToken(roomToken);
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setInCall(true);
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(userEntity);
|
||||
|
||||
|
|
|
@ -445,6 +445,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||
}
|
||||
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomId(roomId);
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setCurrentRoomToken(roomId);
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setInCall(false);
|
||||
ApplicationWideCurrentRoomHolder.getInstance().setUserInRoom(conversationUser);
|
||||
|
||||
|
|
|
@ -126,8 +126,10 @@ public class NotificationJob extends Job {
|
|||
boolean hasChatSupport = signatureVerification.getUserEntity().hasSpreedCapabilityWithName
|
||||
("chat-v2");
|
||||
|
||||
boolean isInTheSameRoomAsNotification = ApplicationWideCurrentRoomHolder.getInstance().
|
||||
getCurrentRoomId().equals(decryptedPushMessage.getId()) &&
|
||||
boolean isInTheSameRoomAsNotification = (ApplicationWideCurrentRoomHolder.getInstance().
|
||||
getCurrentRoomId().equals(decryptedPushMessage.getId()) ||
|
||||
ApplicationWideCurrentRoomHolder.getInstance()
|
||||
.getCurrentRoomToken().equals(decryptedPushMessage.getId())) &&
|
||||
signatureVerification.getUserEntity().equals(ApplicationWideCurrentRoomHolder
|
||||
.getInstance().getUserInRoom());
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.nextcloud.talk.models.database.UserEntity;
|
|||
|
||||
public class ApplicationWideCurrentRoomHolder {
|
||||
private String currentRoomId = "";
|
||||
private String currentRoomToken = "";
|
||||
private UserEntity userInRoom = new UserEntity();
|
||||
private boolean inCall = false;
|
||||
|
||||
|
@ -37,6 +38,15 @@ public class ApplicationWideCurrentRoomHolder {
|
|||
currentRoomId = "";
|
||||
userInRoom = new UserEntity();
|
||||
inCall = false;
|
||||
currentRoomToken = "";
|
||||
}
|
||||
|
||||
public String getCurrentRoomToken() {
|
||||
return currentRoomToken;
|
||||
}
|
||||
|
||||
public void setCurrentRoomToken(String currentRoomToken) {
|
||||
this.currentRoomToken = currentRoomToken;
|
||||
}
|
||||
|
||||
public String getCurrentRoomId() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче