Skip to content

Commit

Permalink
fix: PCAndOther multi login policy can`t get old clients correctly (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu authored and OpenIM-Robot committed Feb 27, 2025
1 parent 8342f97 commit e1a0f59
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/msggateway/ws_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,15 @@ func (ws *WsServer) multiTerminalLoginChecker(clientOK bool, oldClients []*Clien
if constant.PlatformIDToClass(newClient.PlatformID) == constant.TerminalPC {
return
}
clients, ok := ws.clients.GetAll(newClient.UserID)
clientOK = ok
oldClients = make([]*Client, 0, len(clients))
for _, c := range clients {
if constant.PlatformIDToClass(c.PlatformID) == constant.TerminalPC {
continue
}
oldClients = append(oldClients, c)
}
fallthrough
case constant.AllLoginButSameTermKick:
if !clientOK {
Expand Down

0 comments on commit e1a0f59

Please sign in to comment.