MM-56083 Add PatchMultipleMembersNotifyProps plugin API (#25690)

* Add ChannelStore.UpdateMultipleMembersNotifyProps

* Make UpdateMultipleMembersNotifyProps return updated values from the DB

* Add UpdateChannelMembersNotifications plugin API

* Extract i18n

* Fix style

* Make layers

* Change to PatchMultipleMembersNotifyProps

* Add limit to PatchChannelMembersNotifyProps

* Add additional unit tests

* Address feedback

* Lowercase decodeJSON

* Have PatchMultipleMembersNotifyProps update LastUpdateAt

* Fix tests that relied on unreliable return order

* Fix i18n
Этот коммит содержится в:
Harrison Healey
2024-01-11 13:24:52 -05:00
коммит произвёл GitHub
родитель aafe7439af
Коммит 4d96c11314
21 изменённых файлов: 780 добавлений и 37 удалений

Просмотреть файл

@@ -1950,6 +1950,22 @@ func (s *TimerLayerChannelStore) MigrateChannelMembers(fromChannelID string, fro
return result, err
}
func (s *TimerLayerChannelStore) PatchMultipleMembersNotifyProps(members []*model.ChannelMemberIdentifier, notifyProps map[string]string) ([]*model.ChannelMember, error) {
start := time.Now()
result, err := s.ChannelStore.PatchMultipleMembersNotifyProps(members, notifyProps)
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if err == nil {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.PatchMultipleMembersNotifyProps", success, elapsed)
}
return result, err
}
func (s *TimerLayerChannelStore) PermanentDelete(ctx request.CTX, channelID string) error {
start := time.Now()