fix: emit channel avatar service messages
This commit is contained in:
parent
4d9f1e271d
commit
c38dd73fdd
14 changed files with 346 additions and 27 deletions
|
|
@ -349,6 +349,21 @@ type Photo struct {
|
|||
Sizes []PhotoSize `json:"sizes,omitempty"`
|
||||
}
|
||||
|
||||
func ClonePhotoPtr(photo *Photo) *Photo {
|
||||
if photo == nil {
|
||||
return nil
|
||||
}
|
||||
clone := *photo
|
||||
clone.FileReference = append([]byte(nil), photo.FileReference...)
|
||||
clone.Sizes = append([]PhotoSize(nil), photo.Sizes...)
|
||||
for i := range clone.Sizes {
|
||||
clone.Sizes[i].Bytes = append([]byte(nil), photo.Sizes[i].Bytes...)
|
||||
clone.Sizes[i].Sizes = append([]int(nil), photo.Sizes[i].Sizes...)
|
||||
clone.Sizes[i].BackgroundColors = append([]int(nil), photo.Sizes[i].BackgroundColors...)
|
||||
}
|
||||
return &clone
|
||||
}
|
||||
|
||||
// MessageMediaKind 枚举消息可挂载的媒体载荷。
|
||||
type MessageMediaKind string
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue