@@ -36,11 +36,13 @@ class PeerInfoView: UIView, XibDesignable {
36
36
}
37
37
38
38
func render( result: SearchResult ) {
39
+ var identityNumber : String ?
39
40
var specializedCategory : MessageSearchResult . SpecializedCategory ?
40
41
switch result {
41
42
case let result as UserSearchResult :
42
43
let user = result. user
43
44
avatarImageView. setImage ( with: user. avatarUrl, userId: user. userId, name: user. fullName)
45
+ identityNumber = user. identityNumber
44
46
case let result as ConversationSearchResult :
45
47
let conversation = result. conversation
46
48
if conversation. isGroup ( ) {
@@ -62,13 +64,15 @@ class PeerInfoView: UIView, XibDesignable {
62
64
case . group( let conversation) :
63
65
avatarImageView. setGroupImage ( with: conversation. iconUrl)
64
66
case . user( let user) :
67
+ identityNumber = user. identityNumber
65
68
avatarImageView. setImage ( with: user. avatarUrl, userId: user. userId, name: user. fullName)
66
69
}
67
70
case let result as CircleMemberSearchResult :
68
71
let member = result. member
69
72
if member. category == ConversationCategory . GROUP. rawValue {
70
73
avatarImageView. setGroupImage ( with: member. iconUrl)
71
74
} else {
75
+ identityNumber = member. identityNumber
72
76
avatarImageView. setImage ( with: member. iconUrl, userId: member. userId ?? " " , name: member. name)
73
77
}
74
78
case let result as PhoneContactSearchResult :
@@ -94,6 +98,9 @@ class PeerInfoView: UIView, XibDesignable {
94
98
if let description = result. description {
95
99
descriptionLabel. attributedText = description
96
100
descriptionLabel. isHidden = false
101
+ } else if let identityNumber {
102
+ descriptionLabel. isHidden = false
103
+ descriptionLabel. text = identityNumber
97
104
} else {
98
105
descriptionLabel. isHidden = true
99
106
}
@@ -106,7 +113,8 @@ class PeerInfoView: UIView, XibDesignable {
106
113
badgeImageView. isHidden = badgeImageView. image == nil
107
114
superscriptLabel. text = nil
108
115
prefixIconImageView. isHidden = true
109
- descriptionLabel. isHidden = true
116
+ descriptionLabel. isHidden = false
117
+ descriptionLabel. text = user. identityNumber
110
118
}
111
119
112
120
func render( user: User , userBiographyAsSubtitle: Bool ) {
@@ -116,43 +124,51 @@ class PeerInfoView: UIView, XibDesignable {
116
124
badgeImageView. isHidden = badgeImageView. image == nil
117
125
superscriptLabel. text = nil
118
126
prefixIconImageView. isHidden = true
127
+ descriptionLabel. isHidden = false
119
128
if userBiographyAsSubtitle {
120
- descriptionLabel. isHidden = false
121
129
descriptionLabel. text = user. biography
122
130
} else {
123
- descriptionLabel. isHidden = true
131
+ descriptionLabel. text = user . identityNumber
124
132
}
125
133
}
126
134
127
135
func render( receiver: MessageReceiver ) {
128
136
switch receiver. item {
129
137
case let . group( conversation) :
138
+ descriptionLabel. isHidden = true
130
139
avatarImageView. setGroupImage ( with: conversation. iconUrl)
131
140
case let . user( user) :
141
+ descriptionLabel. isHidden = false
142
+ descriptionLabel. text = user. identityNumber
132
143
avatarImageView. setImage ( with: user. avatarUrl, userId: user. userId, name: user. fullName)
133
144
}
134
145
titleLabel. text = receiver. name
135
146
badgeImageView. image = receiver. badgeImage
136
147
badgeImageView. isHidden = badgeImageView. image == nil
137
148
superscriptLabel. text = nil
138
149
prefixIconImageView. isHidden = true
139
- descriptionLabel. isHidden = true
140
150
}
141
151
142
152
func render( member: CircleMember ) {
143
153
if member. category == ConversationCategory . GROUP. rawValue {
144
154
avatarImageView. setGroupImage ( with: member. iconUrl)
155
+ descriptionLabel. isHidden = true
145
156
} else {
146
157
avatarImageView. setImage ( with: member. iconUrl,
147
158
userId: member. userId ?? " " ,
148
159
name: member. name)
160
+ if let identityNumber = member. identityNumber {
161
+ descriptionLabel. text = identityNumber
162
+ descriptionLabel. isHidden = false
163
+ } else {
164
+ descriptionLabel. isHidden = true
165
+ }
149
166
}
150
167
titleLabel. text = member. name
151
168
badgeImageView. image = member. badgeImage
152
169
badgeImageView. isHidden = badgeImageView. image == nil
153
170
superscriptLabel. text = nil
154
171
prefixIconImageView. isHidden = true
155
- descriptionLabel. isHidden = true
156
172
}
157
173
158
174
func render( phoneContact: PhoneContact ) {
0 commit comments