mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-16 19:19:23 +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 {
|
||||
onlineStatus.Status = constant.Online
|
||||
for _, val := range status.PlatformIDs {
|
||||
onlineStatus.PlatformIDs = append(onlineStatus.PlatformIDs, val)
|
||||
// Judging whether to be kicked out.
|
||||
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)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user