* Added enable/disable setting and feature flag
* added rest of notifgication settings
* Added backend for content flagging setting and populated notification values from server side defaults
* WIP user selector
* Added common reviewers UI
* Added additonal reviewers section
* WIP
* WIP
* Team table base
* Added search in teams
* Added search in teams
* Added additional settings section
* WIP
* Inbtegrated reviewers settings
* WIP
* WIP
* Added server side validation
* cleanup
* cleanup
* [skip ci]
* Some refactoring
* type fixes
* lint fix
* test: add content flagging settings test file
* test: add comprehensive unit tests for content flagging settings
* enhanced tests
* test: add test file for content flagging additional settings
* test: add comprehensive unit tests for ContentFlaggingAdditionalSettingsSection
* Added additoonal settings test
* test: add empty test file for team reviewers section
* test: add comprehensive unit tests for TeamReviewersSection component
* test: update tests to handle async data fetching in team reviewers section
* test: add empty test file for content reviewers component
* feat: add comprehensive unit tests for ContentFlaggingContentReviewers component
* Added ContentFlaggingContentReviewersContentFlaggingContentReviewers test
* test: add notification settings test file for content flagging
* test: add comprehensive unit tests for content flagging notification settings
* Added ContentFlaggingNotificationSettingsSection tests
* test: add user profile pill test file
* test: add comprehensive unit tests for UserProfilePill component
* refactor: Replace enzyme shallow with renderWithContext in user_profile_pill tests
* Added UserProfilePill tests
* test: add empty test file for content reviewers team option
* test: add comprehensive unit tests for TeamOptionComponent
* Added TeamOptionComponent tests
* test: add empty test file for reason_option component
* test: add comprehensive unit tests for ReasonOption component
* Added ReasonOption tests
* cleanup
* Fixed i18n error
* fixed e2e test lijnt issues
* Updated test cases
* Added snaoshot
* Updated snaoshot
* lint fix
* WIP
* lint fix
* Added post flagging properties setup
* review fixes
* updated snapshot
* CI
* Added base APIs
* Fetched team status data on load and team switch
* WIP
* Review fixes
* wip
* WIP
* Removed an test, updated comment
* CI
* Added tests
* Added tests
* Lint fix
* Added API specs
* Fixed types
* CI fixes
* API tests
* lint fixes
* Set env variable so API routes are regiustered
* Test update
* term renaming and disabling API tests on MySQL
* typo
* Updated store type definition
* Minor tweaks
* Added tests
* Removed error in app startup when content flaghging setup fails
* Updated sync condition:
* Flag message modal basE
* added post preview
* displaying options
* Adde comment input
* Updated tests and docs
* finction rename
* WIP
* Updated tests
* refactor
* lint fix
* MOved to data migration
* lint fix
* CI
* added new migration mocks
* Used setup for tests
* some comment
* Removed unnecesseery nil check
* Form validation
* WIP tests
* WIP tests
* WIP tests
* fix: mock content flagging config selector with correct reasons format
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
* fix: add mock for getContentFlaggingConfig in flag post modal test
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
* Updated error code order in API docs
* removed empty files
* Added tests
* lint fixes
* minor tweak
* lint fix
* type fix
* fixed test
* nit
* test enhancements
* API WIP
* API WIP
* creating values
* creating content flagging channel and properties
* Able to save properties
* Added another property field
* WIP
* WIP
* Added validations
* Added data validations and hidden post if confifgured to
* lint fixes
* Added API spec
* Added some tests
* Added tests for getContentReviewBot
* test: add comprehensive tests for getContentReviewChannels function
* Added more app layer tests
* Added TestCanFlagPost
* test: Add comprehensive tests for FlagPost function
* Added all app layer tests
* Removed a file that was reamoved downstream
* test: add content flagging test file
* test: add comprehensive tests for FlagContentRequest.IsValid method
* Added model tests
* test: add comprehensive tests for SqlPropertyValueStore.CreateMany
* test: add comprehensive tests for flagPost() API function
* Added API tests
* linter fix
* WIP
* sent post flagging confirmation message
* fixed i18n nissues
* fixed i18n nissues
* CI
* Updated test
* fix: reset contentFlaggingGroupId for test isolation in content flagging tests
* removed cached group ID
* removed debug log
* review fixes
* Used correct ot name
* CI
* Updated mobile text
* Handled JSON error
* fixerdf i18n
* CI
* Integrate flag post api (#33798)
* WIP
* WIP
* Added API call
* test: add test for Client4.flagPost API call in FlagPostModal
* fix: remove userEvent.setup() from flag post modal test
* test: wrap submit button click in act for proper state updates
* Updated tests
* lint fix
* CI
* Updated to allow special characters in comments
* Handled empty comment
* Used finally
* CI
* Fixed test
* Spillage card integration (#33832)
* Created getContentFlaggingFields API
* created getPostPropertyValues API
* WIP
* Created useContentFlaggingFields hook
* WIP
* WIP
* Added option to retain data for reviewers
* Displayed deleted post's preview
* DIsplayed all properties
* Adding field name i18n
* WIP - managing i18n able texts
* Finished displaying all fields
* Manual cleanup
* lint fixes
* team role filter logic fix
* Fixed tests
* created new API to fetch flagged posts
* lint fix
* Added new client methods
* test: add comprehensive tests for content flagging APIs
* Added new API tests
* fixed openapi spec
* Fixed DataSpillageReport tests
* Fixed PostMarkdown test
* Fixed PostPreviewPropertyRenderer test
* Added metadata to card renderer
* test fixes
* Added no comment placeholder
* Fixed test
* refactor: improve test mocking for data spillage report component
* test mock updates
* Updated reducer
* not resetting mocks
* WIP
* review fixes
* CI
* Fixed
* fixes
* Content flagging actions implementation (#33852)
* Added view detail button
* Created RemoveFlaggedMessageConfirmationModal modal
* Added key and remove flag request modal
* IMplemented delete flagged post
* Handled edge cases of deleting flagged post
* keep message
* UI integration
* Added WS event for post report update and handled deleted files of flagged post
* Added error handling in keep/remove forms
* i18n fixes
* Updated OpenAPI specs
* fixed types
* fixed types
* refactoring
* Fixed tests
* review fixes
* Added new property translations
* Improved test
* fixed test
* CI
* fixes
* CI
* fixed a test
* CI
---------
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
* Standardize request.CTX parameter naming to rctx
- Migrate 886 request.CTX parameters across 147 files to use consistent 'rctx' naming
- Updated function signatures from 'c', 'ctx', and 'cancelContext' to 'rctx'
- Updated function bodies to reference the new parameter names
- Preserved underscore parameters unchanged as they are unused
- Fixed method receiver context issue in store.go
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Use request.CTX interface in batch worker
* Manual fixes
* Fix parameter naming
* Add linter check
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Adds support for GMs in shared channels
* Fix linter
* Remove creatorID from slack call
---------
Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
* Upgrade Go to 1.24.3
Updates the following files:
- server/.go-version: 1.23.9 → 1.24.3
- server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye
- server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3
- server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3
Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking:
- Added response() helper function in slashcommands/util.go for simple string responses
- Removed unused responsef() function from slashcommands/util.go
- Replaced responsef() with response() for translated strings that don't need formatting
- Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation
- Updated marketplace buildURL to handle format strings conditionally
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update generated mocks for Go 1.24.3
Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3.
This addresses mock generation failures that occurred with the Go upgrade.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update to bookworm and fix non-existent sha
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
* fix non-constant format string
---------
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Stavros Foteinopoulos <stafot@gmail.com>
* Adds direct participants to the channel invite
The channel invite now contains the sanitized users that are local to
the node that is sending the invite. In the event that the receiving
server doesn't have those users in its local database, it can create
them from the invite and correctly generate the DM or GM with them as
members.
* Use IsRemote instead of directly checking user attributes
---------
Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Co-authored-by: Mattermost Build <build@mattermost.com>
* Updated patch/update post API to allow file modification (#29447)
* WIP
* WIP
* Atatched new files ton post
* WIP: deleting removed files
* Deleted removed files and invalidated file metadata cache
* removed file ignore logif from update post API
* Added TestFindExclusives
* Added tests for DeleteForPostByIds
* Added app layer tests
* Added tests
* Added API level tests
* test enhancements
* Fixed a test
* Edit history include file metadata (#29505)
* Send file metadata in edit history metadata
* Added app tests
* Added store tests
* Added tests for populateEditHistoryFileMetadata{
* Added cache to avoid repetitigve DB calls for edits with only message changes
* Added API tests
* i18m fix
* removed commented code
* Improved test helper
* Show attachments in edit history RHS (#29519)
* Send file metadata in edit history metadata
* Added app tests
* Added store tests
* Added tests for populateEditHistoryFileMetadata{
* Added cache to avoid repetitigve DB calls for edits with only message changes
* Added API tests
* i18m fix
* WIUP: displa files in edit
* removed commented code
* Displayed file in edit history
* Handled file icon
* Fixed closing history component on clicking on file
* Simplified selector
* Simplified selector
* Improved test helper
* Disabled action menu on edit history file
* Added tests
* Improved selector
* Updated snapshot
* review Fixes
* restructured componnets
* Updated test
* Updated test
* Restore post api (#29643)
* Restore post version API WIP
* Undelete files WIP
* Added store tests
* Created post restore API
* Updated updatepost safeUpdate signature
* review fixex and improvements
* Fixed an app test
* Added API laer tests
* Added API tests and OpenAPI specs
* Fixed a typo
* Allow editing files when editing posts (#29709)
* WIP - basic view files when editing post
* Cleanup
* bg color
* Added text editor tests for files
* WIP
* WIP
* removed debug log
* Allowed admin to add and remove files on someone else's post
* Handled drafts and scheduled posts
* linter fixes
* Updated snapshot
* server test fix
* CI
* Added doc
* Restore post api integration (#29719)
* WIP - basic view files when editing post
* Cleanup
* bg color
* Added text editor tests for files
* WIP
* WIP
* removed debug log
* Allowed admin to add and remove files on someone else's post
* Handled drafts and scheduled posts
* linter fixes
* Updated snapshot
* server test fix
* Used new API to restore post
* handled edut limit and undo
* lint fix
* added comments
* Fixed edit post item tests
* Fixed buttons
* Aded snapshots
* fix test
* Updated snapshot
* Minor fixes
* fixed snapshot
* Edit file dnd area (#29763)
* dnd wip
* DND continued
* Supported multiple unbind dragster funcs
* lint fixes
* Got center channel file drop working when editing a post
* file dnd working with center channel and rhs
* file dnd working with center channel and rhs
* removed unneeded stopPropogation calls
* cleanup
* DND overlay fix
* Lint fix
* Advanced text editor test updates for file upload overlay
* fixed use upload hook tests
* Updated some more snapshots
* minor cleanup
* Updated i18n
* removed need of array for dragster unbind events
* lint fixes
* edit history cursor
* Fixed bugu causing faliure to delete empty posts (#29778)
* Files in restore confirmation (#29781)
* Added files to restore post confirmation dialog
* Fixed post restore toast colors
* Fixed restore bug
* Fixed restore confirmation toast tests
* a11y improvement and modal width fix
* Edit attachment misc fixes (#29808)
* Removed single image actions in restore post confirmation dialog
* Fixed file drop overlay size and position
* Made edit indiator accessible
* Lint fix
* Added bunch of more tests
* ANother test migrated from enzyme to react testing library
* More test enhancements
* More test enhancements
* More test enhancements
* lint fixes
* Fixed a test
* Added missing snapshots
* Test fixes
* Forbid users from creating DMs and GMs with remote users
This change prevents the application from creating new DMs and GMs
when remote users are involved, and prevents as well new posts from
being created into preexisting DMs and GMs with remote users created
in previous versions.
* Adds i18n
* Skip preexisting DM tests and create a new one for the new behavior
* Changes the event to send when a channel is shared or unshared
Before we were sending the CHANNEL_CONVERTED websockets event, which
is intended to notify of a public channel being converted into a
private one, so the interface was showing the channel as private until
the client was refreshed.
Now a full channel update event is sent when the channel is shared or
unshared, so the interface gets the new information correctly.
* Fix message type on command tests
* Allows invites to be sent to offline remotes
Invites sent to remotes marked as offline will be stored as pending,
and when the remote comes back online, it will process the invites as
part of the synchronization process.
* Update condition name for excluding confirmed invites
* Adds logical deletes to shared channel remotes and remote clusters
Instead of physically deleting the shared channel remote and remote
clusters records when a channel is unshared, a remote uninvited or a
remote cluster is deleted, now those have a logical `DeleteAt` field
that is set.
This allows us to safely restore shared channels between two remote
clusters (as of now resetting the cursor without backfilling their
contents) and to know which connections were established in the past
and now are severed.
* Delete the index in remoteclusters before adding the new column
* Fix bad error check
* Adds status sync to shared channels
To allow for status to be synced, this changes add a new type of
shared channel internal task. This task has its contents pre-fetched
and stored in the `existingMsg` property, and it is keyed with a user
ID besides a channel ID, so it doesn't conflict with channel-driven
synchronization tasks.
All status synchronizations are triggered from the app layer, so there
is no need of watching for new WebSocket events. Although right now
we're only syncing one user status per message, the changes account
for a list of statuses in case we want to batch them in the future.
The feature is gated by a configuration property and can be disabled
independently of the rest of Shared Channels if it's necessary. It is
backwards compatible as well, and should cause no problems with
servers running older Mattermost versions.
* Adds status sync error management and retry
* Adds DisableSharedChannelsStatusSync to the telemetry report
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Adds Shared Channel management API endpoints
New endpoints for the following routes are added:
- Get Shared Channel Remotes by Remote Cluster at `GET
/api/v4/remotecluster/{remote_id}/sharedchannelremotes`
- Invite Remote Cluster to Channel at `POST
/api/v4/remotecluster/{remote_id}/channels/invite`
- Uninvite Remote Cluster to Channel at `POST
/api/v4/remotecluster/{remote_id}/channels/uninvite`
These endpoints are planned to be used from the system console, and
gated through the `manage_secure_connections` permission.
* Adds i18n messages for API errors
* Fix pagination flaky test
* Fix linter
* Adds the posibility of filtering shared channel remotes by home
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Adds default team to the remote cluster entity
A new DefaultTeamId field is added to the RemoteCluster entity and its
endpoints, and used when receiving channel invites to choose in which
team to create a new channel.
This will be later extended with the ability for the system admin to
manually accept invites, choosing which team to create the channel on
each. This use case will be triggered when the DefaultTeamId field is
empty, which now simply chooses the first team it finds in the
database as a fallback.
* Fix migrations list
* Fixes channelinvite test case
* Fix i18n
* Fix migration list
* Adds Remote Cluster related API endpoints
New endpoints for the following routes are added:
- Get Remote Clusters at `GET /api/v4/remotecluster`
- Create Remote Cluster at `POST /api/v4/remotecluster`
- Accept Remote Cluster invite at `POST
/api/v4/remotecluster/accept_invite`
- Generate Remote Cluster invite at `POST
/api/v4/remotecluster/{remote_id}/generate_invite`
- Get Remote Cluster at `GET /api/v4/remotecluster/{remote_id}`
- Patch Remote Cluster at `PATCH /api/v4/remotecluster/{remote_id}`
- Delete Remote Cluster at `DELETE /api/v4/remotecluster/{remote_id}`
These endpoints are planned to be used from the system console, and
gated through the `manage_secure_connections` permission.
* Update server/channels/api4/remote_cluster_test.go
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
* Fix AppError names
---------
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Mattermost Build <build@mattermost.com>
* Sanitize RemoteEmail user prop
If the server is configured to hide user emails, the "RemoteEmail"
user property will be sanitized as well, effectively hiding the real
email of remote users.
* fix merge conflict
---------
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
Co-authored-by: Mattermost Build <build@mattermost.com>
* Marks the RemoteTeamId field of RemoteClusters as deprecated
The `RemoteTeamId` was used both in the `RemoteCluster` model and as
part of remote invites. It existed so two different remotes could have
multiple secure connections between them, and have each of those
connections scoped to a team, sharing through each only the channels
that belong to their corresponding team.
The way that we're thinking on the feature currently only contemplates
one secure connection between two servers, and shares all the
channels through that secure connection, so this field is no longer
needed.
As we don't have a system in place for the user to choose in which
team a channel should be created from an invite, this change adds a
mechanism that checks the invite for a teamId, and if it's not
present, fetches a team from the database to create the channel
into. This makes the change backwards compatible for secure
connections that already have an established behavior and allows us to
move forward with the implementation of an alternative.
* Mark invite teamId field as deprecated
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* check user visibility when accepting channel invites for DMs
* stronger visibility checking for DM users
* check for correct remoteid for remote user in DM invite
* fix unit test
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* - ensure that posts and reactions can only be added via sync when coming from a remote that the target channel is shared with.
- ensure that posts and reactions are only modified/deleted by the remote that owns them.
* check that reaction belongs to post that belongs to channel that is shared with remote; check that posts belong to channel shared with remote
* check for correct error type in unit test
* tweak unit test
* - ensure new users get correct remoteID
- ensure remotes can only update users belonging to them
- ensure user remoteIDs cannot be changed once set
* make modules-tidy
---------
Co-authored-by: Mattermost Build <build@mattermost.com>