Browse Source

notes from meeting

Luke Miller 2 năm trước cách đây
mục cha
commit
08151ad9d9
1 tập tin đã thay đổi với 22 bổ sung1 xóa
  1. 22 1
      modpol/modules/join_org_class.lua

+ 22 - 1
modpol/modules/join_org_class.lua

@@ -60,16 +60,37 @@ function JoinOrg:initiate(result)
         end
     )
 
+    for user in pairs(self.org.users) {
+        self.org:add_pending_action(self.id, user, "callback")
+
+
+        org.pending.user[2348] = "callback"
+
+        self:callback(user)
+    }
     
 
     if result then result() end
 
 end
 
-function JoinOrg:request() 
+function JoinOrg:callback(user)
+    modpol.interactions.binary_poll_user(
+        self.initiator, 
+        "Do you want this" .. self.user_to_add .. "to join?", 
+        function (resp) 
+            if resp == "yes" then
+                self.votes_yes += 1
+            end
+
+            self:evaluate_vote()
 
+        end
+    ) 
 end
 
+
+
 function JoinOrg:on_success()
     self.org:add_member(self.initiator)
     self.org:delete_process(self.id)