mirror of https://gitlab.com/ngerakines/tavern.git
Removing spare print statements. Added tavern version to footer.
This commit is contained in:
parent
c69cb7243d
commit
7499dc29ed
|
@ -56,11 +56,10 @@ func (l ACLs) ToMatchSet(highScopes *common.UniqueUUIDs, defaultAllow bool) comm
|
|||
highDeny := make([]common.AllowDenyMatcher, 0)
|
||||
lowAllow := make([]common.AllowDenyMatcher, 0)
|
||||
lowDeny := make([]common.AllowDenyMatcher, 0)
|
||||
fmt.Println(l)
|
||||
|
||||
for _, acl := range l {
|
||||
matcher := common.NewAllowDenyMatcher(acl.Target)
|
||||
_, isHigh := highScopes.Tracking[acl.Scope]
|
||||
fmt.Println("placing matcher", isHigh, acl.Action)
|
||||
if isHigh && acl.Action == AllowACLAction {
|
||||
highAllow = append(highAllow, matcher)
|
||||
} else if isHigh && acl.Action == DenyACLAction {
|
||||
|
|
|
@ -127,8 +127,6 @@ func (s pgStorage) createRelationshipGraphRecord(ctx context.Context, userID, ac
|
|||
query := fmt.Sprintf(`INSERT INTO network_graph (%s) VALUES (%s) ON CONFLICT ON CONSTRAINT network_graph_user_actor_rel DO UPDATE SET activity = $4, relationship_status = $6`, fields, valuesPlaceholder)
|
||||
rowID := NewV4()
|
||||
now := s.now()
|
||||
fmt.Println(query)
|
||||
fmt.Println(rowID, userID, actorID, activity, relationshipType, relationshipStatus, now, now)
|
||||
_, err := s.db.ExecContext(ctx, query, rowID, userID, actorID, activity, relationshipType, relationshipStatus, now, now)
|
||||
return errors.WrapNetworkRelationshipInsertFailedError(err)
|
||||
}
|
||||
|
@ -150,8 +148,6 @@ func (s pgStorage) ActivityForFollower(ctx context.Context, userID, actorID uuid
|
|||
}
|
||||
|
||||
func (s pgStorage) networkGraphActivity(qc QueryExecute, ctx context.Context, userID, actorID uuid.UUID, relationshipType RelationshipType) (Payload, error) {
|
||||
fmt.Println(`SELECT activity FROM network_graph WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`)
|
||||
fmt.Println(userID, actorID, relationshipType)
|
||||
var payload Payload
|
||||
err := qc.QueryRowContext(ctx, `SELECT activity FROM network_graph WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, relationshipType).
|
||||
Scan(&payload)
|
||||
|
@ -162,25 +158,21 @@ func (s pgStorage) networkGraphActivity(qc QueryExecute, ctx context.Context, us
|
|||
}
|
||||
|
||||
func (s pgStorage) UpdateFollowingAccepted(ctx context.Context, userID, actorID uuid.UUID) error {
|
||||
fmt.Println(`UPDATE network_graph SET relationship_status = $4 WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, UserFollowsRelationship, AcceptRelationshipStatus)
|
||||
_, err := s.db.ExecContext(ctx, `UPDATE network_graph SET relationship_status = $4 WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, UserFollowsRelationship, AcceptRelationshipStatus)
|
||||
return errors.WrapNetworkRelationshipUpdateFailedError(err)
|
||||
}
|
||||
|
||||
func (s pgStorage) UpdateFollowingRejected(ctx context.Context, userID, actorID uuid.UUID) error {
|
||||
fmt.Println(`UPDATE network_graph SET relationship_status = $4 WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, UserFollowsRelationship, RejectRelationshipStatus)
|
||||
_, err := s.db.ExecContext(ctx, `UPDATE network_graph SET relationship_status = $4 WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, UserFollowsRelationship, RejectRelationshipStatus)
|
||||
return errors.WrapNetworkRelationshipUpdateFailedError(err)
|
||||
}
|
||||
|
||||
func (s pgStorage) UpdateFollowerApproved(ctx context.Context, userID, actorID uuid.UUID) error {
|
||||
fmt.Println(`UPDATE network_graph SET relationship_status = $4 WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, UserFollowedByRelationship, AcceptRelationshipStatus)
|
||||
_, err := s.db.ExecContext(ctx, `UPDATE network_graph SET relationship_status = $4 WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, UserFollowedByRelationship, AcceptRelationshipStatus)
|
||||
return errors.WrapNetworkRelationshipUpdateFailedError(err)
|
||||
}
|
||||
|
||||
func (s pgStorage) RemoveFollowing(ctx context.Context, userID, actorID uuid.UUID) error {
|
||||
fmt.Println(`DELETE FROM network_graph WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, UserFollowsRelationship)
|
||||
_, err := s.db.ExecContext(ctx, `DELETE FROM network_graph WHERE user_id = $1 AND actor_id = $2 AND relationship_type = $3`, userID, actorID, UserFollowsRelationship)
|
||||
return errors.WrapNetworkRelationshipUpdateFailedError(err)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<div class="col">
|
||||
<ul class="list-inline">
|
||||
<li class="list-inline-item">
|
||||
<a href="https://tavern.town/">Tavern</a> is open source software.
|
||||
<a href="https://tavern.town/">Tavern</a>
|
||||
({{ tavern_version }})
|
||||
is open source software.
|
||||
</li>
|
||||
<li class="list-inline-item text-muted">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
|
|
Loading…
Reference in New Issue