2016-12-04 06:16:59 +00:00
|
|
|
package main
|
|
|
|
|
2017-03-18 07:23:02 +00:00
|
|
|
import "sync"
|
|
|
|
|
|
|
|
var group_update_mutex sync.Mutex
|
|
|
|
|
|
|
|
type GroupAdmin struct
|
|
|
|
{
|
|
|
|
ID int
|
|
|
|
Name string
|
|
|
|
Rank string
|
|
|
|
RankEmoji string
|
|
|
|
CanEdit bool
|
|
|
|
CanDelete bool
|
|
|
|
}
|
|
|
|
|
2016-12-04 06:16:59 +00:00
|
|
|
type Group struct
|
|
|
|
{
|
|
|
|
ID int
|
|
|
|
Name string
|
2016-12-07 13:46:14 +00:00
|
|
|
Is_Mod bool
|
2016-12-04 06:16:59 +00:00
|
|
|
Is_Admin bool
|
|
|
|
Is_Banned bool
|
2016-12-07 09:34:09 +00:00
|
|
|
Tag string
|
2017-01-31 05:13:38 +00:00
|
|
|
Perms Perms
|
|
|
|
PermissionsText []byte
|
|
|
|
Forums []ForumPerms
|
|
|
|
CanSee []int // The IDs of the forums this group can see
|
2016-12-04 06:16:59 +00:00
|
|
|
}
|
2017-03-18 07:23:02 +00:00
|
|
|
|
|
|
|
func group_exists(gid int) bool {
|
|
|
|
//fmt.Println(gid <= groupCapCount)
|
|
|
|
//fmt.Println(gid > 0)
|
|
|
|
//fmt.Println(groups[gid].Name!="")
|
|
|
|
return (gid <= groupCapCount) && (gid > 0) && groups[gid].Name!=""
|
|
|
|
}
|