pubnub 4.2.0 → 4.2.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pubnub might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.pubnub.yml +8 -1
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/VERSION +1 -1
- data/fixtures/vcr_cassettes/lib/events/create_space.yml +40 -0
- data/fixtures/vcr_cassettes/lib/events/create_user.yml +40 -0
- data/fixtures/vcr_cassettes/lib/events/delete_space.yml +38 -0
- data/fixtures/vcr_cassettes/lib/events/delete_user.yml +38 -0
- data/fixtures/vcr_cassettes/lib/events/get_members.yml +38 -0
- data/fixtures/vcr_cassettes/lib/events/get_space.yml +38 -0
- data/fixtures/vcr_cassettes/lib/events/get_space_memberships.yml +38 -0
- data/fixtures/vcr_cassettes/lib/events/get_spaces.yml +40 -0
- data/fixtures/vcr_cassettes/lib/events/get_user.yml +38 -0
- data/fixtures/vcr_cassettes/lib/events/manage_members_add.yml +40 -0
- data/fixtures/vcr_cassettes/lib/events/manage_members_remove.yml +83 -0
- data/fixtures/vcr_cassettes/lib/events/manage_memberships_add.yml +40 -0
- data/fixtures/vcr_cassettes/lib/events/manage_memberships_remove.yml +40 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-member-add-async.yml +77 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-member-remove-async.yml +77 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-membership-add-async.yml +77 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-membership-remove-async.yml +77 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-space-delete-async.yml +77 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-space-update-async.yml +77 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-user-delete-async.yml +77 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-user-update-async.yml +77 -0
- data/fixtures/vcr_cassettes/lib/events/update_space.yml +40 -0
- data/fixtures/vcr_cassettes/lib/events/update_user.yml +40 -0
- data/lib/pubnub/subscribe_callback.rb +4 -1
- data/lib/pubnub/subscribe_event/formatter.rb +33 -0
- data/lib/pubnub/subscriber.rb +6 -0
- data/lib/pubnub/version.rb +1 -1
- data/spec/lib/events/subscribe_spec.rb +188 -0
- metadata +25 -2
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ps.pndsn.com/v2/subscribe/sub-a-mock-key/rb_space_3/0?auth=ruby-test-auth&pnsdk=PubNub-Ruby/4.2.0&t=%7B%22r%22:0,%22t%22:0%7D&uuid=ruby-test-uuid
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Fri, 25 Oct 2019 19:50:12 GMT
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Fri, 25 Oct 2019 19:50:15 GMT
|
23
|
+
Content-Type:
|
24
|
+
- text/javascript; charset="UTF-8"
|
25
|
+
Content-Length:
|
26
|
+
- '45'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Methods:
|
34
|
+
- GET
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"t":{"t":"15720329910471712","r":12},"m":[]}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 25 Oct 2019 19:50:12 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: http://ps.pndsn.com/v2/subscribe/sub-a-mock-key/rb_space_3/0?auth=ruby-test-auth&pnsdk=PubNub-Ruby/4.2.0&t=%7B%22r%22:12,%22t%22:%2215720330183065651%22%7D&uuid=ruby-test-uuid
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: ''
|
46
|
+
headers:
|
47
|
+
User-Agent:
|
48
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
49
|
+
Accept:
|
50
|
+
- "*/*"
|
51
|
+
Date:
|
52
|
+
- Fri, 25 Oct 2019 19:50:15 GMT
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message: OK
|
57
|
+
headers:
|
58
|
+
Date:
|
59
|
+
- Fri, 25 Oct 2019 19:50:18 GMT
|
60
|
+
Content-Type:
|
61
|
+
- text/javascript; charset="UTF-8"
|
62
|
+
Content-Length:
|
63
|
+
- '268'
|
64
|
+
Connection:
|
65
|
+
- keep-alive
|
66
|
+
Cache-Control:
|
67
|
+
- no-cache
|
68
|
+
Access-Control-Allow-Origin:
|
69
|
+
- "*"
|
70
|
+
Access-Control-Allow-Methods:
|
71
|
+
- GET
|
72
|
+
body:
|
73
|
+
encoding: UTF-8
|
74
|
+
string: '{"t":{"t":"15720330184481173","r":12},"m":[{"a":"3","f":0,"e":2,"p":{"t":"15720330184019633","r":2},"k":"sub-a-mock-key","c":"rb_space_3","d":{"source":"objects","version":"1.0","event":"delete","type":"space","data":{"id":"rb_space_3"}}}]}'
|
75
|
+
http_version:
|
76
|
+
recorded_at: Fri, 25 Oct 2019 19:50:15 GMT
|
77
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ps.pndsn.com/v2/subscribe/sub-a-mock-key/rb_space_3/0?auth=ruby-test-auth&pnsdk=PubNub-Ruby/4.2.0&t=%7B%22r%22:0,%22t%22:0%7D&uuid=ruby-test-uuid
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Fri, 25 Oct 2019 19:41:06 GMT
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Fri, 25 Oct 2019 19:41:09 GMT
|
23
|
+
Content-Type:
|
24
|
+
- text/javascript; charset="UTF-8"
|
25
|
+
Content-Length:
|
26
|
+
- '45'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Methods:
|
34
|
+
- GET
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"t":{"t":"15720324693401333","r":12},"m":[]}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 25 Oct 2019 19:41:06 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: http://ps.pndsn.com/v2/subscribe/sub-a-mock-key/rb_space_3/0?auth=ruby-test-auth&pnsdk=PubNub-Ruby/4.2.0&t=%7B%22r%22:12,%22t%22:%2215720324693401333%22%7D&uuid=ruby-test-uuid
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: ''
|
46
|
+
headers:
|
47
|
+
User-Agent:
|
48
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
49
|
+
Accept:
|
50
|
+
- "*/*"
|
51
|
+
Date:
|
52
|
+
- Fri, 25 Oct 2019 19:41:06 GMT
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message: OK
|
57
|
+
headers:
|
58
|
+
Date:
|
59
|
+
- Fri, 25 Oct 2019 19:43:04 GMT
|
60
|
+
Content-Type:
|
61
|
+
- text/javascript; charset="UTF-8"
|
62
|
+
Content-Length:
|
63
|
+
- '358'
|
64
|
+
Connection:
|
65
|
+
- keep-alive
|
66
|
+
Cache-Control:
|
67
|
+
- no-cache
|
68
|
+
Access-Control-Allow-Origin:
|
69
|
+
- "*"
|
70
|
+
Access-Control-Allow-Methods:
|
71
|
+
- GET
|
72
|
+
body:
|
73
|
+
encoding: UTF-8
|
74
|
+
string: '{"t":{"t":"15720325841044329","r":12},"m":[{"a":"3","f":0,"e":2,"p":{"t":"15720325840630385","r":2},"k":"sub-a-mock-key","c":"rb_space_3","d":{"source":"objects","version":"1.0","event":"update","type":"space","data":{"eTag":"AZmU8+zbjLGOoAE","id":"rb_space_3","name":"name_1572032581","updated":"2019-10-25T19:43:03.976039Z"}}}]}'
|
75
|
+
http_version:
|
76
|
+
recorded_at: Fri, 25 Oct 2019 19:43:01 GMT
|
77
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ps.pndsn.com/v2/subscribe/sub-a-mock-key/user_mg3/0?auth=ruby-test-auth&pnsdk=PubNub-Ruby/4.2.0&t=%7B%22r%22:0,%22t%22:0%7D&uuid=ruby-test-uuid
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Fri, 25 Oct 2019 19:23:55 GMT
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Fri, 25 Oct 2019 19:23:58 GMT
|
23
|
+
Content-Type:
|
24
|
+
- text/javascript; charset="UTF-8"
|
25
|
+
Content-Length:
|
26
|
+
- '45'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Methods:
|
34
|
+
- GET
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"t":{"t":"15720312144082905","r":12},"m":[]}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 25 Oct 2019 19:23:55 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: http://ps.pndsn.com/v2/subscribe/sub-a-mock-key/user_mg3/0?auth=ruby-test-auth&pnsdk=PubNub-Ruby/4.2.0&t=%7B%22r%22:12,%22t%22:%2215720312144082905%22%7D&uuid=ruby-test-uuid
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: ''
|
46
|
+
headers:
|
47
|
+
User-Agent:
|
48
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
49
|
+
Accept:
|
50
|
+
- "*/*"
|
51
|
+
Date:
|
52
|
+
- Fri, 25 Oct 2019 19:23:55 GMT
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message: OK
|
57
|
+
headers:
|
58
|
+
Date:
|
59
|
+
- Fri, 25 Oct 2019 19:24:07 GMT
|
60
|
+
Content-Type:
|
61
|
+
- text/javascript; charset="UTF-8"
|
62
|
+
Content-Length:
|
63
|
+
- '263'
|
64
|
+
Connection:
|
65
|
+
- keep-alive
|
66
|
+
Cache-Control:
|
67
|
+
- no-cache
|
68
|
+
Access-Control-Allow-Origin:
|
69
|
+
- "*"
|
70
|
+
Access-Control-Allow-Methods:
|
71
|
+
- GET
|
72
|
+
body:
|
73
|
+
encoding: UTF-8
|
74
|
+
string: '{"t":{"t":"15720314473053590","r":12},"m":[{"a":"3","f":0,"e":2,"p":{"t":"15720314472596946","r":2},"k":"sub-a-mock-key","c":"user_mg3","d":{"source":"objects","version":"1.0","event":"delete","type":"user","data":{"id":"user_mg3"}}}]}'
|
75
|
+
http_version:
|
76
|
+
recorded_at: Fri, 25 Oct 2019 19:24:04 GMT
|
77
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ps.pndsn.com/v2/subscribe/sub-a-mock-key/user_mg3/0?auth=ruby-test-auth&pnsdk=PubNub-Ruby/4.2.0&t=%7B%22r%22:0,%22t%22:0%7D&uuid=ruby-test-uuid
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Fri, 25 Oct 2019 19:20:08 GMT
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Fri, 25 Oct 2019 19:20:10 GMT
|
23
|
+
Content-Type:
|
24
|
+
- text/javascript; charset="UTF-8"
|
25
|
+
Content-Length:
|
26
|
+
- '45'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Cache-Control:
|
30
|
+
- no-cache
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Methods:
|
34
|
+
- GET
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"t":{"t":"15720307124752724","r":12},"m":[]}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 25 Oct 2019 19:20:08 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: http://ps.pndsn.com/v2/subscribe/sub-a-mock-key/user_mg3/0?auth=ruby-test-auth&pnsdk=PubNub-Ruby/4.2.0&t=%7B%22r%22:12,%22t%22:%2215720307124752724%22%7D&uuid=ruby-test-uuid
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: ''
|
46
|
+
headers:
|
47
|
+
User-Agent:
|
48
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
49
|
+
Accept:
|
50
|
+
- "*/*"
|
51
|
+
Date:
|
52
|
+
- Fri, 25 Oct 2019 19:20:08 GMT
|
53
|
+
response:
|
54
|
+
status:
|
55
|
+
code: 200
|
56
|
+
message: OK
|
57
|
+
headers:
|
58
|
+
Date:
|
59
|
+
- Fri, 25 Oct 2019 19:20:14 GMT
|
60
|
+
Content-Type:
|
61
|
+
- text/javascript; charset="UTF-8"
|
62
|
+
Content-Length:
|
63
|
+
- '353'
|
64
|
+
Connection:
|
65
|
+
- keep-alive
|
66
|
+
Cache-Control:
|
67
|
+
- no-cache
|
68
|
+
Access-Control-Allow-Origin:
|
69
|
+
- "*"
|
70
|
+
Access-Control-Allow-Methods:
|
71
|
+
- GET
|
72
|
+
body:
|
73
|
+
encoding: UTF-8
|
74
|
+
string: '{"t":{"t":"15720312144082905","r":12},"m":[{"a":"3","f":0,"e":2,"p":{"t":"15720312143594394","r":2},"k":"sub-a-mock-key","c":"user_mg3","d":{"source":"objects","version":"1.0","event":"update","type":"user","data":{"eTag":"Ab+suYTYtJ2yjQE","id":"user_mg3","name":"name_1572031211","updated":"2019-10-25T19:20:14.283963Z"}}}]}'
|
75
|
+
http_version:
|
76
|
+
recorded_at: Fri, 25 Oct 2019 19:20:11 GMT
|
77
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: patch
|
5
|
+
uri: http://ps.pndsn.com/v1/objects/demo/spaces/rb_space?auth=ruby-test-auth&include=custom&pnsdk=PubNub-Ruby/4.2.0&uuid=ruby-test-uuid
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"id":"rb_space","name":"new_name","custom":{"XXX":"YYYY"}}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Fri, 25 Oct 2019 20:35:51 GMT
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Fri, 25 Oct 2019 20:35:54 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
27
|
+
Content-Length:
|
28
|
+
- '203'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Credentials:
|
34
|
+
- 'true'
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"status":200,"data":{"id":"rb_space","name":"new_name","description":null,"custom":{"XXX":"YYYY"},"created":"2019-10-25T20:35:54.1512Z","updated":"2019-10-25T20:35:54.431837Z","eTag":"AYKsrdL029TZ1wE"}}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 25 Oct 2019 20:35:51 GMT
|
40
|
+
recorded_with: VCR 5.0.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: patch
|
5
|
+
uri: http://ps.pndsn.com/v1/objects/demo/users/mg?auth=ruby-test-auth&include=custom&pnsdk=PubNub-Ruby/4.2.0&uuid=ruby-test-uuid
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"id":"mg","name":"magnum_1","custom":{"XXX":"YYYY"}}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.8.3, ruby 2.6.3 (2019-04-16))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Fri, 25 Oct 2019 20:36:54 GMT
|
16
|
+
Content-Type:
|
17
|
+
- application/x-www-form-urlencoded
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Fri, 25 Oct 2019 20:36:57 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json
|
27
|
+
Content-Length:
|
28
|
+
- '228'
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Access-Control-Allow-Origin:
|
32
|
+
- "*"
|
33
|
+
Access-Control-Allow-Credentials:
|
34
|
+
- 'true'
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"status":200,"data":{"id":"mg","name":"magnum_1","externalId":null,"profileUrl":null,"email":null,"custom":{"XXX":"YYYY"},"created":"2019-10-25T20:36:57.254813Z","updated":"2019-10-25T20:36:57.561462Z","eTag":"AYD0rZeD55aIMA"}}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 25 Oct 2019 20:36:54 GMT
|
40
|
+
recorded_with: VCR 5.0.0
|
@@ -9,7 +9,10 @@ module Pubnub
|
|
9
9
|
message: options[:message],
|
10
10
|
status: options[:status],
|
11
11
|
presence: options[:presence],
|
12
|
-
signal: options[:signal]
|
12
|
+
signal: options[:signal],
|
13
|
+
user: options[:user],
|
14
|
+
space: options[:space],
|
15
|
+
membership: options[:membership]
|
13
16
|
}
|
14
17
|
validate!
|
15
18
|
end
|
@@ -166,6 +166,39 @@ module Pubnub
|
|
166
166
|
Pubnub::Constants::OPERATION_PRESENCE
|
167
167
|
elsif message[:type] == 1
|
168
168
|
Pubnub::Constants::OPERATION_SIGNAL
|
169
|
+
elsif message[:type] == 2
|
170
|
+
case message[:payload]['type']
|
171
|
+
when 'user'
|
172
|
+
case message[:payload]['event']
|
173
|
+
when 'create'
|
174
|
+
Pubnub::Constants::OPERATION_CREATE_USER
|
175
|
+
when 'update'
|
176
|
+
Pubnub::Constants::OPERATION_UPDATE_USER
|
177
|
+
when 'delete'
|
178
|
+
Pubnub::Constants::OPERATION_DELETE_USER
|
179
|
+
else
|
180
|
+
Pubnub.logger.error('Pubnub::SubscribeEvent::Formatter') { "Invalid event #{message[:payload]['event']}." }
|
181
|
+
raise Exception, "Invalid event #{message[:payload]['event']}."
|
182
|
+
end
|
183
|
+
when 'space'
|
184
|
+
case message[:payload]['event']
|
185
|
+
when 'create'
|
186
|
+
Pubnub::Constants::OPERATION_CREATE_SPACE
|
187
|
+
when 'update'
|
188
|
+
Pubnub::Constants::OPERATION_UPDATE_SPACE
|
189
|
+
when 'delete'
|
190
|
+
Pubnub::Constants::OPERATION_DELETE_SPACE
|
191
|
+
else
|
192
|
+
Pubnub.logger.error('Pubnub::SubscribeEvent::Formatter') { "Invalid event #{message[:payload]['event']}." }
|
193
|
+
raise Exception, "Invalid event #{message[:payload]['event']}."
|
194
|
+
end
|
195
|
+
when 'membership'
|
196
|
+
Pubnub::Constants::OPERATION_MANAGE_MEMBERSHIPS
|
197
|
+
else
|
198
|
+
Pubnub.logger.error('Pubnub::SubscribeEvent::Formatter') { "Invalid operation type #{message[:payload]['type']}." }
|
199
|
+
raise Exception, "Invalid operation type #{message[:payload]['type']}."
|
200
|
+
end
|
201
|
+
|
169
202
|
else
|
170
203
|
Pubnub::Constants::OPERATION_SUBSCRIBE
|
171
204
|
end
|