easemob 0.3.1 → 0.3.2
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/easemob/groups.rb +3 -1
- data/lib/easemob/message/base_message.rb +27 -14
- data/lib/easemob/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85b5c103e09b9f6129e0d12a984214b4d032437f
|
4
|
+
data.tar.gz: aacdcaf5e6ae05582b33cec27faf0aa08abdacb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1198146fcd39f3ac5f369e2a1e3bcbcf9717f280f7121b92ef139052fe748f6b73fb43f2a11f7654fbec96740b9fd6176f2d08035cd12c8eb4be00cc642efe87
|
7
|
+
data.tar.gz: 851ab51bc7a719f1c1ab32549a1fb7c959b405c44607c64db6bc950859ad74b3c16177054017a39a50dee7615a35e75f1b617134b36c88b39a351ccf233ea9e2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/easemob/groups.rb
CHANGED
@@ -33,11 +33,13 @@ module Easemob
|
|
33
33
|
GroupMessage.new request :delete, "chatgroups/#{group_id}"
|
34
34
|
end
|
35
35
|
|
36
|
-
def modify_group(group_id, groupname: nil, description: nil, maxusers: nil)
|
36
|
+
def modify_group(group_id, groupname: nil, description: nil, maxusers: nil, newowner: nil)
|
37
37
|
jd = {}
|
38
38
|
jd[:groupname] = groupname unless groupname.nil?
|
39
39
|
jd[:description] = description unless description.nil?
|
40
40
|
jd[:maxusers] = maxusers unless maxusers.nil?
|
41
|
+
jd[:newowner] = newowner unless newowner.nil?
|
42
|
+
|
41
43
|
GroupMessage.new request :put, "chatgroups/#{group_id}", json: jd
|
42
44
|
end
|
43
45
|
|
@@ -1,40 +1,53 @@
|
|
1
1
|
module Easemob
|
2
2
|
class BaseMessage
|
3
3
|
attr_reader :raw_http_response, :code, :body, :body_hash
|
4
|
+
|
5
|
+
attr_reader :timestamp
|
6
|
+
attr_reader :duration
|
7
|
+
|
4
8
|
attr_reader :action
|
5
9
|
attr_reader :application
|
6
10
|
attr_reader :params
|
7
11
|
attr_reader :uri
|
8
12
|
attr_reader :entities
|
9
13
|
attr_reader :data
|
10
|
-
attr_reader :timestamp
|
11
|
-
attr_reader :duration
|
12
14
|
attr_reader :organization
|
13
15
|
attr_reader :application_name
|
14
16
|
attr_reader :cursor
|
15
17
|
attr_reader :count
|
16
18
|
|
19
|
+
attr_reader :error
|
20
|
+
attr_reader :exception
|
21
|
+
attr_reader :error_description
|
22
|
+
|
17
23
|
def initialize(http_response)
|
18
24
|
@raw_http_response = http_response
|
19
25
|
@code = http_response.code
|
20
26
|
@body = http_response.body
|
21
27
|
|
22
|
-
return
|
23
|
-
|| http_response.headers['Content-Type'].index('application/octet-stream')
|
28
|
+
return unless http_response.headers['Content-Type'].index('application/json')
|
24
29
|
|
25
30
|
@body_hash = JSON.parse(@body)
|
26
|
-
|
27
|
-
@application = @body_hash['application']
|
28
|
-
@params = @body_hash['params']
|
29
|
-
@uri = @body_hash['uri']
|
30
|
-
@entities = @body_hash['entities']
|
31
|
-
@data = @body_hash['data']
|
31
|
+
|
32
32
|
@timestamp = @body_hash['timestamp']
|
33
33
|
@duration = @body_hash['duration']
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
|
35
|
+
if http_response.code == 200
|
36
|
+
@action = @body_hash['action']
|
37
|
+
@application = @body_hash['application']
|
38
|
+
@params = @body_hash['params']
|
39
|
+
@uri = @body_hash['uri']
|
40
|
+
@entities = @body_hash['entities']
|
41
|
+
@data = @body_hash['data']
|
42
|
+
@organization = @body_hash['organization']
|
43
|
+
@application_name = @body_hash['applicationName']
|
44
|
+
@cursor = @body_hash['cursor']
|
45
|
+
@count = @body_hash['count']
|
46
|
+
else
|
47
|
+
@error = @body_hash['error']
|
48
|
+
@exception = @body_hash['exception']
|
49
|
+
@error_description = @body_hash['error_description']
|
50
|
+
end
|
38
51
|
end
|
39
52
|
|
40
53
|
def to_s
|
data/lib/easemob/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easemob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Guo
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
R5k6Ma92sW8jupX4cqbSu9rntdVQkNRpoHIrfU0MZT0cKsg/D1zMteylxrO3KMsz
|
31
31
|
SPQRv+nrI1J0zevFqb8010heoR8SDyUA0Mm3+Q==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2016-12-
|
33
|
+
date: 2016-12-08 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: http
|
metadata.gz.sig
CHANGED
Binary file
|