* fix an user import issue where the user roles were overwritten
* reflect review comments
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Added expiry support in custom status APIs (#11)
* Added expiry support in custom status APIs
Added validation for the duration and expiration time in request body
Made enum for the custom status durations
* Fixed the bug in expiry validation with dont clear validation
* Fixed review comments
Converted the durations enum to map
Removed extra if-else
* Added expiry support in custom status slash command (#17)
* Added expiry support in custom status slash command
* Added the check for timezone enabled in expiry time in custom status slash command
* Review fixes
Changed name of calculateExpriryTime to calculateEndOfDay
Made function SetDefaultEmoji for settting default emoji in set custom status API
* Added support for empty duration in custom status APIs
Made one of emoji and text required and duration optional in set custom status API
Made default duration dont clear in both API and slash command
* Changed value of ExpiresAt field in custom status slash command
* Code refactoring
Combined SetDefaults and TrimMessage into 1 function PreSave
Refactored isExpirationTimeValid function
* Used model variables instead of new variables in custom status slash command
* Modified behaviour of set custom status APIs (#19)
Removed dont_clear from validCustomStatusDuration map
Added logic to set duration custom date/time if only expires_at is specified in the body
Made function AreDurationAndExpirationTimeValid in custom status model
* Trigger CI build
* Add a controller for changing subscription
* Changes for PR
* Another change
* Fix pipeline
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Added logic to detect and set unicode emoji in the custom status slash command
* Replaced strings.split with strings.Fields
* Added logic to handle empty string as message in custom status slash command
* Changed custom status slash command empty message behavior to set def… (#14)
* Changed custom status slash command empty message behavior to set default emoji
* Code refactoring
* Added unit tests and refactored some code
* WIP: Unit tests and refactoring for detecting unicode emoji in custom status slash commands
* Complete unit testing for Get custom status
* Fixed lint
* Added logic for removing skin tone from unicode emoji (#16)
* Added logic for removing skin tone from unicode emoji
Made a reverse system emojis map of string vs []string and stored the emojiNames in sorted order
Added the logic for detecting and replacing/removing skin tone in unicode emoji with variation selector
Added new unit tests with different skin tone emojis
* Refactored removeSkinTone logic to a separate function
* Added check for emoji before removing skin tone in custom status slash command
* Fixed custom status slash command unit test and refactored some code
Chanded the return type of GetEmojiNameFromUnicode from bool to int
Changed the logic for checking presence of emoji without removing skin tone
Fixed the unit tests
* Review fixes: Indentation changes
* MM-35945: handle lots of files in ExtractTarGz
`ExtractTarGz` can fail on archives with a largish number or files, complaining about too many open file handles. Clean up as we go to avoid this.
Fixes: https://mattermost.atlassian.net/browse/MM-35945
* use closure to allow defer
* check authdata for different format
* add mocks, fix lint
* rename function
* update auth-data with new format
* update assert
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Replace config generator
* Cleanup
* Some renaming and docs additions to add clarity
* Cleanup logging related methods
* Cleanup emitter
* Fix TestDefaultsGenerator
* Move feature flags synchronization logic out of config package
* Remove unnecessary util functions
* Simplify load/set logic
* Refine semantics and add some test to cover them
* Remove unnecessary deep copies
* Improve logic further
* Fix license header
* Review file store tests
* Fix test
* Fix test
* Avoid additional write during initialization
* More consistent naming
* Update app/feature_flags.go
Co-authored-by: Christopher Speller <crspeller@gmail.com>
* Update config/store.go
Co-authored-by: Christopher Speller <crspeller@gmail.com>
* Update config/store.go
Co-authored-by: Christopher Speller <crspeller@gmail.com>
* Update config/store.go
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
* Make ConfigStore.Set() return both old and new configs
* Implement config diff function
* Make app.SaveConfig return previous and current configs
* Add config diff to audit record
* Fix returned configs
* Include high level test
* Move FF synchronizer to its own package
* Remove unidiomatic use of sync.Once
* Add some comments
* Rename function
* More comment
* Save config diff in audit record for local endpoints
* Enable audit for config set/reset commands
* Improve tests output
Co-authored-by: Christopher Speller <crspeller@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
We identified that sometimes the redirection to the right link is broken
so we want to be sure that our users will end up in the right place.
Issue: https://mattermost.atlassian.net/browse/MM-35893
* restrict creation of direct channels to team members
* run make i18n-extract
* add suggestions from hahmadia
* place common-team-check logic in app layer
* use flat SQL query
* show more specific error message to user
* MM-7968: Fmt file.
* MM-7968: Fix for moved session field.
Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Martin Kraft <martinkraft@gmail.com>
Co-authored-by: Martin Kraft <martin@upspin.org>
* Replace config generator
* Cleanup
* Some renaming and docs additions to add clarity
* Cleanup logging related methods
* Cleanup emitter
* Fix TestDefaultsGenerator
* Move feature flags synchronization logic out of config package
* Remove unnecessary util functions
* Simplify load/set logic
* Refine semantics and add some test to cover them
* Remove unnecessary deep copies
* Improve logic further
* Fix license header
* Review file store tests
* Fix test
* Fix test
* Avoid additional write during initialization
* More consistent naming
* Update app/feature_flags.go
Co-authored-by: Christopher Speller <crspeller@gmail.com>
* Update config/store.go
Co-authored-by: Christopher Speller <crspeller@gmail.com>
* Update config/store.go
Co-authored-by: Christopher Speller <crspeller@gmail.com>
* Update config/store.go
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
* Move FF synchronizer to its own package
* Remove unidiomatic use of sync.Once
* Add some comments
* Rename function
* More comment
Co-authored-by: Christopher Speller <crspeller@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
* Fix cluster leader change message potentially getting lost
* Start jobs and schedulers earlier in server initialization
* Fix possible deadlock
* Update jobs/schedulers.go
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
* add request context
* move initialialization to server
* use app interface instead of global app functions
* remove app context from webconn
* cleanup
* remove duplicated services
* move context to separate package
* remove finalize init method and move content to NewServer function
* restart workers and schedulers after adding license for tests
* reflect review comments
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>