about summary refs log tree commit diff
path: root/app/services/activitypub
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-09-30 23:29:55 +0200
committerGitHub <noreply@github.com>2019-09-30 23:29:55 +0200
commit65db9df011a3e13efa79f4e56343aa69bdad7716 (patch)
tree1941b85de1f0d1b6f56b73345cddf664a71faf20 /app/services/activitypub
parentfebcdad2e2c98aee62b55ee21bdf0debf7c6fd6b (diff)
parent3b855b5c82362783969f748ad78bcaf85f938c9f (diff)
Merge pull request #1224 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services/activitypub')
-rw-r--r--app/services/activitypub/process_poll_service.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/services/activitypub/process_poll_service.rb b/app/services/activitypub/process_poll_service.rb
index 2fbce65b9..cb4a0d460 100644
--- a/app/services/activitypub/process_poll_service.rb
+++ b/app/services/activitypub/process_poll_service.rb
@@ -28,6 +28,8 @@ class ActivityPub::ProcessPollService < BaseService
       end
     end
 
+    voters_count = @json['votersCount']
+
     latest_options = items.map { |item| item['name'].presence || item['content'] }
 
     # If for some reasons the options were changed, it invalidates all previous
@@ -39,7 +41,8 @@ class ActivityPub::ProcessPollService < BaseService
         last_fetched_at: Time.now.utc,
         expires_at: expires_at,
         options: latest_options,
-        cached_tallies: items.map { |item| item.dig('replies', 'totalItems') || 0 }
+        cached_tallies: items.map { |item| item.dig('replies', 'totalItems') || 0 },
+        voters_count: voters_count
       )
     rescue ActiveRecord::StaleObjectError
       poll.reload