* Add notification, to sysadmins, when a user is disabled and the user
owns bots.
* If the user doesn't have any bots, there is no need to send a
notifcation to sysadmins
* Remove comment
* Update documention link
* Send as System
* Query teams for each sysadmin and add first response to hardcoded link.
* Remove fmt.print debug statements
* remove link with hard-coded team. Will add this as future enhancement
Expose GetDisableBotSysadminMessage function so it can be tested
Add test new function for testing new notification feature
* Fix shadow error
* Swap sentences in the message when System Console > Bot Accounts > Disable bot accounts when owner is deactivated: is set to false
* Another message correction
* Rename Custom Integrations to Integrations
* rename botsDisabled variable to disableBotsSetting
* - increase the number of bots and sysadmins queried to 1000.
- limit the number of bots printed in the post to 10, but mention the
total bots owned by the user
* Enable translations for sysadmin messages
* - Rename function. The actual purpose for the function is to notify
sysadmins that a user, that owned bots, was disabled.
- convert GetDisableBotSysadminMessage from a function to a method.
This allows getting *a.Config().ServiceSettings.DisableBotsWhenOwnerIsDeactivated
in the method and avoids having to pass the value as an input to a
function
* fix "make i18n-extract" error. Reorganize .json file
* Correct the upper range value to be the minimum of number of elements in the
userBots array, or the upper limit (10)
* replace t.fatal with require statements
fix golangci-lint errors
* Create separate message when user managed less than or fewer than 10 bots
Test cases for both message types
* fix i18n sorting
* Using pagination to get the bots and sysadmins instead of setting
arbitrary value for PerPage and only retrieving first page
* only use one translation ID for the message.
push all logic into the template so translators can view the logic
add disableBotsSetting and printAllBots variables to the translation
map
* Break the for loop once len(bots) < perPage value, instead of
breaking once there are no bots. This saves one additional call
* Consistent license message for all the go files
* Fixing the last set of unconsistencies with the license headers
* Addressing PR review comments
* Fixing busy.go and busy_test.go license header
* Add ability to get bot counts per day
Modify tests using AnalyticsPostCountsByDay to include extra input
(botsOnly)
Correctly generate the mock file with 'make store-mocks' target. Didn't
see these comments earlier
* Initial commit for calculating total posts previous day and total posts
from bots previous day
* - Refactor to use asserts instead of if statements in tests
- Capture inputs to AnalyticsPostCountsByDay() function into an
options struct
- Remove bot creation from diagnostics_test.go.
* Remove utils library
* create AnalyticsPostCountsOptions struct which is accepted as an input
to AnalyticsPostCountsByDay method
* Go vet fixes
* MM-2954
* Added new const post type for /me commands
* Modified me command to return response text without *__* wrapper
* Modified unit test for MeCommand to reflect changes
* Added unit test for the me command provider
* * Reverted change to text property in me command response
* Added original message in me command response props
* Updated unit tests
* gofmt changes
* Set EditAt for FileIds and Attachments; Disallow update/patch of FileIds in API Handler
* Add custom comparison methods for StringArray and Post Attachments
* gofmt
* Split up comparison function to child structs
* Naming consistency
* gofmt
* transplant the existing PR into the working tree
* start addressing review comments
* move existing direct channel export code into this branch
* modify channel exporter to use squirell and populate members in two steps
* use squirrel to build sql queries for channel and dm/gm export methods
* remove debug helpers and use Username instead of UserId
* unit test for DM Channel exporter
* add more unit tests for channel export
* add test for DM/GM post export
* checkpoint with failing test for postgres
* use getQueryBuilder to make sure squirrel uses the correct formatting
for each database
* add a test for post export
* fix shadowed vars that broke the build
* address review comments and add tests to support it
* address review comments and add a mlog call
* s/Info/Debug/
* address review comments in post_store
* address review comments in channel_store
* address review comments in export
* address review comment in post_store: drop GroupBy
* address review comment on supplier: move getQueryBuilder to sqlstore
* address review comments: explicit TearDown
* address review comments: improve test coverage
* address review comments: make sure public and private channels are excluded
* address review comments: improve test coverage
* address review comments: make sure Channels table gets truncated after
each test
* more cleanups and better assertions
* wrap PostStore in a StoreTestWithSqlSupplier
* last minute changes: improve post export test coverage and check members
* address review comments: make sure all posts have their channel
members set
* address review comments: make sure all posts have their ChannelMembers
exported correctly
* gofmt fix
* sort channels so it's possible to assert on index
* MM-13718 Prevent files from being attached to multiple posts
* Switch back to non-batched AttachToPost
* Change status code when failing to attach a file
* Add interactive dialogs
* Fix unit test
* Updates per feedback
* Fix typo
* Updates per feedback, add icon_url and error returns
* Updates per feedback
* Update per feedback
* MM-11868/MM-12010/MM-12011/MM-12036 Include dimensions for opengraph and message attachment images in post metadata
* Remove duplicate check from getFirstLinkAndImages
* Add tests for getImagesInMessageAttachments
* Rename PostMetadata.FileInfos to PostMetadata.Files
* Rename Metadata.ImageDimensions to Metadata.Images
* Move OpenGraph code into its own file
* Move OpenGraph image proxying to app layer
* Move test file code out of api4 package
* MM-11272 Add OpenGraph and image dimension metadata to posts
* MM-11272 Added app.PreparePostForClient
* MM-11272 Added app.PreparePostListForClient
* MM-11272 Added EmojiStore.GetMultipleByName
* MM-11272 Added emojis to PreparePostForClient
* MM-11272 Added unit tests for getting reaction counts
* MM-11272 Added unit tests for TestPreparePostForClient
* MM-11272 Added emojis from reactions to Post.Emojis
* MM-11272 Always update post.UpdateAt when reactions change to bust cache
* Fixed merge conflicts
* Moved post metadata-related code into its own file
* Update store mocks
* Fixed typo
* Add missing license headers
* Updated post metadata tests when custom emojis are disabled
* Fix unreliable unit tests
* Fix inconsistent casing in SQL statements
* Fix blank line
* Invalidate store cache after making changes
* Clear post cache synchronously with reactions
* MM-11781: Basic Data Export Command Line.
* ChannelStore new unit tests.
* TeamStore new unit tests.
* Unit test for new UserStore function.
* Unit tests for post store new methods.
* Review fixes.
* Fix duplicate command name.
* initial implementation of after, before, on search flags allowing to restrict the search to a specific day or a date range
* missed setting beforeDate in SearchParams in one place
* fixed condition when only flags are used for search without any plain terms
* changed date format used for after/before/on flags to be in ISO8601 format as suggested in PR comments, added a helper function to pad month and day with zeroes allowing the user user either format, with or without leading zeroes
* corrected expected compare to date setting for the TestParseDateFilterToTimeISO8601 test
* fixed a bug for the scenario when you only have the date flags without any terms, added a couple of tests for that scenario
* updated the date filter logic to use parameters to construct the query instead of simply appending strings together, as suggested in the pull request comments
* added search unit test using date flags
* added a helper function to create a test post with a createat date manually set, updated the test for search using date flags to create test posts with different createat dates to be able to better test the functionality
* MM-11817 Add support for after/before/on search flags with Elasticsearch
* add support to search posts to perform the search in context of the client's timezone when filtering by createat date using on: after: before: flags
* updated tests to match the new signature
* Add ToJson() to PostActionIntegrationResponse
This commits adds a ToJson() methode to PostActionIntegrationResponse.
It also adds tests for other ToJson() methods
* Add PostActionIntegrationResponseFromJson function
* Add PostActionIntegrationRequesteFromJson() function
* Fix test names
* Add testcase
* MM-10833: send down computed channel props
This allows channel headers to reference channel mentions for a client
that doesn't already know about the channels in question.
We intentionally don't send down the props for the autocomplete and
search endpoints since they aren't used in that context, and would add
unnecessary overhead.
* update channel props on patch
* revert to treating channel purpose as plaintext
WIP Out Of Office
Return error for status command if user status is OOO
Ignore notifications if Out Of Office
Disable AutoResponder if status is set to online
Add test for AutoResponder
DisableAutoResponse when manually setting status
Remove check on status slash command
return early if user does not exists in SendAutoResponse method
Add proper error handling
Add a newline after error handling
Revert back to err == nil in api4/status.go
Remove a.Go when using a.Publish
Add name consistency with the feature auto responder
Last changes for name consistency, also fix failing test with auto_responder
Fix names of functions in auto responder test
Add ExperimentalEnableAutomaticReplies flag
Auto Responder reply to a post
* MM-9661: rename POST_MESSAGE_MAX_RUNES to \0_v1
* MM-9661: s/4000/POST_MESSAGE_MAX_RUNES_V1/ in tests
* MM-9661: introduce POST_MESSAGE_MAX_RUNES_V2
* MM-9661: migrate Postgres Posts.Message column to TEXT from VARCHAR(4000)
This is safe to do in a production instance since the underyling type is
not changing. We explicitly don't do this automatically for MySQL, but
also don't need to since the ORM would have already created a TEXT column
for MySQL in that case.
* MM-9661: emit MaxPostSize in client config
This value remains unconfigurable at this time, but exposes the current
limit to the client. The limit remains at 4k in this commit.
* MM-9661: introduce and use SqlPostStore.GetMaxPostSize
Enforce a byte limitation in the database, and use 1/4 of that value as
the rune count limitation (assuming a worst case UTF-8 representation).
* move maxPostSizeCached, lastPostsCache and lastPostTimeCache out of the global context and onto the SqlPostStore
* address feedback from code review:
* ensure sqlstore unit tests are actually being run
* move global caches into SqlPostStore
* leverage sync.Once to address a race condition
* modify upgrade semantics to match new db semantics
gorp's behaviour on creating columns with a maximum length on Postgres
differs from MySQL:
* Postgres
* gorp uses TEXT for string columns without a maximum length
* gorp uses VARCHAR(N) for string columns with a maximum length of N
* MySQL
* gorp uses TEXT for string columns with a maximum length >= 256
* gorp uses VARCHAR(N) for string columns with a maximum length of N
* gorp defaults to a maximum length of 255, implying VARCHAR(255)
So the Message column has been TEXT on MySQL but VARCHAR(4000) on
Postgres. With the new, longer limits of 65535, and without changes to
gorp, the expected behaviour is TEXT on MySQL and VARCHAR(65535) on
Postgres. This commit makes the upgrade semantics match the new database
semantics.
Ideally, we'd revisit the gorp behaviour at a later time.
* allow TestMaxPostSize test cases to actually run in parallel
* default maxPostSizeCached to POST_MESSAGE_MAX_RUNES_V1 in case the once initializer panics
* fix casting error
* MM-9661: skip the schema migration for Postgres
It turns out resizing VARCHAR requires a rewrite in some versions of
Postgres, but migrating VARCHAR to TEXT does not. Given the increasing
complexity, let's defer the migration to the enduser instead.
* [PTL-7537] implement feature and test
* [PTL-7537] Update feature to post the the room requiring a username flag to be used
* [PTL-7537] update tests with username
* update test to remove changes to the test helper struct
* use the basic team and user
* image proxy support
* go vet fix, remove mistakenly added coverage file
* fix test compile error
* add validation to config settings and documentation to model functions
* add message_source field to post
* Fixes system message posted to Town Square when adding/removing team member (#6483)
Fixes unit test method call to match RemoveUserFromTeam modification (#6483)
Fixes system message posted to Town Square when adding/removing team member (#6483)
Removes unnessary error message
* Updates system message when a user leaves a team (#6483)
* Changes system message when a user is removed from team (#6483)
* Adds a new string to be post to town-square when a member is added to a team (#6483)
* Option to add user to channel if mentioned user is not currently in the channel
* instead of link from server, just add component on client side to add channel member
* change implementation using post.props
* do clean up and add test
* sanitize post.props['add_channel_member'] on post creation
* move sanitize to app.CreatePost and also apply to app.UpdatePost