landed E-mail invites at three levels

This commit is contained in:
2026-01-30 14:44:30 -07:00
parent a0064b37a5
commit 2c9ceefd6b
7 changed files with 185 additions and 7 deletions
+14
View File
@@ -112,6 +112,20 @@ func (c *Conference) Hosts(ctx context.Context) ([]*User, error) {
return rc, nil
}
// InCommunity returns true if the specified conference is in the community.
func (c *Conference) InCommunity(ctx context.Context, comm *Community) (bool, error) {
row := amdb.QueryRowContext(ctx, "SELECT commid FROM commtoconf WHERE commid = ? AND confid = ?", comm.Id, c.ConfId)
var tmp int32
err := row.Scan(&tmp)
switch err {
case nil:
return true, nil
case sql.ErrNoRows:
return false, nil
}
return false, err
}
// ContainedBy returns the communities that contain this conference.
func (c *Conference) ContainedBy(ctx context.Context) ([]*Community, error) {
rs, err := amdb.QueryContext(ctx, "SELECT commid FROM commtoconf WHERE confid = ?", c.ConfId)