Commit Graph

10498 Commits

Author SHA1 Message Date
George Goldberg
9afb1586cd MM-12648: Properly unescape OpenGraph metadata containing HTML entities. (#9891) 2018-11-28 10:58:12 +00:00
Harrison Healey
4294758793 MM-13208 Rename DisablePostMetadata setting to EnablePostMetadata and turn off by default (#9894) 2018-11-27 16:13:02 -05:00
Shobhit Gupta
514c1f1617 [MM-12452] Stop inserting hashed plugin keys (#9817)
* Stop inserting hashed plugin keys

* Address comments

* Remove else statement

* Address comments

* Add comment

* Update as per comments

* Refactor as per comments

* Update plugin_key_value_store.go

minor comment tweaks

* fail on non StatusNotFound for original key query

* idiomatic error handling, and do not clean up if insert fails
2018-11-27 21:50:31 +01:00
Harrison Healey
385a0048bf MM-13015 Remove metadata field from post when metadata is disabled (#9882) 2018-11-26 10:48:58 -05:00
Carlos Tadeu Panato Junior
79f1c1d44c Add preparatory upgrade code for 5.7.0 (#9881) 2018-11-26 14:58:12 +01:00
Carlos Tadeu Panato Junior
7253b2c59c upgrade db to 5.6.0 (#9880) 2018-11-26 14:05:04 +01:00
Harshit Patni
7663de06bb [MM - 12370] Add cli command "webhook delete" (#9804)
* [MM - 12370] Add cli command "webhook delete"

* Replace spaces with tabs

* Call cli command to delete hooks in tests

* Capture webhook object from create webhook to get webhook id

* Print error message when webhook not deleted

* Remove redundant error message and if condition in webhook delete test

* Fix build
2018-11-26 12:32:11 +01:00
Harrison Healey
ba627c0f92 Skip getting the post again when getting file metadata for a post (#9879) 2018-11-26 10:47:01 +00:00
Harshil Sharma
60393f1cad #132 Added some comments for API client (#9872)
* #132 Added some comments for API client

* #132 fixed godoc formatting

* #138 fixed go formatting
2018-11-26 10:43:56 +00:00
Jesús Espino
be8be3a6dc Moving app level migrations to its own file (#9871) 2018-11-23 09:39:33 -08:00
Hanzei
21cbdb6de6 Add helper methods for SubmitDialog structs (#9864)
* Add To/From JSON methods for SubmitDialog structs

* Fix method ordering
2018-11-23 12:29:32 -05:00
Harrison Healey
71dba81e91 MM-13015 Add safety valve setting to disable post metadata (#9877)
* MM-13015 Add safety valve setting to disable post metadata

* Remove setting from client config since it's no longer needed
2018-11-23 11:59:34 -05:00
Saturnino Abril
c494f6f898 clean up unused HTML templates (#9830) 2018-11-24 00:55:56 +08:00
Harrison Healey
d018554ef3 MM-11434 Only call PreparePostForClient once when creating a post (#9868) (#9876)
* MM-11434 Only call PreparePostForClient once when creating a post

* Have PreparePostForClient provide new metadata when a post already has it and update tests
2018-11-23 10:20:02 -05:00
Harrison Healey
d76069cdbd Revert accidental changes to caching layer 2018-11-22 13:37:56 -05:00
Harrison Healey
eff68da254 MM-11434 Revert "Parallelize PreparePostListForClient" 2018-11-22 13:14:55 -05:00
Harrison Healey
c9f3d03b6d Merge branch 'master' into post-metadata 2018-11-22 13:11:55 -05:00
Harrison Healey
5f65356a3f Address issues 2018-11-22 13:10:36 -05:00
Harrison Healey
5388afd37e Remove comments about deprecating FileIds and HasReactions (#9869) 2018-11-22 13:09:27 -05:00
Elias Nahum
d263353e85 Typo (#9857) 2018-11-22 15:28:56 +01:00
George Goldberg
877e1b7f9a MM-12957: Fix moving a channel with no members. (#9841) 2018-11-22 11:19:47 +00:00
Hanzei
ffd92d5d48 GH-9846: Migrate to idiomatic error handling in model/client4.go (#9851)
* Migrate to idiomatic error handling in model/client4.go

* Changes as requested

* Add documentation for some methods
2018-11-22 10:03:52 +00:00
Jesse Hallam
f8ffd68060 Webhub race condition (#9863)
* fix webconn close semantics

Avoid race conditions in WebConn on shutdown by closing channels to guarantee all readers are notified. Wrap this with sync.Once to avoid closing the channel more than once.

* web_hub_test.go

* webhub: fix race condition on shutdown

Ensure that if the webhub shuts down in the process of sending, the caller unblocks given that the webhub will no longer consume incoming events.

* panic if app shutdown takes >30 seconds

* simplify WebConn::Pump channel semantics too
2018-11-22 10:53:44 +01:00
Yusuke Nemoto
1271908182 Block to override post_type if already set (#9859) 2018-11-21 21:10:59 -05:00
Carlos Tadeu Panato Junior
cae7798d76 add CreateDirectChannel plugin api (#9848) 2018-11-21 11:36:02 +01:00
Jesse Hallam
a78913178c Ensure unittest isolation (#9819)
* api4: fix TestGetUsersNotInTeam assertions

This test was relying on data from a previous test run. With the data cleared before each test, the assertions much match reality.

* *testlib: always InitSystemAdmin

Some tests implicitly relied on the basic user having system
administrator privileges because it was the first user created as such.
Eliminate `InitSystemAdmin` and explicitly create the system admin user
instead to avoid this ambiguity going forward.

* *testlib: drop all tables before each test

* api4: split up TestChannelDelete to avoid duplicate InitBasic

* api4: teardown in TestResetPassword, for when this test comes back

* invalidate cache on DropAllTables

This is necessary since the test store persists across tests.

* disable parallel tests

While tests within a package must be explicitly parallelized using `t.Parallel()`, tests across packages are run in parallel by default.  This causes problems given that the tests all currently share the same database instance.

Unfortunately, this also means that running the tests is much slower, but we can return to this later.
2018-11-20 20:16:25 -05:00
Carlos Tadeu Panato Junior
2555a5d45d Add RemoveTeamIcon plugin api (#9847) 2018-11-20 15:43:42 +01:00
Jesse Hallam
c46d8ec892 MM-12974: guard app plugins with mutex (#9818)
* guard app plugins with mutex

Shutting down the app could race with a goroutine that uses the plugins environment, since we shut down the plugins first before cleaning up goroutines.

* fix go vet issues
2018-11-20 08:52:51 -05:00
Hanzei
0a73690537 Remove *model.ChannelList from plugin API return parameter (#9844)
* Remove *model.ChannelList from plugin API return parametern

* Fix panic

* Add tests

* Changes as requested

* Fix panic in GetPublicChannelsForTeam()
2018-11-20 08:50:34 -05:00
Harrison Healey
8dc865b917 Merge branch 'master' into post-metadata 2018-11-19 16:51:56 -05:00
Joram Wilander
8cfca681b0 MM-12843 Add interactive dialogs (#9816)
* 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
2018-11-19 15:27:17 -05:00
Harrison Healey
23c8950312 MM-11434 Performance improvements for post metadata (#9849)
* Remove unused error return value from PreparePostForClient

* Remove unused error return value from PreparePostListForClient

* MM-11434 Parallelize PreparePostListForClient

* MM-11434 Skip looking reactions and files on post whenever possible

* Add note about the use of deprecated fields
2018-11-19 13:26:40 -05:00
Sandeep Sukhani
7a6f957638 [MM-11861] Design & implement a better way for plugins to update their own configuration (#9712)
* [MM-11861] Design & implement a better way for plugins to update their own configuration

Added GetPluginConfig and SavePluginConfig plugin APIs.
Added test cases for testing new APIs.

* Fixed gofmt error

* Minor changes requested in PR
2018-11-19 12:27:15 -05:00
Michael Kochell
a50e8ac5b9 [MM-9938] Add support for multiple responses from a slash command (#9836)
* slash command response now supports multiple posts

* change wording of Posts to ExtraResponses
2018-11-19 08:00:50 -08:00
Wasim Thabraze
246ff89391 MM-12463 : Added capability to bulk export custom emojis (#9790) 2018-11-19 14:43:31 +00:00
Hanzei
2104c6878c [MM-12476] Consistent paging arguments limit/offset vs page/perPage for plugin API (#9838)
* Change GetTeamMembers() and GetPublicChannelsForTeam() arguments to page, perPage for plugin API

* Add test for GetPublicChannelsForTeam()

* Add test for GetTeamMembers()

* Changes as requested

* Change return from GetPublicChannelsForTeam() to []*model.Channel
2018-11-19 08:43:49 -05:00
Carlos Tadeu Panato Junior
bffac3f09f add SetTeamIcon plugin api (#9840) 2018-11-16 10:52:07 -05:00
Harrison Healey
7aef759fd8 Merge branch 'master' into post-metadata 2018-11-16 09:34:35 -05:00
Carlos Tadeu Panato Junior
7a8d7e53cc Add GetTeamIcon plugin api method (#9837) 2018-11-16 08:17:42 -05:00
Carlos Tadeu Panato Junior
b29f1cb844 Add SetProfileImage for plugin API (#9831) 2018-11-15 21:23:03 +01:00
George Goldberg
f0351f23f1 MM-12818: Delete FileInfos when deleting the post they belong to. (#9828) 2018-11-14 13:01:44 -05:00
Harrison Healey
2113ad0205 MM-13021 Fix warning logged when getting metadata for post without emojis (#9832) 2018-11-14 22:24:50 +05:30
Harrison Healey
d07def5169 Merge branch 'master' into post-metadata 2018-11-14 09:58:56 -05:00
Chetanya Kandhari
e0569e766a Update handlers_test.go (#9775) 2018-11-14 15:44:40 +01:00
Carlos Tadeu Panato Junior
0e4094a2ad default text to SAML (#9827) 2018-11-14 11:41:20 +01:00
Tsilavina Razafinirina
4aca95fff9 [MM-8404] Channel notification setting for disabling channel mentions (#9777)
* Channel notification setting for disabling channel mentions

* Updates unit tests (#MM-8404)

* Adds constants (#MM-8404)

* Refactors if statement and adds unit test (#MM-8404)

* Moves ignore_channel_mentions_notify_prop constant to channel model (#MM8484)
2018-11-13 19:25:57 -05:00
Daniel Fiori
fa0aecce1e Ignore "@" sign at the beginning of user searches (#9780)
This trims the "@" symbol from the begging of the search term before executing the query.
2018-11-12 12:54:12 -08:00
Daniel Fiori
7a758eae72 Optimize searching for users on Postgres (#9782)
The searches on Postgres using LIKE with prefix matching will only
use an index if it has the text_pattern_ops flag (forcing C collation).
This drops the old indexes and adds properly optimized ones.
2018-11-09 15:34:31 -05:00
Harshil Sharma
0c5f60f89b #146 Terms of Service Phase 2 (#9731)
* #132 added UserTermsOfService model

* #132 added UserTermsOfService model

* #132 added logic to save user TOS data in a new table

* #132 Added logic to save and delete user TOS. Updated user TOS action logic

* #132 updated store mocks

* #132 added tests

* #132 removed cache from UserTermsOfService SQL store

* #132 fixed styling and license check

* #132 added message translations in en.json

* #132 fixed save user TOS logic to work second time as well

* #132 removed User.AcceptedTermsOfService colum and migrated accepted TOS data into new table

* #132 fixed formatting

* #132 fixed formatting

* #146 added field 'mandatory' to terms of service

* #146 updated tests

* #146 added getLatestTermsOfService API

* #146 Added tests

* #146 fixed styling

* #146 removed code for managing mandatory/optional TOS

* #146 Added TOS re-acceptance period config

* #146 fixed styling

* #146 removed some code left for debugging

* #146 added TOS re-acceptance period in config

* #146 fixed a json name from service_terms to terms_of_service

* #146 Minor refactoring and added TOS re-acceptance period to diagnistics

* Fixed style

* Updated upgraded script to keep app backward compatible
2018-11-08 15:48:14 -05:00
Carlos Tadeu Panato Junior
c52e808e34 MM-12641 not panic when dont have permission in the plugin folder (#9690)
* MM-12641 not panic when dont have permission in the plugin folder

* udpate return statment
2018-11-08 10:25:08 -08:00