Commit Graph

10398 Commits

Author SHA1 Message Date
Hanzei
d346027691 Add GetPostsAfter() to plugin API (#9650) 2018-10-18 18:11:15 +02:00
Hanzei
0d87486e99 Migrate to idiomatic error handling in app/websocket_router.go (#9708) 2018-10-18 17:04:43 +01:00
Hanzei
d77e3a4c25 Migrate to idiomatic error handling in app/security_update_check.go (#9691) 2018-10-18 08:44:06 -07:00
George Goldberg
5d6d450299 MM-12670: Accept and use "" for user/pass AuthService in import/export. (#9689) 2018-10-18 14:32:36 +01:00
Daniel Hodan
dc946f8516 GH-9635: Add GetUsersByUsernames to plugin API (#9647)
* add GetUsersByUsernames to plugin api

* fix GetUsersByUsernames comment
2018-10-18 09:11:30 -04:00
Charles Kenney
3bc89083fc Add GetFileLink method to plugin API (#9665)
* add GetFileLink method to plugin API

* Update plugin/api.go

* add translations for new plugin API errors
2018-10-17 20:31:51 -04:00
Hanzei
db1123b8b2 Document minimum server version for SearchChannels (#9698) 2018-10-17 17:43:15 -04:00
Daniel Hodan
77f3da1eaf GH-9608: Add GetUsersInChannel to plugin API (#9643)
* add GetUsersInChannel to plugin api

* compute offset value instead of page

* Add version comment
2018-10-17 17:06:14 -04:00
Christopher Speller
819ab451f1 Fix handlers test. (#9682) 2018-10-17 12:04:15 -04:00
Jesse Hallam
715097cc76 MM-12234: configurable limit to user autocomplete and search matches (#9499)
* unit test cleanup

* allow limiting user search results

* clean up test users before starting

* model UserSearchOptions to simplify parameters
2018-10-17 11:24:12 -04:00
Daniel Hodan
e8c9ccaa7e GH-9607: Add GetTeamsForUser to plugin API (#9644)
* add GetTeamsForUser to plugin api

* Add version comment, fix comment typo
2018-10-17 10:37:52 -04:00
Hanzei
7226759831 Document minimum server version for plugin API methods (#9616) 2018-10-17 10:16:15 -04:00
Rafael George
7d66ef0805 [MM-12608] Migrate to idiomatic error handling in the file app/scheme.go in the mattermost-server repo (#9592)
* Add idiomatic error handling

* Remove unused else statement and fix compilation errors

* Add an inline error initialization

The error its just been use once for the return no need to have it in
separate lines.

* Remove uneeded code

- Remove extra line
- Remove initializing in two lines when not needed
2018-10-17 14:25:21 +01:00
Wasim Thabraze
7562f940bb [MM-12465] Added capability to export reactions of posts during bulk export (#9600)
* Added capability to export reactions of posts

* Added capability to export reactions of replies of a post

* Added test case to test the reactions of a post
2018-10-17 14:23:10 +01:00
Hanzei
1befeb61d0 Migrate to idiomatic error handling in app/notification_email.go (#9676) 2018-10-17 21:09:59 +08:00
Hanzei
050c9de0f0 Migrate to idiomatic error handling in app/command.go (#9675) 2018-10-17 14:24:31 +02:00
Daniel Schalla
557fd9ea18 Set default ciphers, set tls 1.2 via config, set curve prefs (#9315)
Config Checks at StartUp Part1

Config Checks; Tests for TLS Server

HSTS header implementation + tests

make gofmt happy with new go version...

make gofmt happy with new go version #2...

fix logic bug

fix typo

Fix unnecessary code block
2018-10-16 07:51:46 -07:00
Artur Mogozov
cedf6488e4 MM-12368 Add create webhook-incoming command (#9566) 2018-10-16 12:13:00 +01:00
Mukul Rawat
80153ef873 [MM-12362] Add CLI command 'config show' (#9536) (#9564)
* Add the subcommand by creating a new Command instance.

* Implemented the structure of the subcommand function.

* Register our new command

* Write some helper functions

* finish the pretty print function

* write some test for config show

* Refactor and extract the tab printing functionality in its own function

* Use app.Config() to create our config object & accept incoming changes

* Removed reading the file, make helper functions return string and perform printing inside the command

* Remove the previous code for checking presence of arguments and use 'cobra.NoArgs()' instead

* Remove named return and instead declare the variable and then return it.

* Remove printTab function and simplify printing out tabs using strings.Repeat

* Add some functions to test the output

* Update the usage and remove a comment

* Update the print
2018-10-15 18:06:46 -04:00
Charles Kenney
1cdf717446 add GetEmojiByName method to plugin API (#9641) 2018-10-15 14:09:30 -07:00
Jesse Hallam
b843774de8 MM-11905: deactivate plugins before unregistering (#9666)
Plugins that listen for config changes might incorrectly re-register
their commands before being /actually/ deactivated, leaving the new
commands alive thereafter.
2018-10-15 14:08:51 -07:00
Mukul Rawat
6aaa10bddb [MM-12538] Migrate to idiomatic error handling the file app/session.go (#9590)
in the mattermost-server (#9573)

* Refactor and make error handling idiomatic

* Golint gives a warning when using method parameters with names like
'deviceId', so rename them to `deviceID`

* Change all ID back to Id
2018-10-15 20:03:22 +01:00
Mukul Rawat
a06e453ea1 [MM-12536] Migrate to idiomatic error handling the file app/user_agent.go in the mattermost-server (#9575) (#9576)
* Make changes to function getPlatformName.

* Make changes to the function getOSName, use switch statement inside instead of nested if

* create helper function and make getBrowserVersion() more idiomatic

* update getUAVersion

* update getBrowserName

* changes required in review done
2018-10-15 20:01:35 +01:00
Wasim Thabraze
457a34c5f4 [MM-12363] Added Team archive command to archive a team by name (#9565)
* Added Team archive command to archive a team by name

* Team archive command now uses SoftDelete method

Team search and list command now shows archived teams with the term '(archived)' appended to them
2018-10-15 19:48:18 +01:00
Carlos Tadeu Panato Junior
0be0700aad Added TextArea (longstring) to the docs in manifest to be rendered in the documentation (#9658) 2018-10-15 14:10:01 -04:00
Hanzei
71b7b9f090 Add GetPostsBefore() to plugin API (#9651) 2018-10-15 19:18:23 +02:00
Daniel Hodan
a35a9b9b2d add GetChannelsForTeamForUser to plugin api (#9646) 2018-10-15 09:27:45 -07:00
Daniel Hodan
3087f0bc4c GH-9609: Add GetUsersInTeam in plugin API (#9642)
* add GetUsersInTeam in plugin api

* remove extra space in comment
2018-10-15 09:24:26 -07:00
Jason Mojica
9da4aba3f2 Add SearchChannels plugin api (#9657) 2018-10-15 09:23:46 -07:00
Mukul Rawat
9385dc750d [MM-12360] Created CLI command "config get" (#9534) (#9558)
* Added the get command to get the value of a config setting.

* Depending on the config setting it can work on any depth of the
setting.

* Added test for the get command.

* Add print tabs

* Remove excess else statements

* Return with the value and remove named return variable

* Refactor the printMap function and return a string, remove side effects

* Improve the error message, use the name argument

* Use app.Config() to create our config object

* Remove reading the file, make helper functions return string and perform printing inside the command

* Remove the tab printing

* Add extra quotes on the output

* Remove extra code for checking arguments and replaced it with cobra.ExactArgs(1)

* Remove buffer from printConfigValues

* Add some tests to check the output of the command

* Write test for the function 'structToMap' and test for complext nested structs

* Write test for the function 'configToMap' and test for complext nested structs

* Write test for the function 'printMap' and test for complext maps as input

* Write test for the function 'printConfigValues' and test for complext maps as input

* Remove commented code

* Update the description of the  command
2018-10-15 10:49:25 -04:00
Julien Levesy
43bdbb0c3a Add a delete brand image action on the APIv4 (#9552) 2018-10-15 15:46:26 +01:00
Alexander Akhmetov
160d278592 GH-9633 Added plugin API method to return user's profile image (#9653) 2018-10-15 16:23:41 +02:00
Hanzei
c1e5fff565 Add GetPostsSince() to plugin API (#9649) 2018-10-15 10:04:22 -04:00
Hanzei
0267a1f76e Add GetPostThread() to plugin API (#9652) 2018-10-15 21:19:36 +08:00
George Goldberg
5726d3919d MM-12419: Flush channels from cache when deleted/restored. (#9625) 2018-10-15 12:58:58 +01:00
Mukul Rawat
481d83a1e7 [MM-12537] Migrate to idiomatic error handling the file app/status.go in the mattermost-server (#9574) (#9589)
* Perform idiomatic error handling

* Golint gives warning when using the variable name 'userId' so change
it to 'userID'

* Change all ID back to Id
2018-10-14 16:24:06 +01:00
Mukul Rawat
38f117ed99 [MM-12606] Migrate to idiomatic error handling in the file app/role.go in the mattermost-server repo. (#9586) (#9593)
* Refactor and make idiomatic changes in error handling
2018-10-13 13:50:05 +01:00
Mukul Rawat
a47c61107b [MM-12607] Migrate to idiomatic error handling in the file app/saml.go in the mattermost-server repo. (#9585) (#9587)
* Refactor function 'GetSamlMetadata'

* Run make check-style, make changes
2018-10-13 13:39:00 +01:00
Jason Mojica
f025e749a9 MM-12355: Add CLI command "command create" (#9569)
* Add create command

* Create CreateCommand Tests

* Change method flag description

* Change nil test assertion
2018-10-13 13:35:00 +01:00
Carlos Tadeu Panato Junior
908ed5555f [APIv4] add getChannelMembersTimezone (#9286)
* add getChannelMembersTimezone

* update per feedback review

* add delimeter to error
2018-10-13 12:35:57 +02:00
Jesse Hallam
e87965f39d MM-11905: delete plugin commands on removal (#9601)
* defer plugin tear down for testing

* test expected plugin command unregistration

* MM-11905: uninstall plugin commands on remove
2018-10-10 10:56:54 -07:00
Daniel Schalla
c36e85c912 DeleteAll for KV (#9431)
Expire K/V Values

Regenerate Code

pathfix

Update Expiry on Update

Check for Exit Signal

gofmt

Rewrote Go Routine

Remove tempoarily cleanup loop

fix expiretime

TEST: Expired Watchdog as GoRoutine

Check if Srv is nil

Use Scheduler/Worker for Expired Key CleanUp

add license

fix scheduler job type; DoJob Restructuring

Remove unused imports and constants

move db migration from 5.4 to 5.5
2018-10-10 10:55:12 -07:00
Akash Srivastava
bd04d7f756 Add GetPostsForChannel method to plugin API (#9557)
Signed-off-by: Akash Srivastava <akash.srivastava@openebs.io>
2018-10-10 09:23:36 -04:00
Harshil Sharma
bffcccf99d Refactored to rename "service terms" to "terms of service" (#9581)
* #124 renamed identififers from service terms to terms of service

* #124 renamed identififers from service terms to terms of service

* 124 renamed ServiceTerms model to TermsOfService

* 124 Renamed EnableCustomServiceTerms feature flag to EnableCustomTermsOfService

* 124 Renamed EnableCustomServiceTerms feature flag to EnableCustomTermsOfService

* #124 fixed formatting

* #124 fixed formatting

* #132 renamed table ServiceTerms to TermsOfService

* #124 renamed some missed files from 'service_terms' to 'terms_of_service'

* #124 removed fixed TODOs

* drop migrate of ServiceTerms table, since backporting

* s/ServiceTerms/TermsOfService/ in tests

* s/AcceptedServiceTermsId/AcceptedTermsOfServiceId/

Change the model attribute, even though the column name will eventually be removed.

* s/accepted_service_terms_id/accepted_terms_of_service_id/ to match redux

* s/serviceTerms/termsOfService

* rename column too, and add max size constraint

* s/EnableCustomServiceTerms/EnableCustomTermsOfService
2018-10-09 20:55:47 -04:00
Jesse Hallam
59319b7915 MM-12519: simplify autocomplete team id checking (#9577)
This handles clients sending a team id in a direct message or group channel autocomplete, when it necessarily won't match. Just verify that the user has permission for the team in question, whenever it is provided.
2018-10-09 12:25:57 -07:00
Simone Salsi
fe9a81208e Added the changes requested for MM-8860: Bulk import email intervals (#8498) (#9578)
MM-8860: Bulk import email intervals (#8498)
2018-10-08 17:01:27 +01:00
George Goldberg
9a4f3ce1e5 MM-12251: Add flag to MoveChannel to remove all deactivated users. (#9515) 2018-10-08 16:39:03 +01:00
Hanzei
7b338c161b MM-12323: Fix trailing slash in ServiceSettings.SiteURL (#9463)
* Fix trailing slash in ServiceSettings.SiteURL

* Add test for LoadConfig

* Fix test

* Simplify test
2018-10-05 12:24:02 -04:00
Jesús Espino
0a68e741d0 Small fix in the webhook list error handling (#9567) 2018-10-05 16:40:26 +02:00
Harshil Sharma
ee1700d6b2 #MM-12130 Added permission check for createServiceTerms API (#9556)
* #MM-12130 changes for custom service terms

* Fixed styling

* Added getServiceTerms API

* removed unnecessary panic

* removed custom service terms text from flat config

* reverted user sql store as those changes are no longer needed

* added tests

* Updated a config key to be more standard

* Added copyright info

* Loading service terms only if the feature is enabled

* Loading service terms only if the feature is enabled

* removed unused index

* added createservice termns API

* made a param to bool instead of string

* added createservice termns API

* review fixes

* fixed styling

* Minor refactoring

* removed saveConfig and loadConfig magic

* added empty service terms text check to createServiceTerms API

* refactoed some urls to be terms_of_service instead of service_terms

* removed check for support settings

* changed URLs in tests

* removed unused code

* fixed a bug

* added service termd id in conif

* fixed a test

* review fixes

* minor fixes

* Fixed TestCreateServiceTerms

* Fix incorrect key in en.json and changes some translations from service terms to terms of service

* Improved translated messages

* Added permission check in createServiceTerms API
2018-10-05 15:26:01 +01:00