Skip to content

Commit 12f694f

Browse files
icey-yuOpenIM-Robot
authored andcommitted
fix: PCAndOther multi login policy can`t get old clients correctly (#3158)
1 parent 4b3a2b7 commit 12f694f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/msggateway/ws_server.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,15 @@ func (ws *WsServer) multiTerminalLoginChecker(clientOK bool, oldClients []*Clien
353353
if constant.PlatformIDToClass(newClient.PlatformID) == constant.TerminalPC {
354354
return
355355
}
356+
clients, ok := ws.clients.GetAll(newClient.UserID)
357+
clientOK = ok
358+
oldClients = make([]*Client, 0, len(clients))
359+
for _, c := range clients {
360+
if constant.PlatformIDToClass(c.PlatformID) == constant.TerminalPC {
361+
continue
362+
}
363+
oldClients = append(oldClients, c)
364+
}
356365
fallthrough
357366
case constant.AllLoginButSameTermKick:
358367
if !clientOK {

0 commit comments

Comments
 (0)