easemob 0.3.1 → 0.3.2

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: da16331e57505694980d8c22d0c50665007f8ae3
4
- data.tar.gz: '049b4f09bb5fa013fddc2262e3b80baaf8210ef8'
3
+ metadata.gz: 85b5c103e09b9f6129e0d12a984214b4d032437f
4
+ data.tar.gz: aacdcaf5e6ae05582b33cec27faf0aa08abdacb1
5
5
  SHA512:
6
- metadata.gz: 6fdb7fce330b73c0eccaff986354726bd33f99681e628f38dd1625d604572fcfb940959faed57490ceece9a289bc9cd919e3179a073f0f8272a6b8de6ee03bb2
7
- data.tar.gz: b3e11e79f85410084535fc52951bcffaf67547c362e66ae3f257b2b81e4ce7d7eba43634e0299f85efe41d89fcbba1db4ada2ef21ca1603249695b0111e3324c
6
+ metadata.gz: 1198146fcd39f3ac5f369e2a1e3bcbcf9717f280f7121b92ef139052fe748f6b73fb43f2a11f7654fbec96740b9fd6176f2d08035cd12c8eb4be00cc642efe87
7
+ data.tar.gz: 851ab51bc7a719f1c1ab32549a1fb7c959b405c44607c64db6bc950859ad74b3c16177054017a39a50dee7615a35e75f1b617134b36c88b39a351ccf233ea9e2
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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 if http_response.code != 200 \
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
- @action = @body_hash['action']
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
- @organization = @body_hash['organization']
35
- @application_name = @body_hash['applicationName']
36
- @cursor = @body_hash['cursor']
37
- @count = @body_hash['count']
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
@@ -1,3 +1,3 @@
1
1
  module Easemob
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
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.1
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-06 00:00:00.000000000 Z
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