groundwork for conferences - new data structure and security definitions

This commit is contained in:
2025-10-22 22:08:10 -06:00
parent beddade58f
commit 4f3677b3b4
3 changed files with 250 additions and 3 deletions
+2 -3
View File
@@ -560,13 +560,12 @@ func (c *Community) TouchUpdate() error {
* Standard Go error status
*/
func AmGetCommunity(id int32) (*Community, error) {
var err error = nil
getCommunityMutex.Lock()
defer getCommunityMutex.Unlock()
rc, ok := communityCache.Get(id)
if !ok {
var dbdata []Community
err = amdb.Select(&dbdata, "SELECT * from communities WHERE commid = ?", id)
err := amdb.Select(&dbdata, "SELECT * from communities WHERE commid = ?", id)
if err != nil {
return nil, err
}
@@ -578,7 +577,7 @@ func AmGetCommunity(id int32) (*Community, error) {
rc = &(dbdata[0])
communityCache.Add(id, rc)
}
return rc.(*Community), err
return rc.(*Community), nil
}
/* AmGetCommunityByAlias returns a reference to the specified community.