Commit Graph

1704 Commits

Author SHA1 Message Date
Rodrigo Villablanca
3c2b1571f4 Prevent spurious error (#14796)
* Simple fix

* Suggestions

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-07-09 13:25:23 -03:00
Sudheer
50fd95717e MM-26620 Add a config setting for controlling ask community link (#14985)
* MM-26620 Add a config setting for controlling ask community link

* Update setting

* Change to support setting
2020-07-09 17:59:22 +05:30
Harrison Healey
de6a57cdc3 Sidebar V2 Phase 2 (#14967)
* parent 48256721c4 (#14358)

author Eli Yukelzon <reflog@gmail.com> 1585814774 +0300
committer Eli Yukelzon <reflog@gmail.com> 1589111022 +0300

Sidebar caregories implemented

Apply suggestions from code review

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

Update store/sqlstore/channel_store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

Update store/sqlstore/channel_store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

code review suggestions

status messages

edge case

bugs...

timeout reverse

* MM-25126 Add a separate default sorting method for categories (#14575)

* MM-25158 Add user to initial sidebar categories when joining team (#14570)

* MM-25281  Place new categories in the correct position (#14609)

* MM-25277  Return channels that aren't in a category as part of the Channels/Direct Messages categories (#14601)

* MM-25276  Remove categories when leaving a team (#14600)

* Remove categories when leaving a team

* layers

* corrected cleanup function

* lint

* .

* corrected errors in postgres

* .

* MM-25280  Ensure that the "update category order" API call only contains real category IDs and isn't missing any IDs (#14626)

* Ensure that the "update category order" API call only contains real category IDs and isn't missing any IDs

* tests

* correct status code

* MM-25278  Change "update category" API to return 400 when changing unsupported fields (#14599)

* MM-25279  Change category migration to only populate channels in Favorites (#14627)

* MM-25157 Add API to delete custom categories  (#14574)

* MM-25157 Add API to delete custom categories

* get categories fix

* maxorder fix

* Use correct websocket event when deleting category

* Fix tests and remove debug code

* Actually use the right websocket event this time

* test cleanup

* Update test for new category order

Co-authored-by: Eli Yukelzon <reflog@gmail.com>

* MM-24914 Various fixes for sidebar channel handling (#14756)

* Fix checking for channel membership when reordering channels

* Remove unique constraint on SidebarCategories

* Set column sizes for SidebarCategories and SidebarChannels tables

* Allow changing the sorting method for non-DM categories

* Fix nil pointers in error handling

* Fix orphaned channels from other team being returned in Channels category

* Fix non-orphaned channels being duplicated in the Channels category

* Remove unique constraint on SidebarChannels

* Fix category/name of favorites preferences

* Fix testSidebarChannelsMigration

* Rename err to nErr and appErr to err

* Fix channel order returned by GetSidebarCategories on MySQL

* Fix adding/removing favorites preferences

* Remove leftover TODO

* Change SidebarCategoryType enums to use full names (#14786)

* Change SidebarCategoryType enums to use full names

* Fix Channels constant

* Remove leftover debug code

* MM-24914 Fix updateCategory endpoint returning the wrong type (#14795)

* MM-24914 Make some changes to UpdateSidebarCategories (#14806)

* Fix orphaned DMs not always being returned

* MM-24914 Make some changes to UpdateSidebarCategories

* Run updateSidebarCategoryOrderT in a transaction

* Fix deleting SidebarChannels based on order of arguments to UpdateSidebarCategories

* bump for api testing

* bump for api testing

* Change CreateInitialSidebarCategories to return a plain error

* Change MigrateSidebarCategories to return a plain error

* Remove usage of UpdateColumns when updating sidebar categories (#14843)

* Remove usage of UpdateColumns when changing category order

* Add a random test case

* Remove usage of UpdateColumns when updating sidebar categories (#14843)

* Remove usage of UpdateColumns when changing category order

* Add a random test case

* Remove usage of UpdateColumns when updating sidebar categories (#14843)

* Remove usage of UpdateColumns when changing category order

* Add a random test case

* MM-26343 Make CreateInitialSidebarCategories idempotent (#14870)

* Fix bad merge

* Fix another bad merge

* Fix unintentionally removed i18n string

Co-authored-by: Eli Yukelzon <reflog@gmail.com>
2020-07-06 18:20:35 -04:00
Dušan Panić
83a80a2422 Implemented AmazonS3PathPrefix (#14917)
* Implemented AmazonS3PathPrefix

* Remove unecessary method

* fix for test

* fix for test which are failing

* fix for test which are failing

* fix for test

Co-authored-by: Dusan Panic <dusan@salestrekker.com>
2020-07-07 00:20:13 +02:00
Eric Sadur
70084f107c changing license renewal link to point to new renewal webpage (#14907)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-07-06 14:15:00 -04:00
Agniva De Sarker
58dc0772bc MM-26346: check for nil Message in DisableMentionHighlights (#14972)
Sometimes a PostPatch may not contain the message field. For example,
while pinning a post, only the IsPinned field is set, and everything
else is nil. In that case, DisableMentionHighlights would throw a panic.

We handle that case by checking for nil first.
2020-07-06 20:29:36 +05:30
Ashish Bhate
af8b914c6c MM-23596: Ability to list private channels for team (#14925)
Summary:
store, app, api and go driver support for listing private channels

Ticket Link:
https://mattermost.atlassian.net/browse/MM-23596
2020-07-06 12:34:29 +05:30
Jesús Espino
a4fc0fcfb7 Adding terms_accepted and receive_emails_accepted params to request trial (#14937) 2020-07-03 12:17:34 +02:00
Hossein Ahmadian-Yazdi
4c50c7c59b [MM-25780] Fix incorrect session length when logging in through mobile using SSO (#14874)
* Pass device ID

* dont use device id as way of detecting

* fix spelling mistake

* update layers

* fix test

* fix linting

* save schema

* put columns in correct place

* fix linting

* update

* upgrade go change

* use props

* fix stuff

* update session tests

* address PR comments

* address PR comments
2020-06-30 10:34:05 -04:00
Michael Kochell
11bc28b5fb [MM-26532] Support "active" filter on profile search (#14923)
* Support "active" filter on profile search

* Add tests for active user filter
2020-06-29 15:52:46 -04:00
Mario de Frutos Dieguez
bec2f366a7 [MM-24334] Include role filtering in ES search (#14465)
* ES supports role filtering for users

- Added roles field for ES user index
- Include role filtering logic in ES
2020-06-29 21:24:36 +02:00
Agniva De Sarker
a9ba052207 MM-26206: Add GroupMentions permissions in default channel admin (#14838)
* MM-26206: Add GroupMentions permissions in default channel admin

This permission was skipped from the default permissions function.
Which led to a bug where permissions reset would not bring back
this permission to the different roles.

* Added tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-29 21:04:29 +05:30
Miguel de la Cruz
eff2209a7e [MM-25646] Adds the permanent delete all users endpoint to the local API (#14903)
* [MM-25646] Adds the permanent delete all users endpoint to the local API

* Add a check to ensure that teams and channels are not deleted

* Fix linter

* Fix audit record name for consistency with method name

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-27 23:00:01 +02:00
Ibrahim Serdar Acikgoz
f7f1f0d268 [MM-23721] api4/user: add verify user by Id endpoint (#14244)
* api4/user: add verify user by id method

* Update api4/user.go

Co-Authored-By: Miguel de la Cruz <miguel@mcrx.me>

* Update model/client4.go

Co-Authored-By: Miguel de la Cruz <miguel@mcrx.me>

* api4/user: reflect review comments

* Update api4/user_test.go

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-26 16:08:01 +03:00
Miguel de la Cruz
1ef5523b9f [MM-26390] Ensures the generated team name in sampledata is a valid one (#14901) 2020-06-25 16:00:12 +02:00
Scott Bishel
53ef4d120b MM-25544:Update error message for length violations (#14853)
* update error message for length violations

* fix unit test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-23 10:47:48 -06:00
Christopher Speller
574b48835d MM-26055 Remove session requirement from command args. (#14880)
* Remove session requirement from command args.

* Removing unused server side translation.

* Restoring model.CommandArgs.Session for compatibility.

* Feedback fixes.

* Build fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-23 08:33:45 -07:00
Scott Bishel
938176be3e MM-24467- Use new ServiceProviderIdentifier in AuthnRequest (#14725)
* add ServiceProviderIdentifier to config

* Update config, add unit test

* fix unit test, update i18n

* add english translation for error

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-22 09:36:08 -06:00
Ibrahim Serdar Acikgoz
124014ad9c [MM-23719] api4/channel: add move channel to a team endpoint (#14246)
* api4: add move channel method

* api4: add tests for move channel, model: add move channel to client4.go

* add api.channel.move_channel.type.invalid message

* model/client4: remove a redundant line

* api4/channel: add tests for gm and private channel types

* app/channel: update move channel comment

* app/channel: add extra check if a users joins to channel during movement

* app/channel: log errors for post move channel

* app/channel: remove deactivated members by default while moving a ch.

* model/client: update move channel command

* fix vet errors

* app/channel: add missing webhook updates

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-22 16:57:49 +03:00
Martin Kraft
6158e91308 MM-25261: Add 'include_deleted' parameter to get all channels API req… (#14721)
* MM-25261: Add 'include_deleted' parameter to get all channels API request.

* MM-25261: Adds test for deleted channels.

* MM-25261: Switches to single liner.

* MM-25261: Adhere to beta config setting for viewing archived channels.

* MM-25261: Test fix.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-06-19 16:53:37 -04:00
Farhan Munshi
77bee1d4f1 MM-25263 Add group members to search and get users and create getGroupStats endpoint (#14733)
Add tests for SearchInGroup
2020-06-18 10:22:35 -04:00
Agniva De Sarker
1d9c8a490d MM-25700 : Use a counting semaphore for push notifications hub (#14758)
Automatic Merge
2020-06-18 05:56:35 +02:00
Doug Lauder
b317ee5cf2 MM-25394 session expired push notifications (#14732)
* new job type created that checks for expired mobile sessions and pushes notifications.

* only send session expired notifications if ExtendSessionLengthWithActivity is enabled.

* includes schema change:  field added to Sessions table
2020-06-17 14:47:54 -04:00
Attila Molnar
66597d0fcb Expand Plugin and REST APIs to trigger user typing event (#14331) 2020-06-16 11:41:05 +02:00
Sudheer
1b95b82b18 MM-25723 Add an experimental setting for data prefetching (#14731)
* MM-25723 Add an experimental setting for data prefetching

* Fix formatting

* Fix bool error

* Fix lint error

* Change default to true
2020-06-03 14:43:59 +05:30
Agniva De Sarker
e3255879ba Enable gossip encryption (#14640)
* Enable gossip encryption

* Fix order

* Auto-generate key

* Update gorp fork to include BeginTx

* Add a test for InsertIfExists

And point gorp to a custom branch for now

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-03 14:16:15 +05:30
Jesús Espino
e0edd2bebb Add trial license api (#14603)
* Initial request trial api creation

* Adding test license public certificate

* Adding go client method

* Applying changes to use production environment

* Removing accidentally added strings

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-06-02 21:34:15 +02:00
Martin Kraft
c529d5190a MM-25040: Restrict associated groups to channels when team is group-constrained. (#14619)
* MM-25040: Only return team-associated groups if the team is group-constrained.
MM-25040: Prevents associating a group to a channel if the team doesn't have the group first.

* MM-25040: Fix lints.

* MM-25040: Still add the groupteam if the team is not group-constrained.

* MM-25040: Wraps groupteam upsert in else branch for efficiency.

* MM-25040: Removes unnecessary page iteration.

* MM-25040: Fix typo.

* MM-25040: Moves filtering to SQL.

* MM-25040: Updates tests, check pagination.

* MM-25040: Fix lint error.

* MM-25040: Adds some more group store tests.

* MM-25040: Fix for wrong test parameter.
2020-05-29 10:46:52 -04:00
Martin Kraft
e83cc7357c MM-24517: Add newly created channel admin role to all clients' redux state. (#14635)
* MM-24517: Add newly created channel admin role to redux state.

* MM-24517: Adds comment; fixes lint errors.
2020-05-28 14:38:27 -04:00
Jesús Espino
ae328153d5 Fixing behavior of Replicas and SearchReplicas in canary environments (#14576)
* Fixing behavior of Replicas and SearchReplicas in canary environments

* Trying to fix tests

* Revert "Trying to fix tests"

This reverts commit 3531da9618.

* Revert "Fixing behavior of Replicas and SearchReplicas in canary environments"

This reverts commit 0c05901c84.

* Revert "Disable read/search db replicas in TE/E0 (#14400)"

This reverts commit ef5ac519d9.

* Making the store aware of the license

* Readding the unit tests

* Fixing sqlstor supplier tests

* Adding mutex to ensure license write consistency and fixing tests

* Fixing tests

* Fixing tests

* Shuting down server properly during tests

* Trying to fix tests

* Trying to fix the tests

* Skipping flaky tests

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-27 15:42:48 +02:00
Ben Schumacher
9e91f2ad33 Bump app version to 5.26 (#14649) 2020-05-27 12:07:44 +02:00
Scott Bishel
ebece6c23a MM-25014 - Default Group Name to null, until AllowGroupReference is set (#14651)
* make Group.Name a pointer to allow null

* fix unit tests

* fix build error

* fix unit test

* ensure Name field not nil

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-26 19:21:29 -06:00
Claudio Costa
91f010b8b7 Fix client4.GetPluginStatuses() (#14629)
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-25 21:07:09 +02:00
Arianna Vespri
2135096d88 Convert bool string comparisons to strconv.ParseBool for REST parameters (#13650)
* Convert bool string comparisons to strconv.ParseBool for REST parameters

* Log failed bool conversions

* Rename errors, changed log levels

* drop strconv.ParseBool error handling

If the query string parameter is omitted, strconv.ParseBool returns an error for the empty strings, which spams the logs. Instead, just assume the default semantics of a `false` return value if an error occurs.

* allow randomized Client4 booleans

It's hard to test api4's handling of the various boolean input values
accepted. Extend Client4 with support for overriding how it builds those
strings, and pick a random value on test startup.

* gofmt -s

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2020-05-24 05:01:31 +08:00
Agniva De Sarker
f7a91c7cf9 MM-24830: Add event constants for gossip request/response (#14611)
* MM-24830: Add event constants for gossip request/response

This is an accompanying PR for the shift to entirely gossip.

* Fix order

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-23 11:43:58 +05:30
Ben Schumacher
23ecc9ad0a [MM-25284] Include license type in Marketplace request (#14586) 2020-05-23 07:05:51 +02:00
Agniva De Sarker
abce5d620f MM-25439: Skip SuddenClose flaky test (#14628)
Automatic Merge
2020-05-22 02:44:42 -07:00
Eli Yukelzon
008961ba2f MM-20951 Add sentry support to mattermost-server (#14405) 2020-05-21 16:13:37 +03:00
Shota Gvinepadze
43e606173b [MM-20684] Slash Command Autocomplete (#14557)
* [MM-20684] Initial implementation of the Command Autocomplete (#13602)

* Implement Autocomplete Data

* Change CommandName to Trigger

* Fix Autocomplete test

* Make stylistic changes

* Rename a bunch of fields and methods

* Fix variable names, safer type assertions

* [MM-20684] plugin autocomplete implementation (#14259)

* Add an endpoint for command autocomplete suggestions

* Add full Suggestion to the AutocompleteSugestion struct

* Add Dynamic Argument support

* Tidy up things

* Fix missed test case

* Add support of the named arguments

* Update autocomplete API

Fix review issues

Implement dynamic args as a local request

* Fix ineffassign

* Add support of the uppercase letters in arguments

* Add support of the optional arguments

* Remove ineffectual assignment

* Add support for icons (#14489)

* Address couple of nits

* Add comment to IconData

* Add types to all consts

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-21 12:24:56 +04:00
Harrison Healey
f62493145a MM-24386/MM-24465 Enable link previews and full push notifications by default (#14565)
* MM-24386 Update default push notification contents to full

* MM-24465 Enable link previews by default

* Fix a unit test relying on the old default
2020-05-20 09:23:13 -04:00
Agniva De Sarker
15ed9a8f20 MM-25006: Fix occurences of unclosed http bodies (#14521)
* MM-25006: Fix occurences of unclosed http bodies

And while here, we also use ioutil.Discard to read the remaining
body instead of reading with ioutil.ReadAll which allocates a separate
byte buffer.

* Fix mistake

* Address review comments

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-20 08:41:37 +05:30
Miguel de la Cruz
0154b8059b [MM-20979] Add first implementation of the Bleve search engine (#14562)
* [MM-20979] Add first implementation of the Bleve search engine

* Fix i18n

* Migrate searchengine utils tests

* Fix linter

* Don't add allTermsQ if both termQueries and notTermQueries are empty

* Fix test that should work if user is system admin

* Modify naming according to review comments

* Abstract getIndexDir function

* Extracting bleve engine name as a constant

* Merge both Indexer interfaces into one

* Add worker stopped message

* Allow worker to be started/stopped with config change

* Use constants for index names

* Modify test order

* Fix linter

* Trying to unlock the CI
2020-05-20 01:29:55 +02:00
Ben Schumacher
8d0343d2eb [MM-22734] Support different interactive message button styles (#14592) 2020-05-19 18:41:17 +02:00
Miguel de la Cruz
0d89ff5d0e Mm 23710 mmctl local mode (#14561)
* [MM-24146] Add unix socket listener for mmctl local mode (#14296)

* add unix socket listener for mmctl local mode

* add a constant for local-mode socket path

* reflect review comments

* [MM-24401] Base approach for Local Mode (#14333)

* add unix socket listener for mmctl local mode

* First working PoC

* Adds the channel list endpoint

* Add team list endpoint

* Add a LocalClient to the api test helper and start local mode

* Add helper to test with both SystemAdmin and Local clients

* Add some docs

* Adds TestForAllClients test helper

* Incorporating @ashishbhate's proposal for adding test names to the helpers

* Fix init errors after merge

* Adds create channel tests

* Always init local mode to allow for enabling-disabling it via config

* Check the RemoteAddr of the request before marking session as local

* Mark the request as errored if it's local and the origin is remote

* Set the socket permissions to read/write when initialising

* Fix linter

* Replace RemoteAddr check to ditch connections with the IP:PORT shape

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Fix translations order

* [MM-24832] Migrate plugin endpoints to local mode (#14543)

* [MM-24832] Migrate plugin endpoints to local mode

* Fix client reference in helper

* [MM-24776] Migrate config endpoints to local mode (#14544)

* [MM-24776] Migrate get config endpoint to local mode

* [MM-24777] Migrate update config endpoint to local mode

* Fix update config to bypass RestrictSystemAdmin flag

* Add patchConfig endpoint

* MM-24774/MM-24755: local mode for addLicense and removeLicense (#14491)

Automatic Merge

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Ashish Bhate <bhate.ashish@gmail.com>
2020-05-19 18:20:41 +02:00
catalintomai
6dc8eccc13 MM-23395: Add websockets support for update group (#14202)
* MM-23395: add websockets support for update group
2020-05-18 09:43:26 -07:00
Scott Bishel
e6bbb4bd7a MM-24082: Add PictureAttribute to LDAP Settings in config (#14506)
* add new config setting for profile picture attribute

* update attribute names

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-14 13:25:23 -06:00
Miguel de la Cruz
4fde004a5b [MM-23535] Add disable database search flag and return empty posts results if set (#14245)
* [MM-23535] Add disable database search flag and return empty posts results if set

* Add UpdateConfig function for the SearchStore and hook it into the app lifecycle

* Add the config listener in the server instance instead of using FakeApp

* Instantiate searchlayer as a pointer to avoid passing around copies of it
2020-05-13 14:00:57 +02:00
catalintomai
41e58d9769 MM-23816: Group Mentions: Add ability to rename group names (#14338)
* MM-23816: Group Mentions: Add ability to rename group names
2020-05-12 08:35:03 -07:00
Scott Bishel
80c846412d MM-24692: Add a since parameter to getGroups api (#14444)
* add a since parameter to getGroups api

* update for lint error

* when using since, return deleted groups as well.

* update flaky test, groups have same create time

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-07 14:35:09 -06:00
Scott Bishel
1031e27fd8 MM-23038: Compliance Report Fixes (#14242)
* add warning count as return value

* add warning count as return value

* fix file name

* update mock

* add setting warning to db

* replace wrongly removed string

* add dummy function to see if it will build

* remove dummy function

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-05-07 14:12:47 -06:00