package calls // Team mode's knock push: who is told, when somebody is at the door of a // call they are not in. A knock is a member's to answer, and in team mode // a member is whoever the roster says is one at the moment the push goes: // a person taken off the team gets nothing (their device rows stay, and a // re-added member is reached again), and a person whose standing cannot // be decided now gets nothing either — a push is said once and never // retried (knocked), so the conservative answer is silence. With no push // key configured nothing here runs at all: knocked returns first. import ( "context" "amadan.net/oficina/home/roster" "amadan.net/oficina/calls/internal/calls/teamstate" ) // teamMemberPersonIDs is every person the roster says is a Member now, // each asked separately (standingOf, a fresh Access per person), never // the request's or anybody else's. func (a *app) teamMemberPersonIDs(ctx context.Context) ([]int64, error) { people, err := teamstate.Subjects(ctx, a.team.db, a.team.issuer()) if err != nil { return nil, err } ids := make([]int64, 0, len(people)) for _, ps := range people { if a.team.Access(ctx, ps.Subject).State() == roster.Member { ids = append(ids, ps.PersonID) } } return ids, nil }