mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-14 16:26:23 -07:00
Add filename and username banning, add more de-deprecation stuff to posting/post.go
This commit is contained in:
parent
b69536b772
commit
379e846daf
10 changed files with 531 additions and 405 deletions
|
@ -60,16 +60,22 @@ type FileBan struct {
|
|||
Checksum string `json:"checksum"` // sql: `checksum`
|
||||
}
|
||||
|
||||
type filenameOrUsernameBanBase struct {
|
||||
ID int // sql: id
|
||||
BoardID *int // sql: board_id
|
||||
StaffID int // sql: staff_id
|
||||
StaffNote string // sql: staff_note
|
||||
IssuedAt time.Time // sql: issued_at
|
||||
check string // replaced with username or filename
|
||||
IsRegex bool // sql: is_regex
|
||||
}
|
||||
|
||||
// FilenameBan represents a ban on a specific filename or filename regular expression.
|
||||
// table: DBPREFIXfilename_ban
|
||||
type FilenameBan struct {
|
||||
ID int `json:"id"` // sql: `id`
|
||||
BoardID int `json:"board_id"` // sql: `board_id`
|
||||
StaffID int `json:"staff_id"` // sql: `staff_id`
|
||||
StaffNote string `json:"staff_note"` // sql: `staff_note`
|
||||
IssuedAt time.Time `json:"issued_at"` // sql: `issued_at`
|
||||
Filename string `json:"filename"` // sql: `filename`
|
||||
IsRegex bool `json:"is_regex"` // sql: `is_regex`
|
||||
filenameOrUsernameBanBase
|
||||
Filename string // sql: `filename`
|
||||
IsRegex bool // sql: `is_regex`
|
||||
}
|
||||
|
||||
// Upload represents a file attached to a post.
|
||||
|
@ -161,6 +167,8 @@ type Post struct {
|
|||
DeletedAt time.Time // sql: `deleted_at`
|
||||
IsDeleted bool // sql: `is_deleted`
|
||||
BannedMessage string // sql: `banned_message`
|
||||
|
||||
sanitized bool
|
||||
}
|
||||
|
||||
// table: DBPREFIXreports
|
||||
|
@ -224,13 +232,8 @@ type Thread struct {
|
|||
|
||||
// table: DBPREFIXusername_ban
|
||||
type UsernameBan struct {
|
||||
ID int `json:"id"` // sql: `id`
|
||||
BoardID *int `json:"board"` // sql: `board_id`
|
||||
StaffID int `json:"staff_id"` // sql: `staff_id`
|
||||
StaffNote string `json:"staff_note"` // sql: `staff_note`
|
||||
IssuedAt time.Time `json:"issued_at"` // sql: `issued_at`
|
||||
Username string `json:"username"` // sql: `username`
|
||||
IsRegex bool `json:"is_regex"` // sql: `is_regex`
|
||||
filenameOrUsernameBanBase
|
||||
Username string // sql: `username`
|
||||
}
|
||||
|
||||
// table DBPREFIXwordfilters
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue