mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-17 19:47:06 +08:00
Judging whether to be kicked out
This commit is contained in:
parent
d7048d3fc8
commit
41480cedbc
12
pkg/common/db/cache/user.go
vendored
12
pkg/common/db/cache/user.go
vendored
@ -269,8 +269,16 @@ func (u *UserCacheRedis) SetUserStatus(ctx context.Context, list []*user.OnlineS
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
onlineStatus.Status = constant.Online
|
onlineStatus.Status = constant.Online
|
||||||
for _, val := range status.PlatformIDs {
|
// Judging whether to be kicked out.
|
||||||
onlineStatus.PlatformIDs = append(onlineStatus.PlatformIDs, val)
|
flag := false
|
||||||
|
for _, val := range onlineStatus.PlatformIDs {
|
||||||
|
if val == status.PlatformIDs[0] {
|
||||||
|
flag = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !flag {
|
||||||
|
onlineStatus.PlatformIDs = append(onlineStatus.PlatformIDs, status.PlatformIDs[0])
|
||||||
}
|
}
|
||||||
newjsonData, err := json.Marshal(&onlineStatus)
|
newjsonData, err := json.Marshal(&onlineStatus)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user