mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
parent
314159c273
commit
20f8fa2ebd
1 changed files with 4 additions and 16 deletions
|
@ -435,10 +435,7 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||||
public void deleteRecipientData(RecipientId recipientId) {
|
public void deleteRecipientData(RecipientId recipientId) {
|
||||||
logger.debug("Deleting recipient data for {}", recipientId);
|
logger.debug("Deleting recipient data for {}", recipientId);
|
||||||
synchronized (recipientsLock) {
|
synchronized (recipientsLock) {
|
||||||
recipientAddressCache.entrySet()
|
recipientAddressCache.entrySet().removeIf(e -> e.getValue().id().equals(recipientId));
|
||||||
.stream()
|
|
||||||
.filter(e -> e.getValue().id().equals(recipientId))
|
|
||||||
.forEach(e -> recipientAddressCache.remove(e.getKey()));
|
|
||||||
try (final var connection = database.getConnection()) {
|
try (final var connection = database.getConnection()) {
|
||||||
connection.setAutoCommit(false);
|
connection.setAutoCommit(false);
|
||||||
storeContact(connection, recipientId, null);
|
storeContact(connection, recipientId, null);
|
||||||
|
@ -708,10 +705,7 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||||
recipientMergeHandler.mergeRecipients(connection, pair.first(), toBeMergedRecipientId);
|
recipientMergeHandler.mergeRecipients(connection, pair.first(), toBeMergedRecipientId);
|
||||||
deleteRecipient(connection, toBeMergedRecipientId);
|
deleteRecipient(connection, toBeMergedRecipientId);
|
||||||
synchronized (recipientsLock) {
|
synchronized (recipientsLock) {
|
||||||
recipientAddressCache.entrySet()
|
recipientAddressCache.entrySet().removeIf(e -> e.getValue().id().equals(toBeMergedRecipientId));
|
||||||
.stream()
|
|
||||||
.filter(e -> e.getValue().id().equals(toBeMergedRecipientId))
|
|
||||||
.forEach(e -> recipientAddressCache.remove(e.getKey()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
@ -807,10 +801,7 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||||
|
|
||||||
private void removeRecipientAddress(Connection connection, RecipientId recipientId) throws SQLException {
|
private void removeRecipientAddress(Connection connection, RecipientId recipientId) throws SQLException {
|
||||||
synchronized (recipientsLock) {
|
synchronized (recipientsLock) {
|
||||||
recipientAddressCache.entrySet()
|
recipientAddressCache.entrySet().removeIf(e -> e.getValue().id().equals(recipientId));
|
||||||
.stream()
|
|
||||||
.filter(e -> e.getValue().id().equals(recipientId))
|
|
||||||
.forEach(e -> recipientAddressCache.remove(e.getKey()));
|
|
||||||
final var sql = (
|
final var sql = (
|
||||||
"""
|
"""
|
||||||
UPDATE %s
|
UPDATE %s
|
||||||
|
@ -829,10 +820,7 @@ public class RecipientStore implements RecipientIdCreator, RecipientResolver, Re
|
||||||
Connection connection, RecipientId recipientId, final RecipientAddress address
|
Connection connection, RecipientId recipientId, final RecipientAddress address
|
||||||
) throws SQLException {
|
) throws SQLException {
|
||||||
synchronized (recipientsLock) {
|
synchronized (recipientsLock) {
|
||||||
recipientAddressCache.entrySet()
|
recipientAddressCache.entrySet().removeIf(e -> e.getValue().id().equals(recipientId));
|
||||||
.stream()
|
|
||||||
.filter(e -> e.getValue().id().equals(recipientId))
|
|
||||||
.forEach(e -> recipientAddressCache.remove(e.getKey()));
|
|
||||||
final var sql = (
|
final var sql = (
|
||||||
"""
|
"""
|
||||||
UPDATE %s
|
UPDATE %s
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue