partial implementation of "read posts"
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user