Commit Graph

147 Commits

Author SHA1 Message Date
Rodrigo Villablanca Vásquez
54d62dbadf Migrates Channel.IncrementMentionCount to sync by default (#11237)
* Migrates Channel.IncrementMentionCount to sync by default

* Calls to Channel.IncrementMentionCount are concurrent now
2019-06-25 11:13:39 +01:00
Shota Gvinepadze
075eadb040 Migrate 'Channel.GetAllChannelMembersNotifyPropsForChannel' to Sync by default (#11248) 2019-06-18 15:56:29 +02:00
Giorgos Christos Dimitriou
bbdd6927de Ongoing changes to notification.go (#11047)
* Change the functions that are used only by `notification.go` from public
to private

* Split getExplicitMentions() into smaller functions.
- addMentionedUsers
- checkForMention
- isKeywordMultibyte
- processText

along with their tests.

* Merge with master
Fix wording on isKeywordMultibyte() function comment
2019-06-15 15:44:11 +02:00
Elias Nahum
be935cee4e Revert "MM-10867 Split GetExplicitMentions function to several smaller ones (#10492)" (#10895)
This reverts commit fb01d37846.
2019-05-20 16:37:55 -03:00
Giorgos Christos Dimitriou
fb01d37846 MM-10867 Split GetExplicitMentions function to several smaller ones (#10492) 2019-05-17 16:23:56 +02:00
Martin Kraft
8d8a4d8614 MM-15485: In-channel system behaviour for at-mentions and slash commands for group-constrained channels. (#10855)
* MM-15108: Prevent non-group-members from being added to group-constrained channels.

* MM-15485: Updates ephemeral message when non-group member is invited to group-constrained channel.

* MM-15485: Prevent group-permitted members from being removed from group-constrained channels. Show custom ephemeral when attempting /kick or /remove.
2019-05-17 12:43:19 +01:00
Jesús Espino
beb7592c93 Migrate FileInfo store to Sync by default (#10837) 2019-05-15 22:07:03 +02:00
Elias Nahum
5b252e8736 Tracking Push Notifications in a structured logger (notifications.log) (#10823)
* Remove NotificationRegistry table and use structured logging

* Fix ackId for notification sent

* Notification logger at server level

* Remove unused i18n strings
2019-05-13 07:53:46 -07:00
Elias Nahum
e6be06b3fc MM-14289 & MM-14884 Push notification acknowledge id and include sender name (#10736)
* MM-14289 Add Push notification acknowledge identifier and store tracing logs

* MM-14884 include SenderName property in Push Notifications

* Remove @ sign from channel Name in push notifications

* Fix i18n

* Fix push notification model

* fix TestPostNotificationGetChannelName

* Remove colon from model constant

* Fix Notification Registry tests

* Make postId optional for clear notifications

* Update http status when service is not available

Co-Authored-By: enahum <nahumhbl@gmail.com>
2019-04-30 18:15:29 -04:00
Jesús Espino
c8920588a0 Adding new "VIEW_MEMBERS" permissions restrict the scope of users visibility (#10487)
* MM-14138: Adding new "VIEW_MEMBERS" permissions restrict the scope of users visibility

* Fixing gofmt

* Fixing broken tests

* Addressing PR review comments from Miguel de la Cruz

* Removed hack

* A bit nicer and cleaner code in the UserBelongsToChannels function

* Adding cluster cache invalidation for user team ids

* Checking in the correct order permissions to not leek existency information

* Adding restrictions to TeamMembers and User status requests

* Fixing tests

* Fixing status endpoint permissions checks

* Adding more tests

* Fixing tests

* More tests and making the restrictions query based only on joins

* Adding more tests

* Adding more tests

* fixing merge problems

* Reverting status changes to avoid performance issues

* Adding more tests

* Fixing test

* i18n extract

* Adding extra method for get restrictions for a team

* Add the new elasticsearch functions to search users with restrictions

* Add missing translation string

* Rename restrictedChannelIds to restrictedToChannels

* Remove ToDo

* Adding the permission to the SystemAdmin role during permissions migrations
2019-04-29 16:56:56 +02:00
Joram Wilander
b24013d54c MM-14882 Filter out inactive users from out of channel/group mentions (#10685)
* Add FilterByActive to UserSlice type

* Filter out inactive users from out of channel/group mentions
2019-04-25 08:45:03 -04:00
Martin Kraft
1b9d937962 MM-15201: Don't check for non-members unless the channel is group-constrained. (#10657) 2019-04-20 19:53:50 +02:00
Martin Kraft
84a59ddb39 MM-14417: Messaging for mentions of users who are not in associated channel groups. (#10594)
* MM-14417: Adds support for out-of-channel notifications of users who are not in associated groups of group-constrained channels.

* MM-14417: Fix for mobile backwards compatibility.
2019-04-17 10:44:45 -04:00
Yusuke Nemoto
74c2759117 Trigger mentions for keyword including multibyte characters in sentences (#10262) 2019-03-08 15:44:25 +08:00
Joram Wilander
2ca222033c MM-10658 Change config fields to pointers (#9033)
* MM 10658 Change config fields to pointers (#8898)

* Change fields of config structs to pointers and set defaults

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Fix tests that go broken during switching config structs to pointers

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Apply changes of current master while switching config structs to pointers

MM-10658 https://github.com/mattermost/mattermost-server/issues/8841

* Fix new config pointer uses

* Fix app tests

* Fix mail test

* remove debugging statement

* fix TestUpdateConfig

* assign config consistently

* initialize AmazonS3Region in TestS3TestConnection

* initialize fields for TestEmailTest

* fix TestCheckMandatoryS3Fields
2019-01-31 08:12:01 -05:00
Jesús Espino
5a37a606fc MM-12941: Fixed problem with not-in-channel mentions users (#9974) 2018-12-11 14:01:38 +01:00
George Goldberg
09eae76c00 Use constants for NotifyProps keys. (#9901)
We have constants for (most) of the notify props keys. We should use
them consistently, instead of sometimes and other times having strings
scattered around the place.
2018-11-28 11:11:41 -05: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
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
Harrison Healey
d07def5169 Merge branch 'master' into post-metadata 2018-11-14 09:58:56 -05: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
Christopher Speller
ecade2f1ec MM-12849 Moving all non request scoped items to Server struct (#9806)
* Moving goroutine pool

* Auto refactor

* Moving plugins.

* Auto refactor

* Moving fields to server

* Auto refactor

* Removing siteurl duplication.

* Moving reset of app fields

* Auto refactor

* Formatting

* Moving niling of Server to after last use

* Fixing unit tests.
2018-11-07 10:20:07 -08:00
Harrison Healey
48f16b6401 MM-11272 Added initial post metadata (#9175)
* MM-11272 Added app.PreparePostForClient

* MM-11272 Added app.PreparePostListForClient

* MM-11272 Added EmojiStore.GetMultipleByName

* MM-11272 Added emojis to PreparePostForClient

* MM-11272 Added unit tests for getting reaction counts

* MM-11272 Added unit tests for TestPreparePostForClient

* MM-11272 Added emojis from reactions to Post.Emojis

* MM-11272 Always update post.UpdateAt when reactions change to bust cache

* Fixed merge conflicts

* Moved post metadata-related code into its own file

* Update store mocks

* Fixed typo

* Add missing license headers

* Updated post metadata tests when custom emojis are disabled

* Fix unreliable unit tests

* Fix inconsistent casing in SQL statements

* Fix blank line

* Invalidate store cache after making changes

* Clear post cache synchronously with reactions
2018-11-01 15:22:33 -04:00
Chris Duarte
f23eeb56c7 Fix for OOO bug that reply message does not get inserted consistently. (#9742) 2018-10-30 14:30:15 -07:00
Jesús Espino
a6fa2b72d1 Migrate to idiomatic error handling app/notification*.go (#9487) 2018-10-01 10:22:31 +02:00
Harrison Healey
6c2a5555b8 MM-11700 Clean up handling of user display names for notifications (#9343)
* MM-11700 Clean up handling of user display names for notifications
2018-09-18 00:20:12 +05:30
Carlos Tadeu Panato Junior
35c148d255 fixing log messages (#9341)
* fixing log messages

* update per review

* Update notification.go

* Update server.go

* Update notification.go
2018-09-17 09:29:04 +02:00
Sudheer
570c52b4cc MM-11710 Add a check to webhook messages to populate username from DM channel for email subject (#9314) 2018-08-30 13:07:36 +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
Elias Nahum
b728b16f90 send channel wide push notification type when at-here is used (#9209) 2018-08-02 09:40:46 -04:00
Jesús Espino
08e54ed824 Split notifications file into different files (#9164) 2018-07-28 19:20:44 +02:00
Yusuke Nemoto
6104c37761 Break HTML blocks to individual strings (#8903)
* Modifying message and templates about mfa_change

* Modifying message and templates about password_change

* Modify message and template about password_reset

* Modify message and template about singin_change

* Modify message and template about email_info

* Modify message and template about change_username

* Modify message about change_email

* Add missing props

* Add argument

* Modify message and template about token_added

* Modify messages and template about notification_email

* Modify message and template about deactivate_email

* Fix style

* Remove unused message

* Remove br tags

* Modify message and code about invite_mail

* Add missing message
2018-07-20 12:52:20 -04:00
Chris Duarte
62c64594cc Add localized timestamp support for email notification (#8674)
* Add localized timestamp support for email notification

* Move localTime logic over to getFormattedPostTime
2018-07-13 14:10:34 -04:00
cpanato
adc56ae78d Merge remote-tracking branch 'upstream/release-5.1' into release-5.1-daily-merge-20180712 2018-07-12 19:50:16 +02:00
Pradeep Murugesan
06abe98ba9 GH-8964 enable notification for text and preText fields in Attachments (#9069) 2018-07-11 10:11:36 -04:00
Elias Nahum
00abe3a136 push notifications follow teammate name display user or server setting (#9049)
* push notifications follow teammate name display user or server setting

* Feedback review
2018-07-11 15:01:49 +02:00
Elias Nahum
4f2bbc3448 Add back the ability to reply to push notifications in iOS (#8977) 2018-06-21 11:10:29 -04:00
Daniel Schalla
ed59e2b735 Skip notifications for expired sessions (#8934) 2018-06-08 14:49:36 -04:00
Carlos Tadeu Panato Junior
3d262bfc8d Relese5.0 merge master 20180607 (#8927)
* Add missing diagnostics (#8911)

* Update diagnostics.go

* Update diagnostics.go

* Fix push notification styling backwards compatibility (#8913)
2018-06-07 15:52:07 +02:00
Harrison Healey
bca7339e4c MM-10597 Improved handling of punctuation around notifications (#8901) 2018-06-05 19:34:21 +02:00
Elias Nahum
e39f5f46f3 Push notification styling improvements (#8818)
* Push notification styling improvements

* Fix unit tests
2018-05-30 10:11:19 -07:00
Chris Duarte
792dae23ca Avoid emails if user status is OOO or post is an auto response (#8842) 2018-05-28 19:49:28 +02:00
Ugurcan Turkdogan
02f8c18f40 Update email notification subject line and contents for Group Messages (#8689)
Reordered notification strings

MM-10335 Changed uppercase CHANNEL to Lowercase Channel, added @ sign before username on notifications

Added @ sign in front of username in all email notifications.
Capitalized Direct Message and Group Message in email notifications.
Fixed the issue with long group message names.

Removed executable bit
2018-05-15 16:43:59 -04:00
Saturnino Abril
4ce37601a1 add notification when @user, @here, @all and @channel has colon ":" at the end (#8760) 2018-05-11 12:57: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
Joram Wilander
514033f14c Fix panics caused by race in notification code (#8652) 2018-04-19 11:21:33 -03: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
George Goldberg
5511106d93 MM-9918: Trim trailing / from push proxy URL. (#8635) 2018-04-17 07:13:16 -07:00
Stan Chan
7826774a14 Add Auto Responder handler (#8386)
WIP Out Of Office

Return error for status command if user status is OOO

Ignore notifications if Out Of Office

Disable AutoResponder if status is set to online

Add test for AutoResponder

DisableAutoResponse when manually setting status

Remove check on status slash command

return early if user does not exists in SendAutoResponse method

Add proper error handling

Add a newline after error handling

Revert back to err == nil in api4/status.go

Remove a.Go when using a.Publish

Add name consistency with the feature auto responder

Last changes for name consistency, also fix failing test with auto_responder

Fix names of functions in auto responder test

Add ExperimentalEnableAutomaticReplies flag

Auto Responder reply to a post
2018-04-12 15:02:36 -04:00
Harrison Healey
2d0fef4d94 MM-10036 Ensured correct handling of capitalized special mentions (#8607) 2018-04-11 10:33:20 -04:00