Skip to content

Commit c39405f

Browse files
committedOct 15, 2020
fix to support latest theme response
1 parent 9b49cca commit c39405f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
 

‎testdata/v1/get-my-profile.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
"updatedAt": "2018-10-29T03:01:43Z"
1313
},
1414
"lang": "en-US",
15-
"theme": "light",
15+
"theme": {
16+
"source": "typetalk",
17+
"name": "light"
18+
},
1619
"post": {
1720
"useCtrl": false,
1821
"emojiSkinTone": "skin-tone-4"
1922
}
20-
}
23+
}

‎typetalk/v1/accounts.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ type Account struct {
2727
ImageUpdatedAt *time.Time `json:"imageUpdatedAt"`
2828
}
2929

30+
// Theme represents the appearance information used in Typetalk.
31+
type Theme struct {
32+
Source string `json:"source"`
33+
Name string `json:"name"`
34+
}
35+
3036
// Status represents online status of the user.
3137
type Status struct {
3238
Presence *string `json:"presence"`
@@ -47,7 +53,7 @@ type Profile AccountStatus
4753
type MyProfile struct {
4854
Account *Account `json:"account"`
4955
Lang string `json:"lang"`
50-
Theme string `json:"theme"`
56+
Theme *Theme `json:"theme"`
5157
Post *struct {
5258
UseCtrl bool `json:"useCtrl"`
5359
EmojiSkinTone string `json:"emojiSkinTone"`

0 commit comments

Comments
 (0)