@@ -21,12 +21,11 @@ type Poll struct {
2121 Gatekeep bool `bson:"gatekeep"`
2222 QuorumType float64 `bson:"quorumType"`
2323 AllowedUsers []string `bson:"allowedUsers"`
24- Hidden bool `bson:"hidden"`
2524 AllowWriteIns bool `bson:"writeins"`
2625
2726 // Prevent this poll from having progress displayed
2827 // This is important for events like elections where the results shouldn't be visible mid vote
29- SecretProgress bool `bson:"secretProgress "`
28+ Hidden bool `bson:"hidden "`
3029}
3130
3231const POLL_TYPE_SIMPLE = "simple"
@@ -73,50 +72,6 @@ func (poll *Poll) Hide(ctx context.Context) error {
7372 return nil
7473}
7574
76- func (poll * Poll ) Reveal (ctx context.Context ) error {
77- ctx , cancel := context .WithTimeout (ctx , 10 * time .Second )
78- defer cancel ()
79-
80- objId , _ := primitive .ObjectIDFromHex (poll .Id )
81-
82- _ , err := Client .Database (db ).Collection ("polls" ).UpdateOne (ctx , map [string ]interface {}{"_id" : objId }, map [string ]interface {}{"$set" : map [string ]interface {}{"hidden" : false }})
83- if err != nil {
84- return err
85- }
86-
87- return nil
88- }
89-
90- // This is currently unused, if you make a poll you're committing to if it's secret or not
91- func (poll * Poll ) MakeProgressSecret (ctx context.Context ) error {
92- ctx , cancel := context .WithTimeout (ctx , 10 * time .Second )
93- defer cancel ()
94-
95- objId , _ := primitive .ObjectIDFromHex (poll .Id )
96-
97- _ , err := Client .Database (db ).Collection ("polls" ).UpdateOne (ctx , map [string ]interface {}{"_id" : objId }, map [string ]interface {}{"$set" : map [string ]interface {}{"secretProgress" : true }})
98- if err != nil {
99- return err
100- }
101-
102- return nil
103- }
104-
105- // This is currently unused, if you make a poll you're committing to if it's secret or not
106- func (poll * Poll ) RevealProgress (ctx context.Context ) error {
107- ctx , cancel := context .WithTimeout (ctx , 10 * time .Second )
108- defer cancel ()
109-
110- objId , _ := primitive .ObjectIDFromHex (poll .Id )
111-
112- _ , err := Client .Database (db ).Collection ("polls" ).UpdateOne (ctx , map [string ]interface {}{"_id" : objId }, map [string ]interface {}{"$set" : map [string ]interface {}{"secretProgress" : false }})
113- if err != nil {
114- return err
115- }
116-
117- return nil
118- }
119-
12075func CreatePoll (ctx context.Context , poll * Poll ) (string , error ) {
12176 ctx , cancel := context .WithTimeout (ctx , 10 * time .Second )
12277 defer cancel ()
0 commit comments