Commit Graph

60 Commits

Author SHA1 Message Date
Eli Yukelzon
cf4df5fcd2 MM-30048 added thread related socket messages (#16234)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-11-20 11:00:52 +02:00
Agniva De Sarker
4758408699 MM-29979: make websocket writes zero-alloc (#16115)
This reverts commit 31dac80e66.
2020-11-04 10:05:10 +05:30
Nick Misasi
90738de75f Add webhook event for when user status changes from activated to deactivated and vice versa (#15990)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-19 10:29:43 -04:00
Devin Binnie
9b1dee7087 [MM-29723] Added websocket event constant for updating the payment status for cloud (#15988) 2020-10-16 13:23:49 -04:00
catalintomai
549e5b57cd Add metric warning support (announcement bar and DM) (#14483)
* Admin. Advisory: Add warning for number of active users metric status

Co-authored-by: Catalin Tomai <catalin.tomai@mattermost.com>
2020-07-22 20:32:21 -07:00
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
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
Farhan Munshi
b29b70da09 MM-23605 Create new team scheme updated socket event (#14305) 2020-04-27 13:26:52 -04:00
Martin Kraft
4d99aa22ba MM-22212 & MM-22208: Read from the higher-scoped scheme if the permission is non-moderated. (#13813)
* MM-22212: Read non-moderated permissions from higher-scoped scheme.

* MM-2212: Corrects test count in comment.

* MM-22212: Adds godoc comment.

* MM-2212: Switches to the channel roles check in a few more places.

* MM-22212: Refactors and fixes.

* MM-22212: Reverts change, no longer required.

* MM-22212: Removes translation.

* MM-22212: Un-comments merged new permission.

* MM-22212: Un-comments merged new permission.

* MM-22212: Performance tweak.

* MM-22212: Fixes some fmting.

* MM-22212: Add unit test for newly-added store methods.

* MM-22212: Renames app method.

* MM-22212: Re-uses existing function to find string in slice.

* MM-22212: Keeps 'higher-scoped' terminology for consistency.

* MM-22212: Refactors based on PR feedback.

* MM-22212: Fix for some bad merging.

* MM-22212: Renamed some things.

* MM-22212: Use an 'else' instead of a 'continue' for readability.

* MM-22212: Caches (*SqlRoleStore).ChannelRolesUnderTeamRole.

* MM-22212: Adds mock to new cache store.

* MM-22212: Adds missing open tracing app layer methods.

* MM-22212: Adds migration to add moderated permissions to channel_admin if present on channel_user.

* MM-22212: Migrates team schemes. Removes unused AppError.

* MM-22212: Fix for for if.

* MM-22212: Fixes iterator.

* MM-22212: Updates open tracing generated methods.

* MM-22212: Fix mocks.

* MM-22212: Change migration key name.

* MM-22212: Switched to data structure from other branch.

* MM-22212: Fixes tests after adding 'use_channel_mentions' to the channel_admin role.

* MM-22212: Adds tracking of channel moderation.

* Revert "MM-22212: Adds tracking of channel moderation."

This reverts commit 23689efa22.

* MM-22212: Switch some functions to methods and vice versa.

* MM-22212: Fix for refactor bug not notifiying websocket about changed role.

* MM-22212: Adds test for public/private 'manage_members' handling.

* MM-22122 Fix manage channel members edge case for public and private channels (#14049)

* MM-22212: Adds moderated permission to team_admin.

* MM-22212: Updates migration.

* MM-22212: Revert unnecessary update to default roles.

* Add channel scheme updated event when channel scheme is deleted or created (#14057)

* MM-22212: Adds newline.

* MM-22212: Migration fix.

* MM-22212: Fix for migration.

* MM-22212: Test fix.

Co-authored-by: Farhan Munshi <3207297+fm2munsh@users.noreply.github.com>
2020-03-23 13:44:20 -04:00
Agniva De Sarker
2a28edcd93 MM-21481: Fixed several issues from user marshalling (#13627)
* MM-21481: Fixed several issues from user marshalling

- Fixed the root cause for panic by properly converting
the map to a User struct.
- Added a check for type conversion for extra safety.
- Fixed a somewhat unrelated issue of a pointer to pointer reference.

* Fix tests
2020-01-16 09:18:08 +01:00
Allen Lai
1909fd6607 [MM-20804] Add "Unarchive Channel" option to the channel info screen (#13349)
* add websocket hooks to restoreChannel

* add userId to call in api4

* add constant

* undo changes in en.json

* add constants to en.json

* delete  code for deleting webhooks

* Update i18n/en.json

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>

* restore channel ordering

* delete Props

* Update app/channel.go

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>

* Update app/channel.go

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>

* change message format

* move WS message right after invalidate

* manually reorder en.json entry

* reorder en.json

* undelete to restore

* update en.json ordering

* update wording

* Update model/post.go

Co-Authored-By: Saturnino Abril <saturnino.abril@gmail.com>

* Update model/websocket_message.go

Co-Authored-By: Saturnino Abril <saturnino.abril@gmail.com>

* gofmt

* undeleted to restored

* add test to success case

* delete repeated test

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-09 09:42:29 +01:00
Jesús Espino
092e53ace2 Fix inconsistencies in variable names for struct methods (#13561) 2020-01-07 10:47:03 +01:00
Agniva De Sarker
f2a14ae976 Added some godocs to a few websocket related structs (#13451)
* Added some godocs to a few websocket related structs

* Incoporate review comments

* Fix more review comments
2019-12-24 08:51:03 -05:00
Claudio Costa
80dd2915db [MM-19914] Fix data races in WebSocketEvent (#13039)
* Make WebSocketEvent type immutable

* Update code to use updated immutable WebSocketEvent type

* Export WebSocketEvent fields and mark them as deprecated
2019-12-24 09:32:11 +01:00
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
Harrison Healey
de913e7537 Merge branch 'master' into mark-as-unread 2019-11-19 09:45:03 -05:00
Jesús Espino
7031f51b41 Deactivating and invalidating sessions of guest users on guest disable (#13007)
Automatic Merge
2019-11-15 09:43:52 -05:00
Guillermo Vayá
c1eba4fa1e [MM-17068] send mark as unread event through websocket (#12074) 2019-09-20 14:27:31 -04:00
Ashutosh Kumar
9b952dce27 Team restore cli command (#9551)
Adds cli for team restore and team archive.
2019-01-28 13:04:19 +01: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
Jesse Hallam
d1805733fe MM-12505: remove all things WebRTC (#9700) 2018-10-18 14:49:10 -03:00
Joram Wilander
7bfb5aec26 Add back enable/disable WS events (#9052) 2018-07-05 07:23:55 -07:00
Christopher Speller
1e5c432e10 MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin.

* Tweaks from feedback.
2018-06-25 12:33:13 -07: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
Jesse Hallam
847c181ec9 MM-8622: Improved plugin error reporting (#8737)
* allow `Wait()`ing on the supervisor

In the event the plugin supervisor shuts down a plugin for crashing too
many times, the new `Wait()` interface allows the `ActivatePlugin` to
accept a callback function to trigger when `supervisor.Wait()` returns.
If the supervisor shuts down normally, this callback is invoked with
a nil error, otherwise any error reported by the supervisor is passed
along.

* improve plugin activation/deactivation logic

Avoid triggering activation of previously failed-to-start plugins just
becase something in the configuration changed. Now, intelligently
compare the global enable bit as well as the each individual plugin's
enabled bit.

* expose store to manipulate PluginStatuses

* expose API to fetch plugin statuses

* keep track of whether or not plugin sandboxing is supported

* transition plugin statuses

* restore error on plugin activation if already active

* don't initialize test plugins until successfully loaded

* emit websocket events when plugin statuses change

* skip pruning if already initialized

* MM-8622: maintain plugin statuses in memory

Switch away from persisting plugin statuses to the database, and
maintain in memory instead. This will be followed by a cluster interface
to query the in-memory status of plugin statuses from all cluster nodes.

At the same time, rename `cluster_discovery_id` on the `PluginStatus`
model object to `cluster_id`.

* MM-8622: aggregate plugin statuses across cluster

* fetch cluster plugin statuses when emitting websocket notification

* address unit test fixes after rebasing

* relax (poor) racey unit test re: supervisor.Wait()

* make store-mocks
2018-05-23 14:26:35 -04:00
Joram Wilander
283f34b9c6 MM-10007 Send an admin and regular WS events when a user is updated (#8588)
* Add user.DeepCopy() function

* Add omit admins/non-admins to WS broadcast and use for updating users

* Updates per feedback and adding unit test for ShouldSendEvent
2018-04-20 08:44:18 -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
fadcdd271a Merge branch 'master' into advanced-permissions-phase-1 2018-03-13 13:36:23 +00:00
Jesse Hallam
fbff94f3be MM-8604: emit config/license websocket events (#8371) 2018-03-05 12:18:22 +00:00
George Goldberg
901acc9703 Merge branch 'master' into advanced-permissions-phase-1 2018-03-02 15:55:03 +00:00
Chris
19a5d0047d MM-8710: Web Hub optimizations (#8293)
* webhub optimizations

* test fix

* minor fix

* big perf improvement to ToJson after precomputing

* fix hub connection count
2018-02-20 10:50:10 -08: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
Saturnino Abril
5d7ae48841 [PLT-8494] Add delete_team websocket event (#8167)
* add delete_team websocket event

* add to PermanentDeleteTeam
2018-02-01 09:46:24 -05:00
Chris
0c8968fb8d unnamed return (#8170) 2018-01-30 15:23:00 -08:00
Joram Wilander
06ec648cf3 PLT-7978 Add websocket event for user role update (#7745)
* Add websocket event for user role update

* Fix tests

* More test fixes
2017-10-31 16:00:21 +00:00
Joram Wilander
2628022275 PLT-7622 Improvements to server handling of webapp plugins (#7445)
* Improvements to server handling of webapp plugins

* Fix newline

* Update manifest function names
2017-09-15 08:51:46 -04:00
Nick Frazier
cc3a95fdd9 Added websocket event and webapp handler for updating user roles (#6953) 2017-07-27 08:15:50 -04:00
Corey Hulen
eb7561e05b PLT-6610 sending websocket event for last channel viewed (#6787) 2017-06-29 07:51:15 -07:00
VeraLyu
33eb77b757 PLT-3711: Add websocket event for emoji addition (#6211)
* PLT-3711: Add websocket event for emoji addition

* (SA) updated as per review

This PR is edited directly to merge into master.

* (SA) updated as per review

This PR is edited directly to merge into master.
2017-06-23 19:09:17 -04:00
Carlos Tadeu Panato Junior
1e84e931ec when a channel is update propagate the channel to everybody (#6677) 2017-06-21 13:01:05 -07:00
Corey Hulen
e62afeace0 Adding slow pump detection to web_conn and better metrics (#6114)
* Adding slow pump detection to web_conn and better metrics

* Fixing bad merge

* Fixing typo
2017-04-21 12:38:26 -04:00
Harrison Healey
1a0f8d1b3c PLT-1384 Added websocket event when preferences are updated/deleted (#6107) 2017-04-20 13:57:31 +01:00
Harrison Healey
fb6f2a123c PLT-5860 Updated copyright date (#6058)
* PLT-5860 Updated copyright date in about modal

* PLT-5860 Updated copyright notice in JSX files

* PLT-5860 Updated copyright notice in go files

* Fixed misc copyright dates

* Fixed component snapshots
2017-04-12 08:27:57 -04:00
George Goldberg
9609a9b89a PLT-6196: Websocket message when added to a team. (#5968) 2017-04-04 08:26:40 -07:00
Joram Wilander
95da05a8c9 PLT-5750 Add sequence number to websocket connections and events (#5907)
* Add sequence number to websocket connections and events

* Copy pointer instead of pass by value and use int64 over uint64

* Add more logging to missed events
2017-04-01 11:39:13 -04:00
Joram Wilander
3a91d4e5e4 PLT-3077 Add group messaging (#5489)
* Implement server changes for group messaging

* Majority of client-side implementation

* Some server updates

* Added new React multiselect component

* Fix style issues

* Add custom renderer for options

* Fix model test

* Update ENTER functionality for multiselect control

* Remove buttons from multiselect UI control

* Updating group messaging UI (#5524)

* Move filter controls up a component level

* Scroll with arrow keys

* Updating mobile layout for multiselect (#5534)

* Fix race condition when backspacing quickly

* Hidden or new GMs show up for regular messages

* Add overriding of number remaining text

* Add UI filtering for team if config setting set

* Add icon to channel switcher and class prop to status icon

* Minor updates per feedback

* Improving group messaging UI (#5563)

* UX changes per feedback

* Update email for group messages

* UI fixes for group messaging (#5587)

* Fix missing localization string

* Add maximum users message when adding members to GM

* Fix input clearing on Android

* Updating group messaging UI (#5603)

* Updating UI for group messaging (#5604)
2017-03-02 17:48:56 -05:00
enahum
48f97a5a2a PLT-5653 Fix Create channel does not show in another device (#5548) 2017-02-27 15:41:12 -05:00
Joram Wilander
ff741740ee Increase performance when receiving messages (#5375) 2017-02-13 09:27:28 -05:00
enahum
999d1553e1 PLT-4167 Team Sidebar (#4569)
* PLT-4167 Team Sidebar

* Address feedback from PM

* change route from my_members to members

* bug fixes

* Updating styles for teams sidebar (#4681)

* Added PM changes

* Fix corner cases

* Addressing feedback

* use two different endpoints

* Bug fixes

* Rename model and client functions, using preferences to store last team and channel viewed

* Fix mobile notification count and closing the team sidebar

* unit test, fixed bad merge and retrieve from cached when available

* bug fixes

* use id for last channel in preferences, query optimization

* Updating multi team css (#4830)
2016-12-19 08:05:46 -05:00