facebook-messenger 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28a2c27e5d533c1e3e08f30836b1e7e56f49dd0d
4
- data.tar.gz: b164a64515afa0fa76d6e61b7794494b03c950f0
3
+ metadata.gz: 4f7c4706fe8ba78595fea5ecb1cd09c272b888d5
4
+ data.tar.gz: 0c92e230627849cbf801f5b65e64b3d4f86df070
5
5
  SHA512:
6
- metadata.gz: 8a84c428addb8eeb8ce92df6654a851967b85a2c7bf38e2f536e9703d79051d0c617a9cf53b81400866a1f09d9270872e8124cee7dcd84821f1d7ae6e9cfc281
7
- data.tar.gz: 64f7d4fdada458a3e72736b68d35d6b6735e4ab569662e7309dc28df7219f68250b23dfcf3d570e597fc09308bf37a18a963de2590a0bdae4f1f348a16080231
6
+ metadata.gz: b36ffd86c6f2ae36f412295e830ae704dff9352f37da76fe9bd9539d0789dc9e7093d36a6e60212a1154aab532e87e2f134da03c2c0d1184d26589c4253c62c4
7
+ data.tar.gz: f62d1a3a1122d0feea5c2aaa36116db5538c44c1358bb308091716c0e04ca93b3377c2e5017384e4dac0904b2af1f948ff63dce2cc6b2b20a6be5b64681199e6
@@ -93,9 +93,7 @@ module Facebook
93
93
  # Generate a HMAC signature for the given content.
94
94
  def generate_hmac(content)
95
95
  content_json = JSON.parse(content, symbolize_names: true)
96
-
97
- # Get Facebook page id regardless of the entry type
98
- facebook_page_id = content_json.dig(:entry, 0, :id)
96
+ facebook_page_id = content_json[:entry][0][:id]
99
97
 
100
98
  OpenSSL::HMAC.hexdigest('sha1'.freeze,
101
99
  app_secret_for(facebook_page_id),
@@ -128,6 +126,9 @@ module Facebook
128
126
  # Facebook may batch several items in the 'entry' array during
129
127
  # periods of high load.
130
128
  events['entry'.freeze].each do |entry|
129
+ # If the application has subscribed to webhooks other than Messenger,
130
+ # 'messaging' won't be available and it is not relevant to us.
131
+ next unless entry['messaging'.freeze]
131
132
  # Facebook may batch several items in the 'messaging' array during
132
133
  # periods of high load.
133
134
  entry['messaging'.freeze].each do |messaging|
@@ -1,5 +1,5 @@
1
1
  module Facebook
2
2
  module Messenger
3
- VERSION = '0.11.0'.freeze
3
+ VERSION = '0.11.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook-messenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Gorset
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-19 00:00:00.000000000 Z
11
+ date: 2016-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty