Commit Graph

2602 Commits

Author SHA1 Message Date
Miguel de la Cruz
42157fafa2 [MM-30980] Avoid modifying original post when sending a notification (#17697)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-06-03 12:52:29 +02:00
Agniva De Sarker
964c2b06db Fix some semgrep issues (#17695)
Automatic Merge
2021-06-01 16:27:20 +02:00
Ibrahim Serdar Acikgoz
ac3bb2e811 user service: initial implementation (#17668)
* conceptual user service: initial commit

* reflect review comments

* fix i18n issues and some tests

* implement get user methods

* add license

* reflect review comments
2021-06-01 14:52:55 +03:00
Manoj
226e60810f Custom status expiry (#17570)
* Added expiry support in custom status APIs (#11)

* Added expiry support in custom status APIs
Added validation for the duration and expiration time in request body
Made enum for the custom status durations

* Fixed the bug in expiry validation with dont clear validation

* Fixed review comments
Converted the durations enum to map
Removed extra if-else

* Added expiry support in custom status slash command (#17)

* Added expiry support in custom status slash command

* Added the check for timezone enabled in expiry time in custom status slash command

* Review fixes
Changed name of calculateExpriryTime to calculateEndOfDay
Made function SetDefaultEmoji for settting default emoji in set custom status API

* Added support for empty duration in custom status APIs
Made one of emoji and text required and duration optional in set custom status API
Made default duration dont clear in both API and slash command

* Changed value of ExpiresAt field in custom status slash command

* Code refactoring
Combined SetDefaults and TrimMessage into 1 function PreSave
Refactored isExpirationTimeValid function

* Used model variables instead of new variables in custom status slash command

* Modified behaviour of set custom status APIs (#19)

Removed dont_clear from validCustomStatusDuration map
Added logic to set duration custom date/time if only expires_at is specified in the body
Made function AreDurationAndExpirationTimeValid in custom status model

* Trigger CI build
2021-05-27 14:06:04 -03:00
Manoj
ff2fe1e62c Fixed MM-33249 issue (#17475)
* Added logic to detect and set unicode emoji in the custom status slash command

* Replaced strings.split with strings.Fields

* Added logic to handle empty string as message in custom status slash command

* Changed custom status slash command empty message behavior to set def… (#14)

* Changed custom status slash command empty message behavior to set default emoji

* Code refactoring

* Added unit tests and refactored some code

* WIP: Unit tests and refactoring for detecting unicode emoji in custom status slash commands

* Complete unit testing for Get custom status

* Fixed lint

* Added logic for removing skin tone from unicode emoji (#16)

* Added logic for removing skin tone from unicode emoji
Made a reverse system emojis map of string vs []string and stored the emojiNames in sorted order
Added the logic for detecting and replacing/removing skin tone in unicode emoji with variation selector
Added new unit tests with different skin tone emojis

* Refactored removeSkinTone logic to a separate function

* Added check for emoji before removing skin tone in custom status slash command

* Fixed custom status slash command unit test and refactored some code
Chanded the return type of GetEmojiNameFromUnicode from bool to int
Changed the logic for checking presence of emoji without removing skin tone
Fixed the unit tests

* Review fixes: Indentation changes
2021-05-26 21:03:08 +03:00
Eli Yukelzon
46649292f8 MM-34758 Collapsed Reply Threads without mobile support (#17424)
Summary
added support for legacy clients accessing server
added collapsed_threads_supported param to viewChannel API and setPostUnread API

Ticket Link
https://mattermost.atlassian.net/browse/MM-34758

Related Webapp PR
mattermost/mattermost-webapp#7933
2021-05-26 20:40:25 +05:30
Jesse Hallam
4f0f038e0b MM-35945: handle lots of files in ExtractTarGz (#17669)
* MM-35945: handle lots of files in ExtractTarGz

`ExtractTarGz` can fail on archives with a largish number or files, complaining about too many open file handles. Clean up as we go to avoid this.

Fixes: https://mattermost.atlassian.net/browse/MM-35945

* use closure to allow defer
2021-05-25 22:00:57 -03:00
Scott Bishel
2f33b52d8a check authdata for different format (#17577)
* check authdata for different format

* add mocks, fix lint

* rename function

* update auth-data with new format

* update assert

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-24 09:04:20 -06:00
Agniva De Sarker
a4f7df6f6e Remove all remaining occurences of fakeApp (#17661)
* Remove all remaining occurences of fakeApp

Migrated any remaining methods under server.

And for everything else, renamed fakeApp to app.
The word fakeApp is confusing and we should just call
it for what it is - an app.

https://focalboard-community.octo.mattermost.com/workspace/zyoahc9uapdn3xdptac6jb69ic?id=285b80a3-257d-41f6-8cf4-ed80ca9d92e5&v=495cdb4d-c13a-4992-8eb9-80cfee2819a4&c=639a0bc1-4401-43d5-81ec-0dd54e796d9a

```release-note
NONE
```

* fix tests
2021-05-24 10:24:51 +05:30
Jesse Hallam
ff383990f8 Revert "[MM-8497] Ability to set Do Not Disturb for a specified period of time (#16067)" (#17657)
This reverts commit 77d42568f9.
2021-05-21 09:38:27 -03:00
Claudio Costa
e1b13c10fc [MM-28692] Include config diffs in audit record for config changing API calls (#17623)
* Replace config generator

* Cleanup

* Some renaming and docs additions to add clarity

* Cleanup logging related methods

* Cleanup emitter

* Fix TestDefaultsGenerator

* Move feature flags synchronization logic out of config package

* Remove unnecessary util functions

* Simplify load/set logic

* Refine semantics and add some test to cover them

* Remove unnecessary deep copies

* Improve logic further

* Fix license header

* Review file store tests

* Fix test

* Fix test

* Avoid additional write during initialization

* More consistent naming

* Update app/feature_flags.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Make ConfigStore.Set() return both old and new configs

* Implement config diff function

* Make app.SaveConfig return previous and current configs

* Add config diff to audit record

* Fix returned configs

* Include high level test

* Move FF synchronizer to its own package

* Remove unidiomatic use of sync.Once

* Add some comments

* Rename function

* More comment

* Save config diff in audit record for local endpoints

* Enable audit for config set/reset commands

* Improve tests output

Co-authored-by: Christopher Speller <crspeller@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2021-05-21 09:04:39 +02:00
Doug Lauder
2b02b03497 MM-35133 trigger sync user immediately after change (#17579)
- ensure changes to user profile sync immediately
- refactor sync send
2021-05-20 12:07:40 -04:00
Hossein
abdba7acc3 [MM-35861] Add missing migration transformation (#17647) 2021-05-19 17:00:51 -04:00
Devin Binnie
347bc770ed [MM-35841] Fix invalid use of variables in invite_body template (#17643) 2021-05-19 15:50:05 -04:00
Max Erenberg
9ef41a55e2 [MM-7968] restrict creation of direct channels to team members (#17222)
* restrict creation of direct channels to team members

* run make i18n-extract

* add suggestions from hahmadia

* place common-team-check logic in app layer

* use flat SQL query

* show more specific error message to user

* MM-7968: Fmt file.

* MM-7968: Fix for moved session field.

Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Martin Kraft <martinkraft@gmail.com>
Co-authored-by: Martin Kraft <martin@upspin.org>
2021-05-19 08:45:03 -04:00
Claudio Costa
3681cd3688 [MM-32390] Config logic refactor (#17578)
* Replace config generator

* Cleanup

* Some renaming and docs additions to add clarity

* Cleanup logging related methods

* Cleanup emitter

* Fix TestDefaultsGenerator

* Move feature flags synchronization logic out of config package

* Remove unnecessary util functions

* Simplify load/set logic

* Refine semantics and add some test to cover them

* Remove unnecessary deep copies

* Improve logic further

* Fix license header

* Review file store tests

* Fix test

* Fix test

* Avoid additional write during initialization

* More consistent naming

* Update app/feature_flags.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Christopher Speller <crspeller@gmail.com>

* Update config/store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* Move FF synchronizer to its own package

* Remove unidiomatic use of sync.Once

* Add some comments

* Rename function

* More comment

Co-authored-by: Christopher Speller <crspeller@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2021-05-19 13:30:26 +02:00
Claudio Costa
7bb23323d1 [MM-35424] Fix job schedulers server from missing leader change event (#17602)
* Fix cluster leader change message potentially getting lost

* Start jobs and schedulers earlier in server initialization

* Fix possible deadlock

* Update jobs/schedulers.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2021-05-18 20:33:09 +02:00
Alejandro García Montoro
0bf7aed02e Add RequestTrialLicense function to the plugin API (#17551)
* Add RequestTrialLicense function to the plugin API

* Fix strings IDs

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-14 10:35:59 +02:00
Ibrahim Serdar Acikgoz
35bfae9052 remove request.Context from shared channel service methods (#17606) 2021-05-11 22:29:30 +03:00
Ibrahim Serdar Acikgoz
5ea06e51d0 Migrate to stateless app.App (#17542)
* add request context

* move initialialization to server

* use app interface instead of global app functions

* remove app context from webconn

* cleanup

* remove duplicated services

* move context to separate package

* remove finalize init method and move content to NewServer function

* restart workers and schedulers after adding license for tests

* reflect review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-11 13:00:44 +03:00
Jyoti Patel
d97daaa1de [GH-15906][MM-22844] Redesign message notification emails. (#17184)
* Redesign message notification emails.

* Fix tests and linter.

* Fix tests

* Fix tests

* gofmt.

* Fix date separator

* Update html files

* Remove date for message notification email.

* Modify subtitle for mentions and direct and group messages.

* Fix lint error

* Fix DM subtitle.

* Fixing translations

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
2021-05-10 17:50:44 +02:00
Doug Lauder
a668479992 MM-35332 honour config setting when extending session expiry (#17581)
Honour `ServiceSettings.ExtendSessionLengthWithActivity` config setting when extending session expiry on activity.
2021-05-07 14:43:41 -04:00
darkLord19
77d42568f9 [MM-8497] Ability to set Do Not Disturb for a specified period of time (#16067)
* Add support for timed DND status

- accept a date time value in api query when dnd mode for user needs to be unset
- Create a new function to handle SetDNDStatus calls
- Create a scheduled task to unset dnd mode to wahtever mode was before setting it to DND

* update schema version

* Model changes to make fields more intuitive

- move dndendtime to status model
- add new field prev status in status to keep track of previous status of user
- update db migration function
- make use of prevstatus and dndendtime from status model

* set prev status and dndendtime appropriately after unsetting dnd mode

* add json tag for dndendtime

* unset dnd status only if not changed manually by user

* update dnd statuses after server restart

* make app-layers

* fix failing tests

* don't create sched task when setting status to DND

* get only expired statuses from db

- convert end time from any timezone to utc
- store dnd end time in unix format for usability reasons

* run update dnd status only on leader

* make mocks

* fix tests

* run UpdateDNDStatusOfUsers as recurring task

* save all statuses at once in db and update UpdateDNDStatusOfUsers logic

* add app method to get timezone of user

* store dnd end time in context.Params

* set max size of prevstatus

* update status model to take endtime input as string and store in db as unix time(int64)

* Add tests for SetStatusDoNotDisturbTimed

* if dnd_end_time is not passed the call old api to set dnd mode

* fix tests

* new plugin api to use new timed dnd mode

* get and update rows in a single db query

* dnd end time will be stored in request body and not route param

* exclude statuses which has dndendtimeunix < 0

* update and get the updated dnd statuses in single db query

* add updated status to cache

* DNDEndTimeUnix and PrevStatus need not to be visible to users

* update db schema version for migration

* Keep Status and PrevStatus varchar size same

* add test to verify status is restored after dnd end time expires

* expect endtime in utc from client

- remove store method GetTimezone as no longer needed
- add documentation for SetStatusDoNotDisturbTimed

* reduce sleep time for dnd timed restore test

* more appropriate name for new api to update user status

* update db migration function

* parse and validate time before potentially triggering db query to get status of user

* add migration changes in to existing upgrade function

* not supporting un-timed dnd status via api

* don't call Srv.Store directly, call via app layer

* rename dndendtime to statuscleartime to make it suitable for custom status usage as well

* Revert "rename dndendtime to statuscleartime to make it suitable for custom status usage as well"

This reverts commit fa69152d9a.

* mysql doesn't support RETURNING clause so add tx to get and update statuses

* add UpdateDNDStatusOfUsers mock in tests

* update store mock import path

* add mock in storelib

* Add status mocks to empty store

* Close the task during server shutdown

* Do not cancel a nil task

* update squirrel queries

* remove untimed dnd test

* start recurring task to unset statuses on leadership change

* set dndTask to nil after cancelling it upon server shutdown

* new recurring task which starts at nearest rounded time of the interval

* mock Get() call for status

* return updated statuses in case of mysql

* remove unneccessary code

* add Get() mock to empty store

* fix mocking for once and all

* address review comments

fix mysql updateStatus fn

protect dndTask with mutex

minor refactors

* move runDNDStatusExpireJob to server.go and pass App as arg instead of method receiver

* frontend will send endtime in unix epoch format so get rid of double representation

* scan for all fields and not just two

* add some tests and fix review comments

* remove extra sql query and create needed result in go

* add storetest for UpdateExpiredDNDStatuses

* add migrations to latest version

* update min supported version

* add comment to fix a bug in future

* update test to expect 1 status in return

* rename UpdateUserStatusWithDNDTimeout to SetUserStatusTimedDND

* rename DNDEndTimeUnix to DNDEndTime

* cast int to int64 for equality

* fix tests and error handling

* move updating values to retrieved statuses fields outside sql transaction

* move migrations to 5.36

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-07 18:20:55 +02:00
Max Erenberg
9f4902e188 [MM-33908] Resync LDAP Groups to Teams and Channels (#17372)
* add includeRemovedMembers flag

* fix API call in client4.go

* remove check for 'since'

* add comments

* run make app-layers

* re-run CI tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-05-04 12:37:36 -04:00
Jesús Espino
df695115be Removing FilesSearch feature flag (#17548)
* Removing FilesSearch feature flag

* Fixing tests

* Adding an improvement on plain text extraction

* Adding tests for plain text extraction

* Removed unneeded conversion

* Adding missed license

* Remove the feature flag from the migration

* Fixing some tests

* Updating i18n/en.json file
2021-04-30 23:21:26 +02:00
Doug Lauder
e2b9cb98aa MM-33903 rename slash commands & permission (#17494)
- rename slash commands
    - "remote" -> "secure-connection"
    - "share" -> "share-channel"
- change status icons to text (translated)
- remove channel invite "Description" field
- rename permission "manage_remote_clusters" -> "manage_secure_connections"
2021-04-30 14:59:29 -04:00
Agniva De Sarker
8f9e2669a6 MM-34419: Fix plugin enable race (#17511)
A race happens when we try to enable plugins
in an HA environment. There is no loss in functionality
here, but it's a timing bug.

There are two bugs here.

The first one is a case of nested config listeners. a.InitPlugins
is called in InitServer, and as well as a config listener. And that
calls a.SyncPluginsActiveState(). But inside a.InitPlugins,
there is yet another config listener which again calls
a.SyncPluginsActiveState(). The first fix is to simply not call
the method again from the nested listener.

The second bug happens because the config changed message is sent
across the cluster only after saving the config locally
in the store. To fix this, we simply change GetPluginStatus
to not fail and return empty status when other nodes don't have plugins
enabled.

https://mattermost.atlassian.net/browse/MM-34419

```release-note
Fix a race condition where enabling plugins would result
in spurious errors in the logs.
```
2021-04-30 07:16:57 -07:00
Jesús Espino
49bdf49bfa Add migration to set the ExtractContent settings to true by default (#17545) 2021-04-30 12:26:03 +02:00
Martin Kraft
8bf08988bd MM-33601: Invalidate team member cache when updating a team scheme. (#17384)
* MM-33601: Invalidate team member cache when updating a team scheme.

* MM-33601: Tests cache invalidation.

* MM-33601: Test fix.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-29 15:19:57 -04:00
Agniva De Sarker
21776870d6 MM-34878: Add metrics for websocket reconnects (#17522)
* MM-34878: Add metrics for websocket reconnects

Added two new metrics to track successful websocket drain
and dead queue misses.

```release-note
NONE
```

https://mattermost.atlassian.net/browse/MM-34878

* remove TODO line
2021-04-29 19:42:48 +05:30
Eli Yukelzon
611e03de94 MM-35300 CRT: No mention badge on Threads when user is mentioned in both the root post and a reply post (#17541) 2021-04-29 13:59:38 +03:00
Eli Yukelzon
861745e33b MM-35123 - CRT: Replying to a post with mention causes two mention badges to appear (#17506)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-29 12:15:27 +03:00
Eli Yukelzon
29341b8fe5 MM-35290 CRT: Reply on a unfollowed thread causes re-following (#17537) 2021-04-29 10:52:29 +03:00
Claudio Costa
d1e38fa74b [MM-35222] Fix DoGuestRolesCreationMigration (#17523)
* Set guest role based on scope

* Fix team scheme

* Fix scope
2021-04-29 09:13:42 +02:00
Harrison Healey
3c162999a5 MM-22678 Use more user-friendly errors for channel commands (#17520)
* MM-22678 Use more user-friendly errors for channel commands

* Update text from ticket

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-28 15:01:44 -04:00
Claudio Costa
6af032d06a [MM-35077] Add basic support for plugin intra-cluster communication (#17495)
* Add basic support for plugin intra-cluster communication

* Some renaming for added clarity

* Allow sending cluster event to specific nodes

* Improve naming and documentation

* Improve logging
2021-04-28 19:59:32 +02:00
Haardik Dharma
ccc7365ac3 Bump golangci version to v1.38.0 (#17154)
* Update golangci to v1.38.0

Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-28 16:43:41 +02:00
Agniva De Sarker
2d0f5f910a MM-35239: Fix racy test HubSessionRevokeRace (#17534)
Automatic Merge
2021-04-28 11:36:05 +02:00
Harshil Sharma
79dd9b13dc MM-18818 Prompt admins to set the Support Email (#17296)
* MM-18818 Set default support to empty and handled the same in email templates

* #MM-18818 Admin advisor now warns for inconfigured support email address

* Updated text

* #MM-18818 gofmt'ed files

* #MM-18818 updated text and removed unused i18n strings:

* #MM-18818 updated i18n string ordering

* #MM-18818 Added test for support email advisory

* MM-18818 gofmt'd the file

* MM-18818 separated contextual notifications from configuration notifications in Admin Advisor

* #MM-18818 prevented support email with whitepsaces from being detected as filled

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-28 12:05:38 +05:30
Martin Kraft
49178bf480 MM-24455: Fix role responses. (#17385)
Automatic Merge
2021-04-27 18:36:05 +02:00
Eli Yukelzon
d819eb224c MM-35103 Replies in a thread with an initial mention triggers notification each time (#17503)
* only process parent post mentions for threads in order to autofollow

* don't use merge since it modifies the original

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-27 18:23:01 +03:00
Agniva De Sarker
978d886e3f MM-35239: Skip TestHubSessionRevokeRace (#17524)
https://mattermost.atlassian.net/browse/MM-35239

```release-note
NONE
```
2021-04-27 20:49:17 +05:30
Eli Yukelzon
3d6e69b002 MM-35128 CRT: Global Threads item should not be affected by 'mark as unread' in channel (#17505)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-27 16:56:06 +03:00
Eli Yukelzon
89281c00b1 MM-35127 CRT: Marking thread as unread doesn't set the timestamp correctly (#17507)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-27 15:48:43 +03:00
Eli Yukelzon
ba302cf512 MM-35125 CRT: Mention badge on threads doesn't appear until refresh (#17504) 2021-04-27 10:18:20 +03:00
Agniva De Sarker
cd4d322e4a MM-32950: Reliable WebSockets: Basic single server (#17406)
* MM-32950: Reliable WebSockets: Basic single server

This PR adds reliable websocket support for a single server.

Below is a brief overview of the three states of a connection:

Normal:
- All messages are routed via web hub.
- Each web conn has a send queue to which it gets pushed.
- A message gets pulled from the queue, and before it
gets written to the wire, it is added to the dead queue.

Disconnect:
- Hub Unregister gets called, where the connection is just
marked as inactive. And new messages keep getting pushed
to the send queue.

If it gets full, the channel is closed and the conn gets removed
from conn index.

Reconnect:
- We query the hub for the connection ID, and get back the
queues.
- We construct a WebConn reusing the old queues, or a fresh one
depending on whether the connection ID was found or not.
- Now there is a tricky bit here which needs to be carefully processed.
On register, we would always send the hello message in the send queue.
But we cannot do that now because the send queue might already have messages.

Therefore, we don't send the hello message from web hub, if we reuse a connection.

Instead, we move that logic to the web conn write pump. We check if
the sequence number is in dead queue, and if it is, then we drain
the dead queue, and start consuming from the active queue.
No hello message is sent here.

But if the message does not exist in the dead queue, and the sequence number
is actually something that should have existed, then we set
a new connction id and clear the dead queue, and send a hello message.
The client, on receiving a new connection id will automatically
set its sequence number to 0, and make the sync API calls to manage
any lost data.

https://mattermost.atlassian.net/browse/MM-32590

```release-note
NONE
```

* gofmt

* Add EnableReliableWebSockets to the client config

* Refactoring isInDeadQueue

* Passing index to drainDeadQueue

* refactoring webconn

* fix pointer

* review comments

* simplify hasMsgLoss

* safety comment

* fix test

* Trigger CI

* Trigger CI

Co-authored-by: Devin Binnie <devin.binnie@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-26 19:51:25 +05:30
Allan Guwatudde
fd546cdff2 [MM-35039] - Send trial ended email (#17478)
* [MM-35039] - Send trial ended email

* Generations

* Use First name with fallback to username

* Use First name with fallback to username for trial ending email
2021-04-23 21:45:47 +03:00
Ibrahim Serdar Acikgoz
5f9870ac06 [MM-34216] app/import: do not break import process if a dm channel is invalid (#17391)
* app/import: do not break import process if a dm channel is invalid

* update test headers

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-04-22 12:42:22 +03:00
darkLord19
f6505e1ee6 MM-31339: Send only one direct message reply within one calendar day. (#17181)
* don't send auto response if already responded today

* update query to get posts from channel for given user and Updatetime requires value in milli seconds

* regenerate mocks and layers

* update function to return true/false on existence of auto responded post in channel and add tests

* add store tests

* bubble up error and propagate upstream

* fix error handling logic

* use require instead of assert

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* rename variable for better redability and logging fixes

* update comment explaining function

* use new function to generate test ids

* add comments to clarify NewTestId copies

* add translations for error id

* fix translation

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
2021-04-22 12:33:45 +08:00
Ben Schumacher
f14b0097dd [MM-34798] Respect MM_SERVER_PATH when looking for templates (#17410) 2021-04-21 20:35:57 +02:00