summaryrefslogtreecommitdiffstats
path: root/app/post_test.go
Commit message (Collapse)AuthorAgeFilesLines
* MM-7188: Cleaning push notification on every read, not only on channel ↵Jesús Espino2018-09-261-7/+7
| | | | | | | | | | | | switch (#9348) * MM-7188: Cleaning push notification on every read, not only on channel switch * Removed unnecesary goroutine * Fixing tests * Applying suggestion from PR
* Add ChannelId and TeamId to PostActionIntegrationRequest (#9384)Hanzei2018-09-191-4/+5
| | | | | | * Add ChannelId and TeamId to PostActionIntegrationRequest * Add tests
* MM-11693 Allow connections to /plugins for interactive message buttons. (#9333)Christopher Speller2018-09-021-1/+129
| | | | | | | | * Allow connetions to /plugins for interactive message buttons. * Adding siteurl to exclusions for AllowedUntrustedInternalConnections * Adding subpath support for allowing interactive message buttons plugin connections.
* Support for interactive menus in message attachments (#9285)Joram Wilander2018-08-241-3/+51
|
* MM-11175 Add logic to server to understand markdown images with dimensions ↵Harrison Healey2018-08-011-0/+8
| | | | (#9159)
* MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)Christopher Speller2018-06-251-0/+2
| | | | | | * Moving plugins to use hashicorp go-plugin. * Tweaks from feedback.
* MM-9072/MM-10185 Force-convert the encoding of OpenGraph metadata to UTF-8 ↵Hyeseong Kim2018-04-301-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#8631) * Force-convert non-UTF8 HTML to UTF8 before opengraph processing * Split the force-encoding function * Add benchmark Test for the forceHTMLEncodingToUTF8() ``` Running tool: /home/comet/go-v1.9.2/bin/go test -benchmem -run=^$ github.com/mattermost/mattermost-server/app -bench ^BenchmarkForceHTMLEncodingToUTF8$ [03:32:58 KST 2018/04/21] [INFO] (github.com/mattermost/mattermost-server/app.TestMain:28) -test.run used, not creating temporary containers goos: linux goarch: amd64 pkg: github.com/mattermost/mattermost-server/app BenchmarkForceHTMLEncodingToUTF8/with_converting-4 100000 11201 ns/op 18704 B/op 32 allocs/op BenchmarkForceHTMLEncodingToUTF8/without_converting-4 300000 3931 ns/op 4632 B/op 13 allocs/op PASS ok github.com/mattermost/mattermost-server/app 2.703s Success: Benchmarks passed. ``` * Remove an unnecessary constraint * Add pre-check if content-type header is already utf-8 * Move the checking for utf-8 into forceHTMLEncodingToUTF8() for testing * Revert df3f347213faa0d023c26d201fa6531f46391086..HEAD, without Gopkg.lock
* Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1Martin Kraft2018-03-271-0/+59
|\
| * Relax 4k post message limit (#8478)Jesse Hallam2018-03-261-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-9661: rename POST_MESSAGE_MAX_RUNES to \0_v1 * MM-9661: s/4000/POST_MESSAGE_MAX_RUNES_V1/ in tests * MM-9661: introduce POST_MESSAGE_MAX_RUNES_V2 * MM-9661: migrate Postgres Posts.Message column to TEXT from VARCHAR(4000) This is safe to do in a production instance since the underyling type is not changing. We explicitly don't do this automatically for MySQL, but also don't need to since the ORM would have already created a TEXT column for MySQL in that case. * MM-9661: emit MaxPostSize in client config This value remains unconfigurable at this time, but exposes the current limit to the client. The limit remains at 4k in this commit. * MM-9661: introduce and use SqlPostStore.GetMaxPostSize Enforce a byte limitation in the database, and use 1/4 of that value as the rune count limitation (assuming a worst case UTF-8 representation). * move maxPostSizeCached, lastPostsCache and lastPostTimeCache out of the global context and onto the SqlPostStore * address feedback from code review: * ensure sqlstore unit tests are actually being run * move global caches into SqlPostStore * leverage sync.Once to address a race condition * modify upgrade semantics to match new db semantics gorp's behaviour on creating columns with a maximum length on Postgres differs from MySQL: * Postgres * gorp uses TEXT for string columns without a maximum length * gorp uses VARCHAR(N) for string columns with a maximum length of N * MySQL * gorp uses TEXT for string columns with a maximum length >= 256 * gorp uses VARCHAR(N) for string columns with a maximum length of N * gorp defaults to a maximum length of 255, implying VARCHAR(255) So the Message column has been TEXT on MySQL but VARCHAR(4000) on Postgres. With the new, longer limits of 65535, and without changes to gorp, the expected behaviour is TEXT on MySQL and VARCHAR(65535) on Postgres. This commit makes the upgrade semantics match the new database semantics. Ideally, we'd revisit the gorp behaviour at a later time. * allow TestMaxPostSize test cases to actually run in parallel * default maxPostSizeCached to POST_MESSAGE_MAX_RUNES_V1 in case the once initializer panics * fix casting error * MM-9661: skip the schema migration for Postgres It turns out resizing VARCHAR requires a rewrite in some versions of Postgres, but migrating VARCHAR to TEXT does not. Given the increasing complexity, let's defer the migration to the enduser instead.
* | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-02-191-37/+95
|\|
| * gofmtDerrick Anderson2018-02-131-1/+1
| |
| * Merge branch 'release-4.7' into rm-willnorris-proxy-supportChris2018-02-121-0/+92
| |\
| | * Merge branch 'release-4.7' into icu669Derrick Anderson2018-02-121-0/+16
| | |\
| | * | Fixed typo in unit testHarrison Healey2018-02-121-1/+1
| | | |
| | * | ICU-669 Handle relative links betterHarrison Healey2018-02-091-3/+15
| | | |
| | * | ICU-669 Ensured all URLs returned from OpenGraph are absoluteHarrison Healey2018-02-081-0/+80
| | | |
| * | | remove willnorris/imageproxy supportChristopher Brown2018-02-121-43/+9
| | |/ | |/|
* | | Merge branch 'master' into advanced-permissions-phase-1George Goldberg2018-02-131-10/+17
|\| |
| * | minor addition to #8238Christopher Brown2018-02-091-0/+6
| | |
| * | Don't proxy same-site image urls (#8238)Chris2018-02-091-0/+10
| |/ | | | | | | | | | | * don't proxy same-site urls * fix empty site url case
* / AllowEditPost and PostEditTimeLimit migration (#8208)Jesús Espino2018-02-091-0/+46
|/ | | | | | | | * AllowEditPost and PostEditTimeLimit migration * Not set EDIT_POST permission to sysadmin_role if ALLOW_EDIT_POST is configured to NEVER * Remove a bit of code duplication
* fix image url replacement for blank urls (#8184)Chris2018-02-011-0/+6
|
* PLT-3383: image proxy support (#7991)Chris2018-01-221-0/+81
| | | | | | | | | | | | * image proxy support * go vet fix, remove mistakenly added coverage file * fix test compile error * add validation to config settings and documentation to model functions * add message_source field to post
* fix post editing when channel links are present (#7938)Chris2017-12-051-0/+9
|
* PLT-5458: If someone posts a channel link to channel_A that you don't belong ↵Chris2017-11-281-0/+38
| | | | | | | | | | | | to, it doesn't render properly (#7833) * add channel link hints to post props * optimization * update regex, add unit test * fix rebase issue
* Refactoring cfg refs and load / save functions (#7749)Chris2017-10-311-6/+3
| | | | | | * refactoring cfg refs and load / save functions * improve error output
* Reduce utils.Cfg references (#7650)Chris2017-10-181-2/+2
| | | | | | | | | | | | * app.UpdateConfig method * test fix * another test fix * the config override option as-was is just error prone, remove it for now * derp
* Fix races / finally remove global app for good (#7570)Chris2017-10-041-0/+3
| | | | | | | | | | | | * finally remove global app for good * test compilation fixes * fix races * fix deadlock * wake up write pump so it doesn't take forever to clean up
* Remove global app references (#7433)Chris2017-09-121-14/+11
| | | | | | | | * remove global app references * test fix * fix api4 test compilation
* Renaming repoChristopher Speller2017-09-061-2/+2
|
* app type transition (#7167)Chris2017-09-061-11/+14
|
* PLT-6403: Interactive messages (#7274)Chris2017-08-291-1/+71
| | | | | | | | | | * wip * finish first pass * requested changes * add DoPostAction to Client4
* PLT-6960 Only update post.EditAt when the message changes (#6840)Harrison Healey2017-07-041-7/+33
|
* PLT-6523: Don't crash when replying to a post whose poster has left the ↵George Goldberg2017-05-101-0/+44
channel. (#6388)