facebook-messenger 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/facebook/messenger/server.rb +4 -3
- data/lib/facebook/messenger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f7c4706fe8ba78595fea5ecb1cd09c272b888d5
|
4
|
+
data.tar.gz: 0c92e230627849cbf801f5b65e64b3d4f86df070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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|
|
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.
|
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-
|
11
|
+
date: 2016-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|