Commit Graph

130 Commits

Author SHA1 Message Date
Jesús Espino
89852d04c0 When leave a channel the push notification can fail (#9478) 2018-09-27 15:10:09 +01:00
Jesús Espino
15d64fb201 MM-7188: Cleaning push notification on every read, not only on channel switch (#9348)
* MM-7188: Cleaning push notification on every read, not only on channel switch

* Removed unnecesary goroutine

* Fixing tests

* Applying suggestion from PR
2018-09-26 16:34:12 +02:00
Jesús Espino
c2496911c0 Migrate to idiomatic error handling the first half to the app/channel.go (#9413) 2018-09-17 23:10:57 +02:00
Jesús Espino
4fb7817610 Migrate to idiomatic error handling the second half to the app/channel.go (#9414) 2018-09-17 08:05:05 +02:00
Jesús Espino
e32581aef3 MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337) 2018-09-11 22:45:31 +02:00
Daniel Schalla
531897b1f0 add megacheck as makefile target (#9288)
Fix code issues in channel_test.go

Fix Channel Test Issues detected by Megacheck

Fix API Emoji Test Issues detected by Megacheck

Fixed API Issues Reported by Megacheck

Fixed App issues reported by megacheck

Remaining fixes

removed test added by mistake from old HEAD

gofmt

Store Fixes

simplified returns

Fix test for multi member channel delete

revert to delete unused function
2018-09-03 14:08:40 +02:00
George Goldberg
d2945cdd77 MM-11782: Make archived channels experimental and off-by-default. (#9281)
* MM-11782: Make archived channels experimental and off-by-default.

* Fix test.
2018-08-22 21:12:51 +02:00
Martin Kraft
30ded2489f MM-11510: Adds delete at value to delete channel websocket event. (#9217) 2018-08-04 12:58:41 +02:00
Jesús Espino
61f98d92fa MM-11576: Allow to join and add members to archived channels (#9214) 2018-08-03 17:13:02 +02:00
Jesús Espino
8cc4f27f7c MM-11529: Allow to Leave an archived channel from the API (#9204)
* MM-11529: Allow to Leave an archived channel from the API

* Remove the restriction to remove user from archive channel to yourself
2018-08-03 10:44:32 +02:00
Martin Kraft
5872bf9c2f Pr 9039 (#9187)
* MM-11065: Allow to search and get archived channels from the API

* Fixing more tests

* Add some unit tests

* Add includeDeleted parameter to session permissions check function

* More test fixing

* Adding archive channels list in channels search

* Add restriction for archived channel edition

* Reverting permissions checks modification

* Changed the query parameter to include_deleted

* Enable search archive channels as true by default

* Adding tests for verify search on deleted channels

* Allowing to override archive channels during the imports

* Fixed test

* Search in archive channels from the API must be explicitly requested

* Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam

* Back to ViewArchivedChannels config

* Fixing tests

* Reverting GetChannelByName parameter

* Add include deleted parameter on GetChannel functions in plugins api

* Fixing tests
2018-07-30 15:06:08 -04:00
Daniel Schalla
3539a9a60b Default Channel Functionality + Test Suite (#9068)
gofmt

Make skipping for non public channels default

Deduplication of Default Channels; Only post join to townsquare

Post join channel message for all custom default channels
2018-07-20 17:00:58 -04:00
Druhin Bala
301e7eb1c4 MM-10699 Add channel renaming to CLI (#9094) 2018-07-18 11:49:48 +01:00
JoramWilander
6c7dc2d29c Merge branch 'plugins-2' 2018-07-10 15:01:43 -04:00
George Goldberg
2df818b9c6 MM-11227: Fix group msg slash command. (#9070) 2018-07-10 10:54:49 +02:00
Daniel Schalla
359f12db33 First batch of new plugin api methods (#9022)
update api mocks

Generated new hooks

ChannelHasJoinedChannel Implementation

User Left Team/Channel Hook; User Joined Team Hook Implementation

Update RPC Client and Mocks

gofmt

go tests fix

Add Config API Methods

codegne

Add Channel Has Been Created Hook

Fix ChannelHasBeenCreated hook

fix missing context param

fix duplicate hooks; remove redudandcy
2018-07-06 15:32:55 -07:00
Jesse Hallam
2d7cd02abc MM-10833: send down computed channel props (#8953)
* 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
2018-06-26 16:46:57 -04:00
Jesús Espino
164e030d33 MM-11008: Fix translation and change the code to be auto-extracted (#9009) 2018-06-26 16:06:01 -04:00
George Goldberg
0c4078b6b0 MM-9730 & MM-9729: Missing Server PRs (#8908)
* MM-9730: API endpoint to update scheme-derived roles of TeamMembers.

* MM-9729: API to update scheme-derived roles of ChannelMembers.
2018-06-05 07:41:03 -04:00
Martin Kraft
c180cdbd1c Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-28 10:35:27 -04:00
Saturnino Abril
c37d153ffb [MM-10519] Send websocket event whenever the channel has changed it's type (public|private) (#8798)
* send websocket event whenever the channel has changed it's type (public|private)

* updated per comment

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* add channel_converted websocket event

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* only send channel_id via websocket message for "channel_converted" event

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>
2018-05-28 22:31:08 +08:00
Martin Kraft
f4dcb4edf2 MM-10182 & MM-10183: Adds channel scheme and team scheme API endpoint. (#8680)
* MM-10183: Adds channel scheme API endpoint.

MM-10182: Adds team scheme API endpoint.

MM-10182_3: Switch from scheme_id in path to body.

* MM-10182/MM-10183: Changes path from 'schemes' to 'scheme'.

* MM-10182: Fix merge error.
2018-05-02 07:31:14 -04:00
Martin Kraft
ff6c42309c Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-05-01 18:59:20 -04:00
Christopher Speller
686c2fbab7 Structured logging (#8673)
* Implementing structured logging

* Changes to en.json to allow refactor to run.

* Fixing global logger

* Structured logger initalization.

* Add caller.

* Do some log redirection.

* Auto refactor

* Cleaning up l4g reference and removing dependancy.

* Removing junk.

* Copyright headers.

* Fixing tests

* Revert "Changes to en.json to allow refactor to run."

This reverts commit fd8249e99b.

* Fixing some auto refactor strangeness and typo.

* Making keys more human readable.
2018-04-27 12:49:45 -07:00
Martin Kraft
7294644e9d Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2 2018-04-24 10:21:18 -04:00
Saturnino Abril
3224d2f6a3 add api to convert a channel from public to private and restrict that to system_admin (#8655) 2018-04-23 08:18:58 -04:00
George Goldberg
cd55c44c8f MM-8796: Full implementation of "Schemes" in Store/Model/App layers. (#8357)
* Add Scheme model and stub store.

* Port ChannelStore to be Scheme aware.

* Make almost all the API/APP layer work with ChannelSchemes.

Only thing still hacky is UpdateChannelMemberRoles().

* Add basic SchemeStore implementation.

* Migrate UpdateChannelMemberRoles properly and fix tests.

* Update store tests and mocks so they work.

* Include creating default roles in Scheme create store function.

* Implement role deletion and start scheme deletion.

* Only use non-deleted roles for authorization.

* Add GetByScheme method to Team store.

* Add GetChannelsByScheme.

* Update store mocks.

* Implement scheme deletion in the store.

* Rename is valid function.

* Add offset and limit to queries to fetch teams and channels by scheme.

* Fix queries.

* Implement scheme awareness in Team store and add a migration.

* Tidy up ChannelStore mapping functions and add exhaustive unit tests.

* Add all missing i18n.

* Proper tests for TeamStore internal functions and fix them.

* Make additional TeamMember fields nullable.

* Make new ChannelMember fields nullable.

* Create new nullable columns without defaults.

* Make new fields in large tables nullalble.

* Fix empty list of TeamMembers.

* Deduplicate SQL queries.

* Fix spelling.

* Fix review comment.

* More review fixes.

* More review fixes.
2018-04-20 14:49:13 -04:00
Martin Kraft
4921fda79f MM-10122: Adds a mention for added-to-channel messages even when 'username mentions' are disabled. (#8648) 2018-04-19 11:28:04 +01:00
Elias Nahum
1ebf19825b Fix mute channel when not a member and adding unit tests (#8609) 2018-04-12 09:12:59 -04:00
Jesse Hallam
116849842b MM-8678: add CUD support for channel members via plugins (#8565)
* add CUD support for channel members via plugins

This effectively exposes AddChannelMember, UpdateChannelMemberRoles,
UpdateChannelMemberNotifyProps and LeaveChannel via the plugin API.

It also modifies the semantics of AddChannelMember to explicitly allow
for an empty user requestor, left as such for now via the plugin API.

* change the signature of AddChannelMember to accept a channel id instead of a channel
2018-04-06 17:08:57 -04:00
Jesús Espino
014a3b6a60 Fixing misspell errors (#8544) 2018-03-29 10:04:54 -04:00
Christian Claus
257f748732 [PLT-4340] Channel Mute and "/mute" command #7617 (#7713)
* Add command and store changes to allow mute toggling

* Change channel muting to use ChannelMember notification structure

* Suppress email and push notifications for a muted channel

* Make i18n keys issue-compliant

* Add notification-cache handling for channel-muting

* Add channel handle for channel-muting slash-command

* Add unit test for mute command

* Merge branch 'master' into PLT-4340

# Conflicts:
#	app/notification.go

* Fix issue that command_mute responses will be overwritten

* Fix i18n key for channel muting

* Apply new Provider Interface to MuteCommand

* Migrate mute notification property to mark_unread

PLT-4340

* Make some i18n improvements for command_mute

PLT-4340

* Remove de.json translations

* Prevent push notifications when channel is muted

* Treat Group messages like Direct messages

* Fix unit test

* Send WS event when the channel member notify props changed
2018-03-28 07:02:04 +03:00
George Goldberg
71c9dff766 Merge branch 'advanced-permissions-phase-1' 2018-03-27 22:36:55 +01:00
Saturnino Abril
07b14c370a post a system message after a channel is converted from public to private (#8501) 2018-03-27 21:14:42 +08:00
George Goldberg
fadcdd271a Merge branch 'master' into advanced-permissions-phase-1 2018-03-13 13:36:23 +00:00
Chris
e8943936c5 general cleanup (#8387) 2018-03-07 12:36:40 -06:00
Jonathan
d448a6bef3 XYZ-87: GlobalRelay DM Exports do not Include Channel Name (#8275)
* Adding ChannelMemberHistory table records when DM channels are created. This ensures that both participants in a DM are shown in compliance export, even if only one of them typed anything

* Direct/Group Message channels now get pretty display names for the purpose of compliance exports

* Fixed string formatting in t.Fatal calls

* Changed uses of ChannelMemberHistory over to ChannelMemberHistoryResult in tests. This should have been done as a part of the work in XYZ-110, but seems to have been missed in this branch for some reason
2018-03-07 15:54:51 +00:00
Philippe GRANET
09713ff4ea Add addedUser IDs to render correctly in client based on teammate name display setting (#8400)
See PLT-7776 on mattermost-webapp:
https://github.com/mattermost/mattermost-webapp/pull/353
2018-03-07 21:00:35 +08:00
Chris
4ebf974690 remove go Publish(...) idiom (#8373) 2018-03-02 16:49:18 +00:00
Jesús Espino
a04b02081a Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1 2018-02-07 18:05:23 +01:00
Vordimous
7bd298ceaa PLT-7537: Move channel CLI command posts system message to channel. (#8161)
* [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
2018-02-07 14:17:18 +00:00
George Goldberg
7941c30117 Merge branch 'master' into advanced-permissions-phase-1 2018-02-06 17:25:53 +00:00
George Goldberg
e1cd646135 XYZ-37: Advanced Permissions Phase 1 Backend. (#8159)
* XYZ-13: Update Permission and Role structs to new design.

* XYZ-10: Role store.

* XYZ-9/XYZ-44: Roles API endpoints and WebSocket message.

* XYZ-8: Switch server permissions checks to store backed roles.

* XYZ-58: Proper validation of roles where required.

* XYZ-11/XYZ-55: Migration to store backed roles from policy config.

* XYZ-37: Update unit tests to work with database roles.

* XYZ-56: Remove the "guest" role.

* Changes to SetDefaultRolesFromConfig.

* Short-circuit the store if nothing has changed.

* Address first round of review comments.

* Address second round of review comments.
2018-02-06 15:34:08 +00:00
Chris
e0ee73ef99 ABC-79: Optimize channel autocomplete query (#8163)
* optimize channel autocomplete query

* move to new autocomplete endpoint
2018-01-31 09:26:40 -05:00
Harrison Healey
195ad56204 Merge branch 'release-4.6' 2018-01-23 15:07:31 -05:00
Evgeniy
9d6a9ff4be Post a system message to the affected channel by CLI command (#7877) (#7968) 2018-01-18 16:05:00 -05:00
Joram Wilander
e9a9262956 Handle missed case with ExperimentalEnableDefaultChannelLeaveJoinMessages setting (#8112) 2018-01-18 11:52:16 -05:00
Chris Duarte
0a9200c35d Add EnableDefaultChannelLeaveJoinMessages config setting (#7961) 2018-01-10 14:04:04 -08:00
Harrison Healey
90abd76d3f PLT-8522 Added separate messages for being removed from channel or team (#8078) 2018-01-10 12:22:51 -07:00
Siyuan Liu
c39788b64b Do not auto-join 'off-topic' channel if it is private (#7950) 2017-12-13 12:50:07 -06:00