Don't unnecessarily create threads for groups.
This commit is contained in:
parent
fb8f481a87
commit
7c8549bf5e
1 changed files with 10 additions and 8 deletions
|
@ -287,8 +287,9 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
|
|||
.toList();
|
||||
|
||||
callManager.peekGroupCall(SignalStore.internalValues().groupCallingServer(), credential.getTokenBytes().toByteArray(), members, peekInfo -> {
|
||||
long threadId = DatabaseFactory.getThreadDatabase(context).getOrCreateThreadIdFor(group);
|
||||
Long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(group.getId());
|
||||
|
||||
if (threadId != null) {
|
||||
DatabaseFactory.getSmsDatabase(context)
|
||||
.updatePreviousGroupCall(threadId,
|
||||
peekInfo.getEraId(),
|
||||
|
@ -298,6 +299,7 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
|
|||
ApplicationDependencies.getMessageNotifier().updateNotification(context, threadId, true, 0, BubbleUtil.BubbleState.HIDDEN);
|
||||
|
||||
EventBus.getDefault().postSticky(new GroupCallPeekEvent(id, peekInfo.getEraId(), peekInfo.getDeviceCount(), peekInfo.getMaxDevices()));
|
||||
}
|
||||
});
|
||||
} catch (IOException | VerificationFailedException | CallException e) {
|
||||
Log.e(TAG, "error peeking from active conversation", e);
|
||||
|
|
Loading…
Add table
Reference in a new issue