summaryrefslogtreecommitdiffstats
path: root/services/comments
Commit message (Collapse)AuthorAgeFilesLines
* Move issues related files into models/issues (#19931)Lunny Xiao2022-06-131-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Move access and repo permission to models/perm/access * fix test * fix git test * Move functions sequence * Some improvements per @KN4CK3R and @delvh * Move issues related code to models/issues * Move some issues related sub package * Merge * Fix test * Fix test * Fix test * Fix test * Rename some files
* Move almost all functions' parameter db.Engine to context.Context (#19748)Lunny Xiao2022-05-201-2/+2
| | | | * Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
* Move some issue methods as functions (#19255)Lunny Xiao2022-03-291-1/+1
| | | | | * Move some issue methods as functions * Fix bug
* format with gofumpt (#18184)65432022-01-201-1/+1
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* Move repository model into models/repo (#17933)Lunny Xiao2021-12-101-1/+2
| | | | | | | | | | | | | | | * Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
* Move user related model into models/user (#17781)Lunny Xiao2021-11-241-3/+4
| | | | | | | | | | | | | * Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
* Improvements to content history (#17746)Jimmy Praet2021-11-221-5/+16
| | | | | | | | | | | * Improvements to content history * initialize content history when making an edit to an old item created before the introduction of content history * show edit history for code comments on pull request files tab * Fix a flaw in keepLimitedContentHistory Fix a flaw in keepLimitedContentHistory, the first and the last should never be deleted * Remove obsolete eager initialization of content history
* Save and view issue/comment content history (#16909)wxiaoguang2021-10-101-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * issue content history * Use timeutil.TimeStampNow() for content history time instead of issue/comment.UpdatedUnix (which are not updated in time) * i18n for frontend * refactor * clean up * fix refactor * re-format * temp refactor * follow db refactor * rename IssueContentHistory to ContentHistory, remove empty model tags * fix html * use avatar refactor to generate avatar url * add unit test, keep at most 20 history revisions. * re-format * syntax nit * Add issue content history table * Update models/migrations/v197.go Co-authored-by: 6543 <6543@obermui.de> * fix merge Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
* DBContext is just a Context (#17100)zeripath2021-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * DBContext is just a Context This PR removes some of the specialness from the DBContext and makes it context This allows us to simplify the GetEngine code to wrap around any context in future and means that we can change our loadRepo(e Engine) functions to simply take contexts. Signed-off-by: Andrew Thornton <art27@cantab.net> * fix unit tests Signed-off-by: Andrew Thornton <art27@cantab.net> * another place that needs to set the initial context Signed-off-by: Andrew Thornton <art27@cantab.net> * avoid race Signed-off-by: Andrew Thornton <art27@cantab.net> * change attachment error Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move db related basic functions to models/db (#17075)Lunny Xiao2021-09-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * Move db related basic functions to models/db * Fix lint * Fix lint * Fix test * Fix lint * Fix lint * revert unnecessary change * Fix test * Fix wrong replace string * Use *Context * Correct committer spelling and fix wrong replaced words Co-authored-by: zeripath <art27@cantab.net>
* Enhance Ghost comment mitigation Settings (#14392)65432021-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * refactor models.DeleteComment and delete related reactions too * use deleteComment for UserDeleteWithCommentsMaxDays in DeleteUser * nits * Use time.Duration as other time settings have * docs * Resolve Fixme & fix potential deadlock * Disabled by Default * Update Config Value Description * switch args * Update models/issue_comment.go Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Send notifications for mentions in pulls, issues, (code-)comments (#14218)Jimmy Praet2021-01-021-2/+5
| | | | | Fixes #14187: mention handling extracted from email notification code Fixes #14013: add notification for mentions in pull request code comments Fixes #13450: Not receiving any emails with setting "Only Email on Mention"
* Refactor pull request review (#8954)Lunny Xiao2019-11-141-61/+0
| | | | | | | | | | | | | | | | | | * refactor submit review * remove unnecessary code * remove unused comment * fix lint * remove duplicated actions * remove duplicated actions * fix typo * fix comment content
* Add Close() method to gogitRepository (#8901)zeripath2019-11-131-0/+1
| | | | | | | | | In investigating #7947 it has become clear that the storage component of go-git repositories needs closing. This PR adds this Close function and adds the Close functions as necessary. In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files. Fixes #7947
* Move webhook codes from service to webhook notification (#8712)Lunny Xiao2019-10-301-69/+5
| | | | | | | | * Move webhook codes from service to webhook notification * move deletecomment webhook to notifications * fix notification
* Improve webhooks (#8583)John Olheiser2019-10-181-0/+3
| | | | | | | | | | | | | | * Improve webhooks Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update MSTeams and ReviewPayload comment Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add repo.FullName to comments Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move create issue comment to comments package (#8212)Lunny Xiao2019-09-241-0/+103
| | | | | | | | | | * move create issue comment to comments package * extract actions on update/delete comment from models to comment service * fix lint * fix lint
* Move git diff codes from models to services/gitdiff (#7889)Lunny Xiao2019-09-051-0/+69
* move git diff codes from models to services/gitdiff * fix template * fix test * fix template