mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-01-11 15:32:25 +08:00
fix bug: obtain user online status err(#567)
This commit is contained in:
parent
b5e5945b61
commit
a06de3c7d7
@ -16,11 +16,10 @@ package msggateway
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
||||
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||
@ -84,6 +83,9 @@ func (s *Server) GetUsersOnlineStatus(
|
||||
ctx context.Context,
|
||||
req *msggateway.GetUsersOnlineStatusReq,
|
||||
) (*msggateway.GetUsersOnlineStatusResp, error) {
|
||||
if !tokenverify.IsAppManagerUid(ctx) {
|
||||
return nil, errs.ErrNoPermission.Wrap("only app manager")
|
||||
}
|
||||
var resp msggateway.GetUsersOnlineStatusResp
|
||||
for _, userID := range req.UserIDs {
|
||||
clients, ok := s.LongConnServer.GetUserAllCons(userID)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user