facebook-messenger 1.2.0 → 1.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f17a2863cfd6e0797b3a942f6fb5959557be525c40e1efc698542a6ab3662ac6
4
- data.tar.gz: e94ac387ab7174e04429cc5afa2b27121fb1bfd03afa3067e3ed61db3b4f34ba
3
+ metadata.gz: dbeade2fa81a2b697fa7635b0fbe0e4bead497dadce5191405efa0b1eab4ad3c
4
+ data.tar.gz: efadea4a20f49814f28148993b2e87b5ccd310c2d513f8feea4a1f62526118ce
5
5
  SHA512:
6
- metadata.gz: 2d673c880dfd1647805347e666586aa7478be689b2660e2a91a69084d7b63f576509c917751b7fcc10f8fa8f28147fe1ff8041a196d8aa5850a2bfa0dd1d60c5
7
- data.tar.gz: 801a4fa53d78bfd7e03cf365b57899b25ac085f12507b8307d468b132dac2caeff2d149ee5eb521967548933ded81f0a27957995257e2a0e2a6f21870aec5555
6
+ metadata.gz: 2222ed8d1a46dab7dd554017ffb7a7a3619476cc688f81ce7acd303d50cec9f7d0da3bbe642bd548502ec62ffafde5516d5fde6cc04f840d22c4123c6b99d2e1
7
+ data.tar.gz: 014b6a913f77baf595d2672a97d9c13e8804c63862e7d7fb84ff50f51e5b34ee1fc31da1bf1446ddbe3330cb3d206b88b3871c119556902b63ffc5496b492b1e
data/README.md CHANGED
@@ -245,6 +245,17 @@ Bot.on :referral do |referral|
245
245
  end
246
246
  ```
247
247
 
248
+ #### Pass thread control
249
+
250
+ Another bot can pass a human to you:
251
+
252
+ ```ruby
253
+ Bot.on :pass_thread_control do |pass_thread_control|
254
+ pass_thread_control.new_owner_app_id # => '123456789'
255
+ pass_thread_control.metadata # => 'Additional content that the caller wants to set'
256
+ end
257
+ ```
258
+
248
259
  #### Change messenger profile
249
260
 
250
261
  You can greet new humans to entice them into talking to you, in different locales:
@@ -28,6 +28,7 @@ module Facebook
28
28
  message_echo
29
29
  payment
30
30
  policy_enforcement
31
+ pass_thread_control
31
32
  ].freeze
32
33
 
33
34
  class << self
@@ -10,6 +10,7 @@ require 'facebook/messenger/incoming/account_linking'
10
10
  require 'facebook/messenger/incoming/referral'
11
11
  require 'facebook/messenger/incoming/payment'
12
12
  require 'facebook/messenger/incoming/policy_enforcement'
13
+ require 'facebook/messenger/incoming/pass_thread_control'
13
14
 
14
15
  module Facebook
15
16
  module Messenger
@@ -31,7 +32,8 @@ module Facebook
31
32
  'message_echo' => MessageEcho,
32
33
  'message_request' => MessageRequest,
33
34
  'payment' => Payment,
34
- 'policy_enforcement' => PolicyEnforcement
35
+ 'policy_enforcement' => PolicyEnforcement,
36
+ 'pass_thread_control' => PassThreadControl
35
37
  }.freeze
36
38
 
37
39
  # Parse the given payload and create new object of class related
@@ -0,0 +1,22 @@
1
+ module Facebook
2
+ module Messenger
3
+ module Incoming
4
+ # The PassThreadControl class represents an incoming Facebook Messenger
5
+ # pass thread control event.
6
+ #
7
+ # @see https://developers.facebook.com/docs/messenger-platform/handover-protocol/pass-thread-control
8
+ # @see https://developers.facebook.com/docs/messenger-platform/reference/handover-protocol/pass-thread-control
9
+ class PassThreadControl
10
+ include Facebook::Messenger::Incoming::Common
11
+
12
+ def new_owner_app_id
13
+ @messaging['pass_thread_control']['new_owner_app_id']
14
+ end
15
+
16
+ def metadata
17
+ @messaging['pass_thread_control']['metadata']
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -2,6 +2,6 @@ module Facebook
2
2
  module Messenger
3
3
  #
4
4
  # @return [String] Define the version of gem.
5
- VERSION = '1.2.0'.freeze
5
+ VERSION = '1.3.0'.freeze
6
6
  end
7
7
  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: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Gorset
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-13 00:00:00.000000000 Z
11
+ date: 2019-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -187,6 +187,7 @@ files:
187
187
  - lib/facebook/messenger/incoming/message_echo.rb
188
188
  - lib/facebook/messenger/incoming/message_request.rb
189
189
  - lib/facebook/messenger/incoming/optin.rb
190
+ - lib/facebook/messenger/incoming/pass_thread_control.rb
190
191
  - lib/facebook/messenger/incoming/payment.rb
191
192
  - lib/facebook/messenger/incoming/policy_enforcement.rb
192
193
  - lib/facebook/messenger/incoming/postback.rb