]> nmode's Git Repositories - signal-cli/commitdiff
Fix reading nickname from storage record
authorAsamK <asamk@gmx.de>
Tue, 14 Jan 2025 19:24:05 +0000 (20:24 +0100)
committerAsamK <asamk@gmx.de>
Tue, 14 Jan 2025 19:30:06 +0000 (20:30 +0100)
Fixes #1664

lib/src/main/java/org/asamk/signal/manager/syncStorage/ContactRecordProcessor.java

index 12740fbd1a1d668a3dec4f4d5630c0f3aa185899..2863874b0772b28508c096c854bb745c802d24f3 100644 (file)
@@ -267,8 +267,12 @@ public class ContactRecordProcessor extends DefaultStorageRecordProcessor<Signal
                     .withGivenName(nullIfEmpty(contactProto.systemGivenName))
                     .withFamilyName(nullIfEmpty(contactProto.systemFamilyName))
                     .withNickName(nullIfEmpty(contactProto.systemNickname))
                     .withGivenName(nullIfEmpty(contactProto.systemGivenName))
                     .withFamilyName(nullIfEmpty(contactProto.systemFamilyName))
                     .withNickName(nullIfEmpty(contactProto.systemNickname))
-                    .withNickNameGivenName(nullIfEmpty(contactProto.givenName))
-                    .withNickNameFamilyName(nullIfEmpty(contactProto.familyName))
+                    .withNickNameGivenName(nullIfEmpty(contactProto.nickname == null
+                            ? null
+                            : contactProto.nickname.given))
+                    .withNickNameFamilyName(nullIfEmpty(contactProto.nickname == null
+                            ? null
+                            : contactProto.nickname.family))
                     .withNote(nullIfEmpty(contactProto.note))
                     .withUnregisteredTimestamp(contactProto.unregisteredAtTimestamp == 0
                             ? null
                     .withNote(nullIfEmpty(contactProto.note))
                     .withUnregisteredTimestamp(contactProto.unregisteredAtTimestamp == 0
                             ? null