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