mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-14 17:31:50 +08:00
kick group member add kicked notification
This commit is contained in:
parent
2dab70697c
commit
a60b584dca
@ -19,6 +19,7 @@ import (
|
||||
pbRtc "Open_IM/pkg/proto/rtc"
|
||||
"Open_IM/pkg/utils"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
promePkg "Open_IM/pkg/common/prometheus"
|
||||
@ -179,6 +180,16 @@ func MsgToSuperGroupUser(pushMsg *pbPush.PushMsgReq) {
|
||||
}
|
||||
pushToUserIDList = userIDList
|
||||
}
|
||||
if pushMsg.MsgData.ContentType == constant.SuperGroupUpdateNotification {
|
||||
m := make(map[string]bool)
|
||||
_ = json.Unmarshal(pushMsg.MsgData.Content, &m)
|
||||
if value, ok := m["kicked"]; ok {
|
||||
if value {
|
||||
pushToUserIDList = append(pushToUserIDList, pushMsg.MsgData.SendID)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
grpcCons := getcdv3.GetDefaultGatewayConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), pushMsg.OperationID)
|
||||
|
||||
|
||||
@ -277,7 +277,7 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
|
||||
}
|
||||
go func() {
|
||||
for _, v := range okUserIDList {
|
||||
chat.SuperGroupNotification(req.OperationID, v, v)
|
||||
chat.SuperGroupNotification(req.OperationID, v, v, false)
|
||||
}
|
||||
}()
|
||||
}
|
||||
@ -536,7 +536,7 @@ func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.Invite
|
||||
}
|
||||
}
|
||||
for _, v := range req.InvitedUserIDList {
|
||||
chat.SuperGroupNotification(req.OperationID, v, v)
|
||||
chat.SuperGroupNotification(req.OperationID, v, v, false)
|
||||
}
|
||||
}
|
||||
|
||||
@ -741,7 +741,7 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
|
||||
}
|
||||
go func() {
|
||||
for _, v := range req.KickedUserIDList {
|
||||
chat.SuperGroupNotification(req.OperationID, v, v)
|
||||
chat.SuperGroupNotification(req.OperationID, v, v, true)
|
||||
}
|
||||
}()
|
||||
|
||||
@ -1162,7 +1162,7 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq)
|
||||
if err := rocksCache.DelGroupMemberListHashFromCache(req.GroupID); err != nil {
|
||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), req.GroupID, err.Error())
|
||||
}
|
||||
chat.SuperGroupNotification(req.OperationID, req.OpUserID, req.OpUserID)
|
||||
chat.SuperGroupNotification(req.OperationID, req.OpUserID, req.OpUserID, false)
|
||||
}
|
||||
log.NewInfo(req.OperationID, "rpc QuitGroup return ", pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{}})
|
||||
return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{}}, nil
|
||||
|
||||
@ -9,7 +9,9 @@ import (
|
||||
//"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
func SuperGroupNotification(operationID, sendID, recvID string) {
|
||||
func SuperGroupNotification(operationID, sendID, recvID string, isKicked bool) {
|
||||
m := make(map[string]bool)
|
||||
m["kicked"] = isKicked
|
||||
n := &NotificationMsg{
|
||||
SendID: sendID,
|
||||
RecvID: recvID,
|
||||
@ -18,6 +20,8 @@ func SuperGroupNotification(operationID, sendID, recvID string) {
|
||||
SessionType: constant.SingleChatType,
|
||||
OperationID: operationID,
|
||||
}
|
||||
n.Content = utils.StructToJsonBytes(m)
|
||||
|
||||
log.NewInfo(operationID, utils.GetSelfFuncName(), string(n.Content))
|
||||
Notification(n)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user