Skip to content

Commit 0d7053b

Browse files
committed
Fix json parsing
1 parent 3775214 commit 0d7053b

16 files changed

+63
-32
lines changed

libsignal-service-dotnet/profiles/SignalServiceProfile.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ namespace libsignalservice.profiles
99
public class SignalServiceProfile
1010
{
1111
[JsonProperty("identityKey")]
12-
public string IdentityKey { get; set; }
12+
public string IdentityKey { get; private set; }
1313
[JsonProperty("name")]
14-
public string Name { get; set; }
14+
public string Name { get; private set; }
1515
[JsonProperty("avatar")]
16-
public string Avatar { get; set; }
16+
public string Avatar { get; private set; }
17+
18+
public SignalServiceProfile() { }
1719
}
1820
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
1921
}

libsignal-service-dotnet/push/ContactTokenDetails.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@ namespace libsignalservice.push
88
public class ContactTokenDetails
99
{
1010
[JsonProperty("token")]
11-
public string Token { get; set; }
11+
public string Token { get; private set; }
1212

1313
[JsonProperty("relay")]
14-
public string Relay { get; set; }
14+
public string Relay { get; private set; }
1515

1616
[JsonProperty("number")]
1717
public string Number { get; set; }
1818

1919
[JsonProperty("voice")]
20-
public bool Voice { get; set; }
20+
public bool Voice { get; private set; }
2121

2222
[JsonProperty("video")]
23-
public bool Video { get; set; }
23+
public bool Video { get; private set; }
24+
25+
public ContactTokenDetails() { }
2426
}
2527
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2628
}

libsignal-service-dotnet/push/ContactTokenDetailsList.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ namespace libsignalservice.push
77
internal class ContactTokenDetailsList
88
{
99
[JsonProperty("contacts")]
10-
public List<ContactTokenDetails> Contacts { get; set; }
10+
public List<ContactTokenDetails> Contacts { get; private set; }
11+
12+
public ContactTokenDetailsList() { }
1113
}
1214
}

libsignal-service-dotnet/push/DeviceCode.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ namespace libsignalservice.push
66
internal class DeviceCode
77
{
88
[JsonProperty("verificationCode")]
9-
public String VerificationCode { get; set; }
9+
public String VerificationCode { get; private set; }
10+
11+
public DeviceCode() { }
1012
}
1113
}

libsignal-service-dotnet/push/DeviceId.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ namespace libsignal.push
55
internal class DeviceId
66
{
77
[JsonProperty("deviceId")]
8-
public int NewDeviceId { get; set; }
8+
public int NewDeviceId { get; private set; }
9+
10+
public DeviceId() { }
911
}
1012
}

libsignal-service-dotnet/push/DeviceInfoList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace libsignalservice.push
77
internal class DeviceInfoList
88
{
99
[JsonProperty("devices")]
10-
public List<DeviceInfo> Devices { get; set; }
10+
public List<DeviceInfo> Devices { get; private set; }
11+
public DeviceInfoList() { }
1112
}
1213
}

libsignal-service-dotnet/push/DeviceLimit.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ namespace libsignalservice.push
66
public class DeviceLimit
77
{
88
[JsonProperty("current")]
9-
public int Current { get; set; }
9+
public int Current { get; private set; }
1010

1111
[JsonProperty("max")]
12-
public int Max { get; set; }
12+
public int Max { get; private set; }
13+
14+
public DeviceLimit() { }
1315
}
1416
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
1517
}

libsignal-service-dotnet/push/MismatchedDevices.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ namespace libsignalservice.push
88
public class MismatchedDevices
99
{
1010
[JsonProperty("missingDevices")]
11-
public List<int> MissingDevices { get; set; }
11+
public List<int> MissingDevices { get; private set; }
1212

1313
[JsonProperty("extraDevices")]
14-
public List<int> ExtraDevices { get; set; }
14+
public List<int> ExtraDevices { get; private set; }
15+
16+
public MismatchedDevices() { }
1517
}
1618
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
1719
}

libsignal-service-dotnet/push/PreKeyResponse.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ namespace libsignalservice.push
1111
internal class PreKeyResponse
1212
{
1313
[JsonProperty("devices", Order = 1)]
14-
public List<PreKeyResponseItem> Devices { get; set; }
14+
public List<PreKeyResponseItem> Devices { get; private set; }
1515

1616
[JsonProperty("identityKey", Order = 2)]
1717
[JsonConverter(typeof(IdentityKeySerializer))]
18-
public IdentityKey IdentityKey { get; set; }
18+
public IdentityKey IdentityKey { get; private set; }
19+
20+
public PreKeyResponse() { }
1921
}
2022

2123
internal class IdentityKeySerializer : JsonConverter

libsignal-service-dotnet/push/PreKeyStatus.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ namespace libsignalservice.push
55
internal class PreKeyStatus
66
{
77
[JsonProperty("count")]
8-
public int Count { get; set; }
8+
public int Count { get; private set; }
9+
10+
public PreKeyStatus() { }
911
}
1012
}

0 commit comments

Comments
 (0)