mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-01-08 04:36:57 +08:00
Merge branch 'main' into fix-nil
This commit is contained in:
commit
99a1248a82
@ -153,7 +153,7 @@ func (u *UserApi) GetUsersOnlineTokenDetail(c *gin.Context) {
|
||||
}
|
||||
|
||||
for _, v1 := range req.UserIDs {
|
||||
m := make(map[string][]string, 10)
|
||||
m := make(map[int32][]string, 10)
|
||||
flag = false
|
||||
temp := new(msggateway.SingleDetail)
|
||||
for _, v2 := range wsResult {
|
||||
@ -162,17 +162,17 @@ func (u *UserApi) GetUsersOnlineTokenDetail(c *gin.Context) {
|
||||
temp.UserID = v1
|
||||
temp.Status = constant.OnlineStatus
|
||||
for _, status := range v2.DetailPlatformStatus {
|
||||
if v, ok := m[status.Platform]; ok {
|
||||
m[status.Platform] = append(v, status.Token)
|
||||
if v, ok := m[status.PlatformID]; ok {
|
||||
m[status.PlatformID] = append(v, status.Token)
|
||||
} else {
|
||||
m[status.Platform] = []string{status.Token}
|
||||
m[status.PlatformID] = []string{status.Token}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for p, tokens := range m {
|
||||
t := new(msggateway.SinglePlatformToken)
|
||||
t.Platform = p
|
||||
t.PlatformID = p
|
||||
t.Token = tokens
|
||||
t.Total = int32(len(tokens))
|
||||
temp.SinglePlatformToken = append(temp.SinglePlatformToken, t)
|
||||
|
||||
@ -111,7 +111,7 @@ func (s *Server) GetUsersOnlineStatus(
|
||||
}
|
||||
|
||||
ps := new(msggateway.GetUsersOnlineStatusResp_SuccessDetail)
|
||||
ps.Platform = constant.PlatformIDToName(client.PlatformID)
|
||||
ps.PlatformID = int32(client.PlatformID)
|
||||
ps.Status = constant.OnlineStatus
|
||||
ps.ConnID = client.ctx.GetConnID()
|
||||
ps.Token = client.token
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user