修改GetUserPhoto API请求的参数

This commit is contained in:
2018-12-17 11:31:12 +08:00
parent 98bed05764
commit a7440380c8
3 changed files with 53 additions and 12 deletions
+8 -1
View File
@@ -256,8 +256,15 @@ func (session *Session) GetUserPhotoHandler(headInfo map[string]string) {
head := make(map[string]string)
head[keyname_token] = headInfo[keyname_token]
head[keyname_operation] = headInfo[keyname_operation]
head["Length"] = "0"
head["Error"] = ""
photo := GetUserPhoto(session.sender.User)
var photo []byte
if username, ok := headInfo["User"]; ok {
photo = GetUserPhoto(username)
} else {
photo = GetUserPhoto(session.sender.User)
}
head["Length"] = string(len(photo))
session.SendData(head, photo)
}