Browse Source

屏蔽动态中的fullname信息

tags/v1.22.1.4
ychao_1983 3 years ago
parent
commit
b5007602ec
1 changed files with 13 additions and 13 deletions
  1. +13
    -13
      services/socketwrap/clientManager.go

+ 13
- 13
services/socketwrap/clientManager.go View File

@@ -50,13 +50,7 @@ func (h *ClientsManager) Run() {
} }
case message := <-models.ActionChan: case message := <-models.ActionChan:
if isInOpTypes(opTypes, message.OpType) { if isInOpTypes(opTypes, message.OpType) {
message.Comment = nil
message.ActUser.Email = ""
message.ActUser.Passwd = ""
message.ActUser.PasswdHashAlgo = ""
message.ActUser.PrivateKey = ""
message.ActUser.PublicKey = ""
message.ActUser.Salt = ""
filterUserPrivateInfo(message)
LastActionsQueue.Push(message) LastActionsQueue.Push(message)
for _, client := range h.Clients.Keys() { for _, client := range h.Clients.Keys() {
select { select {
@@ -101,12 +95,7 @@ func initActionQueue() {
user, err := models.GetUserByID(actions[i].UserID) user, err := models.GetUserByID(actions[i].UserID)
if err == nil { if err == nil {
if !user.IsOrganization() { if !user.IsOrganization() {
actions[i].ActUser.Email = ""
actions[i].ActUser.Passwd = ""
actions[i].ActUser.PasswdHashAlgo = ""
actions[i].ActUser.PrivateKey = ""
actions[i].ActUser.PublicKey = ""
actions[i].ActUser.Salt = ""
filterUserPrivateInfo(actions[i])
LastActionsQueue.Push(actions[i]) LastActionsQueue.Push(actions[i])
} }


@@ -115,3 +104,14 @@ func initActionQueue() {
} }
} }
} }

func filterUserPrivateInfo(action *models.Action) {
action.Comment = nil
action.ActUser.Email = ""
action.ActUser.Passwd = ""
action.ActUser.PasswdHashAlgo = ""
action.ActUser.PrivateKey = ""
action.ActUser.PublicKey = ""
action.ActUser.Salt = ""
action.ActUser.FullName = ""
}

Loading…
Cancel
Save