mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Fix session request handling bug
This commit is contained in:
parent
4aafba218c
commit
9f4fcec98f
@ -505,7 +505,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (threadId != null) {
|
if (threadId != null) {
|
||||||
SessionManagementProtocol.handleEndSessionMessage(context, content);
|
SessionManagementProtocol.handleEndSessionMessageIfNeeded(context, content);
|
||||||
MessageNotifier.updateNotification(context, threadId);
|
MessageNotifier.updateNotification(context, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,13 +75,15 @@ object SessionManagementProtocol {
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun handleSessionRequestIfNeeded(context: Context, content: SignalServiceContent) {
|
fun handleSessionRequestIfNeeded(context: Context, content: SignalServiceContent) {
|
||||||
|
if (!content.dataMessage.isPresent || !content.dataMessage.get().isSessionRequest) { return }
|
||||||
// Auto-accept all session requests
|
// Auto-accept all session requests
|
||||||
val ephemeralMessage = EphemeralMessage.create(content.sender)
|
val ephemeralMessage = EphemeralMessage.create(content.sender)
|
||||||
ApplicationContext.getInstance(context).jobManager.add(PushEphemeralMessageSendJob(ephemeralMessage))
|
ApplicationContext.getInstance(context).jobManager.add(PushEphemeralMessageSendJob(ephemeralMessage))
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun handleEndSessionMessage(context: Context, content: SignalServiceContent) {
|
fun handleEndSessionMessageIfNeeded(context: Context, content: SignalServiceContent) {
|
||||||
|
if (!content.dataMessage.isPresent || !content.dataMessage.get().isEndSession) { return }
|
||||||
// TODO: Notify the user
|
// TODO: Notify the user
|
||||||
val sessionStore = TextSecureSessionStore(context)
|
val sessionStore = TextSecureSessionStore(context)
|
||||||
val lokiThreadDB = DatabaseFactory.getLokiThreadDatabase(context)
|
val lokiThreadDB = DatabaseFactory.getLokiThreadDatabase(context)
|
||||||
|
Loading…
Reference in New Issue
Block a user