MM-10007 Send an admin and regular WS events when a user is updated (#8588)
* Add user.DeepCopy() function * Add omit admins/non-admins to WS broadcast and use for updating users * Updates per feedback and adding unit test for ShouldSendEvent
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7987c95fcd
Коммит
283f34b9c6
@@ -148,6 +148,14 @@ func GetMillis() int64 {
|
||||
return time.Now().UnixNano() / int64(time.Millisecond)
|
||||
}
|
||||
|
||||
func CopyStringMap(originalMap map[string]string) map[string]string {
|
||||
copyMap := make(map[string]string)
|
||||
for k, v := range originalMap {
|
||||
copyMap[k] = v
|
||||
}
|
||||
return copyMap
|
||||
}
|
||||
|
||||
// MapToJson converts a map to a json string
|
||||
func MapToJson(objmap map[string]string) string {
|
||||
b, _ := json.Marshal(objmap)
|
||||
|
||||
Ссылка в новой задаче
Block a user