about summary refs log tree commit diff
path: root/app/services/activitypub
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-09-30 12:23:57 +0200
committerThibaut Girka <thib@sitedethib.com>2019-09-30 12:23:57 +0200
commit16ff7c5627c12a0c9658e9d2fac7c48002e1b788 (patch)
tree465a73fb9f42bc2b01127b2d477b0715fb6185b4 /app/services/activitypub
parentfebcdad2e2c98aee62b55ee21bdf0debf7c6fd6b (diff)
parent3babf8464b0903b854ec16d355909444ef3ca0bc (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- Gemfile
- Gemfile.lock
- app/controllers/about_controller.rb
- app/controllers/auth/sessions_controller.rb
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