Document that badge expiration and visibility are only set for self

The Signal server filters out hidden and expired badges for other
people's profiles and doesn't send these two values for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DoakyandClaude Opus 5.5 committed 2026-11-08 17:44:51 -05:00
1 parent a37f75b831
commit c1fad7e883
4 files changed
+17 -8

No files matched your search

+6 -4
View File
@@ -230,10 +230,12 @@ type ListInstalledStickerPacksResponse struct {
}
type ProfileBadge struct {
Id string `json:"id"`
Category string `json:"category"`
ExpirationTimestamp *int64 `json:"expiration_timestamp"`
Visible bool `json:"visible"`
Id string `json:"id"`
Category string `json:"category"`
// Milliseconds since the epoch. Signal only discloses this for the account's own profile, so it is null for other contacts.
ExpirationTimestamp *int64 `json:"expiration_timestamp" extensions:"x-nullable=true"`
// Signal only discloses this for the account's own profile, so it is false for other contacts, whose badges are always displayed ones.
Visible bool `json:"visible"`
}
type ContactProfile struct {
+3 -2
View File
@@ -6,8 +6,9 @@ import (
)
// TestSignalCliProfileBadgesToProfileBadges verifies that the badges of signal-cli's
// `listContacts` output are carried through to the REST response, including badges
// without an expiration.
// `listContacts` output are carried through to the REST response, both in the shape
// of the account's own badge and of another contact's, which has no expiration and
// is reported as not visible.
func TestSignalCliProfileBadgesToProfileBadges(t *testing.T) {
const sampleBadgesJSON = `[
{"id": "BOOST", "category": "donor", "expirationTimestamp": 1767225600000, "visible": true},
+4 -1
View File
@@ -1027,12 +1027,15 @@ const docTemplate = `{
"type": "string"
},
"expiration_timestamp": {
"type": "integer"
"description": "Milliseconds since the epoch. Signal only discloses this for the account's own profile, so it is null for other contacts.",
"type": "integer",
"x-nullable": "true"
},
"id": {
"type": "string"
},
"visible": {
"description": "Signal only discloses this for the account's own profile, so it is false for other contacts, whose badges are always displayed ones.",
"type": "boolean"
}
},
+4 -1
View File
@@ -1022,12 +1022,15 @@
"type": "string"
},
"expiration_timestamp": {
"type": "integer"
"description": "Milliseconds since the epoch. Signal only discloses this for the account's own profile, so it is null for other contacts.",
"type": "integer",
"x-nullable": "true"
},
"id": {
"type": "string"
},
"visible": {
"description": "Signal only discloses this for the account's own profile, so it is false for other contacts, whose badges are always displayed ones.",
"type": "boolean"
}
},