Commit Graph

10407 Commits

Author SHA1 Message Date
Sergey Shpak
6232ff3738 Migrate to idiomatic error handling in app/slackimport.go (#9694)
* MM-12610 Migrate to idiomatic error handling in the file  in the mattermost-server repo (#9686)

*  MM-12610 Migrate to idiomatic error handling in the file in the mattermost-server repo (mattermost#9686)

*  MM-12610 Migrate to idiomatic error handling in the file in the mattermost-server repo (#9686)
2018-10-23 11:36:24 +01:00
Hanzei
cd4abefecd Migrate to idiomatic error handling in app/user.go (#9711) 2018-10-22 19:30:27 +01:00
Jason Simmons
1ee872578c GH-9636 plugins api GetUsersInChannelByStatus (#9645)
* adds GetUsersInChannelByStatus to plugin api with generated rpc code.

* fixed typo in comment with actual func name

* replaced Response model with AppError in output of GetUsersInChannelByStatus

* removed etag param from GetUsersInChannelByStatus since it is not used

* plugin api for GetUsersInChannelByStatus updated to take the limit, conforming to the app api.

* fixed an issue in my own logic on app/plugin integration.

* adds GetUsersInChannelByStatus to plugin api with generated rpc code.

* fixed typo in comment with actual func name

* replaced Response model with AppError in output of GetUsersInChannelByStatus

* removed etag param from GetUsersInChannelByStatus since it is not used

* plugin api for GetUsersInChannelByStatus updated to take the limit, conforming to the app api.

* fixed an issue in my own logic on app/plugin integration.

* GetUsersInChannelByStatus changed to more generic GetUsersInChannel which takes a sortBy parameter, allowing for more granular/extensible sorting functionality in the future

* GetUsersInChannel accepts sort parameter of 'username' and 'status'. Both values are consts in model pkg.

* Documents minimum server version for GetUsersInChannel.

* adds GetUsersInChannelByStatus to plugin api with generated rpc code.

* fixed typo in comment with actual func name

* replaced Response model with AppError in output of GetUsersInChannelByStatus

* removed etag param from GetUsersInChannelByStatus since it is not used

* plugin api for GetUsersInChannelByStatus updated to take the limit, conforming to the app api.

* fixed an issue in my own logic on app/plugin integration.

* adds GetUsersInChannelByStatus to plugin api with generated rpc code.

* Resolved conflict on rebase

* replaced Response model with AppError in output of GetUsersInChannelByStatus

* removed etag param from GetUsersInChannelByStatus since it is not used

* plugin api for GetUsersInChannelByStatus updated to take the limit, conforming to the app api.

* fixed an issue in my own logic on app/plugin integration.

* GetUsersInChannelByStatus changed to more generic GetUsersInChannel which takes a sortBy parameter, allowing for more granular/extensible sorting functionality in the future

* GetUsersInChannel accepts sort parameter of 'username' and 'status'. Both values are consts in model pkg.

* Documents minimum server version for GetUsersInChannel.

* replaces GetUsersInChannel from #9608 / #9643 with sortBy functionality
2018-10-22 08:49:50 -04:00
Hanzei
6c6638f05e GH-9688: Migrate to idiomatic error handling in app/post.go (#9697)
* Migrate to idiomatic error handling in app/post.go

* Revert import changes
2018-10-19 16:29:39 +01:00
Hanzei
2c849c7998 Migrate to idiomatic error handling in app/web_conn.go (#9709) 2018-10-19 13:31:20 +01:00
Artur Mogozov
c3993704ef MM-12372 Add modify-incoming webhook command (#9683)
* MM-12372 Add modify-incoming webhook command

* Review comments
2018-10-19 12:04:12 +01:00
S4KH
c3d536c644 GH-9619 GetEmojiImage added to plugin API (#9628)
* GH-9619 conflict fix

* GH-9619 fixed conflicts, version comment
2018-10-18 16:07:21 -04:00
Jesse Hallam
d1805733fe MM-12505: remove all things WebRTC (#9700) 2018-10-18 14:49:10 -03:00
Hanzei
a708c33520 Migrate to idiomatic error handling in app/preference.go (#9594) 2018-10-18 17:15:30 +01:00
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