Don't unnecessarily create threads for groups.

fork-5.53.8
Greyson Parrelli 2021-07-30 12:27:28 -04:00 zatwierdzone przez GitHub
rodzic fb8f481a87
commit 7c8549bf5e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 10 dodań i 8 usunięć

Wyświetl plik

@ -287,17 +287,19 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
.toList(); .toList();
callManager.peekGroupCall(SignalStore.internalValues().groupCallingServer(), credential.getTokenBytes().toByteArray(), members, peekInfo -> { 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());
DatabaseFactory.getSmsDatabase(context) if (threadId != null) {
.updatePreviousGroupCall(threadId, DatabaseFactory.getSmsDatabase(context)
peekInfo.getEraId(), .updatePreviousGroupCall(threadId,
peekInfo.getJoinedMembers(), peekInfo.getEraId(),
WebRtcUtil.isCallFull(peekInfo)); peekInfo.getJoinedMembers(),
WebRtcUtil.isCallFull(peekInfo));
ApplicationDependencies.getMessageNotifier().updateNotification(context, threadId, true, 0, BubbleUtil.BubbleState.HIDDEN); ApplicationDependencies.getMessageNotifier().updateNotification(context, threadId, true, 0, BubbleUtil.BubbleState.HIDDEN);
EventBus.getDefault().postSticky(new GroupCallPeekEvent(id, peekInfo.getEraId(), peekInfo.getDeviceCount(), peekInfo.getMaxDevices())); EventBus.getDefault().postSticky(new GroupCallPeekEvent(id, peekInfo.getEraId(), peekInfo.getDeviceCount(), peekInfo.getMaxDevices()));
}
}); });
} catch (IOException | VerificationFailedException | CallException e) { } catch (IOException | VerificationFailedException | CallException e) {
Log.e(TAG, "error peeking from active conversation", e); Log.e(TAG, "error peeking from active conversation", e);