added channel votes
[srvx.git] / src / chanserv.h
index d6470e2455c653a4d32a0eaa151204932c7d3008..8c63e4a5f9ea57a46277b99c96e673eff185f671 100644 (file)
@@ -45,6 +45,7 @@ enum levelOption {
     lvlUserInfo,
     lvlInviteMe,
     lvlTopicSnarf,
+    lvlVote,
     NUM_LEVEL_OPTIONS
 };
 
@@ -91,6 +92,10 @@ struct chanData
     char    *registrar;
     char    *topic_mask;
 
+    char          *vote;
+    unsigned int  vote_start;
+    dict_t        vote_options;
+
     unsigned int        flags : 30;
     unsigned int        may_opchan : 1;
     unsigned int        max;
@@ -129,6 +134,9 @@ struct userData
     unsigned int        present : 1;
     unsigned int        flags : USER_FLAGS_SIZE;
 
+    unsigned short      voted;
+    unsigned int        votefor;
+
     /* linked list of userDatas for a chanData */
     struct userData     *prev;
     struct userData     *next;
@@ -164,6 +172,14 @@ struct suspended
     struct suspended    *previous;
 };
 
+struct vote_option
+{
+    char                *name;
+    unsigned int        option_id;
+    char                *option_str;
+    unsigned int        voted;
+};
+
 struct do_not_register
 {
     char   chan_name[CHANNELLEN+1];