partial implementation of "read posts"

This commit is contained in:
2025-12-18 23:43:51 -07:00
parent 1233dabfb2
commit 57d664dcb1
4 changed files with 152 additions and 1 deletions
+16
View File
@@ -48,6 +48,7 @@ type AmContext interface {
FormFile(string) (*multipart.FileHeader, error)
Globals() *database.Globals
GlobalFlags() *util.OptionSet
HasParameter(string) bool
IsMember() bool
IsMemberLocked() bool
LeftMenu() string
@@ -206,6 +207,21 @@ func (c *amContext) GlobalFlags() *util.OptionSet {
return c.globalFlags
}
// HasParameter tests to see if we have a parameter.
func (c *amContext) HasParameter(name string) bool {
s := c.echoContext.QueryParam(name)
if s != "" {
return true
}
if c.echoContext.Request().Method == "POST" {
s = c.echoContext.FormValue(name)
if s != "" {
return true
}
}
return false
}
// IsMember returns true if the user is a member of the current community.
func (c *amContext) IsMember() bool {
return c.isMember