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
|
SignalServiceAttachment attachment, AttachmentHandler consumer
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
if (attachment.isStream()) {
|
if (attachment.isStream()) {
|
||||||
try (var input = attachment.asStream().getInputStream()) {
|
var input = attachment.asStream().getInputStream();
|
||||||
consumer.handle(input);
|
// don't close input stream here, it might be reused later (e.g. with contact sync messages ...)
|
||||||
}
|
consumer.handle(input);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ public class SyncHelper {
|
||||||
sendHelper.sendSyncMessage(SignalServiceSyncMessage.forVerified(verifiedMessage));
|
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);
|
final var s = new DeviceContactsInputStream(input);
|
||||||
DeviceContact c;
|
DeviceContact c;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -226,8 +226,7 @@ public class SyncHelper {
|
||||||
logger.warn("Sync contacts contained invalid contact, ignoring: {}", e.getMessage());
|
logger.warn("Sync contacts contained invalid contact, ignoring: {}", e.getMessage());
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Failed to read sync contacts", e);
|
throw e;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (c == null) {
|
if (c == null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue