mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-01-09 13: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 {
|
for _, v1 := range req.UserIDs {
|
||||||
m := make(map[string][]string, 10)
|
m := make(map[int32][]string, 10)
|
||||||
flag = false
|
flag = false
|
||||||
temp := new(msggateway.SingleDetail)
|
temp := new(msggateway.SingleDetail)
|
||||||
for _, v2 := range wsResult {
|
for _, v2 := range wsResult {
|
||||||
@ -162,17 +162,17 @@ func (u *UserApi) GetUsersOnlineTokenDetail(c *gin.Context) {
|
|||||||
temp.UserID = v1
|
temp.UserID = v1
|
||||||
temp.Status = constant.OnlineStatus
|
temp.Status = constant.OnlineStatus
|
||||||
for _, status := range v2.DetailPlatformStatus {
|
for _, status := range v2.DetailPlatformStatus {
|
||||||
if v, ok := m[status.Platform]; ok {
|
if v, ok := m[status.PlatformID]; ok {
|
||||||
m[status.Platform] = append(v, status.Token)
|
m[status.PlatformID] = append(v, status.Token)
|
||||||
} else {
|
} else {
|
||||||
m[status.Platform] = []string{status.Token}
|
m[status.PlatformID] = []string{status.Token}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for p, tokens := range m {
|
for p, tokens := range m {
|
||||||
t := new(msggateway.SinglePlatformToken)
|
t := new(msggateway.SinglePlatformToken)
|
||||||
t.Platform = p
|
t.PlatformID = p
|
||||||
t.Token = tokens
|
t.Token = tokens
|
||||||
t.Total = int32(len(tokens))
|
t.Total = int32(len(tokens))
|
||||||
temp.SinglePlatformToken = append(temp.SinglePlatformToken, t)
|
temp.SinglePlatformToken = append(temp.SinglePlatformToken, t)
|
||||||
|
|||||||
@ -111,7 +111,7 @@ func (s *Server) GetUsersOnlineStatus(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ps := new(msggateway.GetUsersOnlineStatusResp_SuccessDetail)
|
ps := new(msggateway.GetUsersOnlineStatusResp_SuccessDetail)
|
||||||
ps.Platform = constant.PlatformIDToName(client.PlatformID)
|
ps.PlatformID = int32(client.PlatformID)
|
||||||
ps.Status = constant.OnlineStatus
|
ps.Status = constant.OnlineStatus
|
||||||
ps.ConnID = client.ctx.GetConnID()
|
ps.ConnID = client.ctx.GetConnID()
|
||||||
ps.Token = client.token
|
ps.Token = client.token
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user