mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Fix handling incoming contacts sync message
This commit is contained in:
parent
626406a43c
commit
0d0978011d
2 changed files with 5 additions and 6 deletions
|
@ -88,9 +88,9 @@ public class AttachmentHelper {
|
|||
SignalServiceAttachment attachment, AttachmentHandler consumer
|
||||
) throws IOException {
|
||||
if (attachment.isStream()) {
|
||||
try (var input = attachment.asStream().getInputStream()) {
|
||||
var input = attachment.asStream().getInputStream();
|
||||
// don't close input stream here, it might be reused later (e.g. with contact sync messages ...)
|
||||
consumer.handle(input);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ public class SyncHelper {
|
|||
sendHelper.sendSyncMessage(SignalServiceSyncMessage.forVerified(verifiedMessage));
|
||||
}
|
||||
|
||||
public void handleSyncDeviceContacts(final InputStream input) {
|
||||
public void handleSyncDeviceContacts(final InputStream input) throws IOException {
|
||||
final var s = new DeviceContactsInputStream(input);
|
||||
DeviceContact c;
|
||||
while (true) {
|
||||
|
@ -226,8 +226,7 @@ public class SyncHelper {
|
|||
logger.warn("Sync contacts contained invalid contact, ignoring: {}", e.getMessage());
|
||||
continue;
|
||||
} else {
|
||||
logger.warn("Failed to read sync contacts", e);
|
||||
break;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (c == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue