rong_cloud_im 0.1.1 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc06ea88bfaa918119d51b82fcc4cfd3cedaa879
4
- data.tar.gz: b22c355d050d14fef5f7b573a8a4971288a911dc
3
+ metadata.gz: 7f67aa5f3127fd23954adc0117ee245386018eb6
4
+ data.tar.gz: 5bd2d10f506c19a25a9ca4611c1f6fb78f594208
5
5
  SHA512:
6
- metadata.gz: bdeb8be12c380ce0a25da4ebcdde51fc1322f332ac8cfd63d09739b64c7b65700c3fca98a7bac99e19fc4ccd8dc877875c41e2cac9687ec4d5b21189c4497fac
7
- data.tar.gz: 53dcab8ac1caad233b81e21e17f31188271a2c22ba4ddbaffd55dde0be57dde1d7536d7911df638d4d10954653d8cc1814af52ea02cc3f20f57658c9ba1f6be7
6
+ metadata.gz: 6ae137915433ad70ae84dce3269dbd7045d066f8f2192174120e96fa99260de2d1fa935bcd894d811a495e76f53d9c3cb3b9686a7759296a220bdcf174c560ed
7
+ data.tar.gz: 17e05f21f3e9d19cacdb4cf263645cb753db579c2ae649f8e651a5dbdd7a71e99a04d80cf5bd8327fae32e378ab7df900af7a86edca369cab1c9642a2be72573
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem "pry"
4
+
3
5
  # Specify your gem's dependencies in rong_cloud_im.gemspec
4
6
  gemspec
@@ -1,6 +1,10 @@
1
1
  module RongCloudIM
2
2
  class Message < Service
3
3
  ACTION_MESSAGE_HISTORY = "/message/history"
4
+ ACTION_PUBLISH = {
5
+ private: "/message/private/publish",
6
+ group: "/message/group/publish"
7
+ }
4
8
 
5
9
  class << self
6
10
  def history(params)
@@ -11,6 +15,27 @@ module RongCloudIM
11
15
  get_response(data, ACTION_MESSAGE_HISTORY)
12
16
  end
13
17
 
18
+ def publish(type, params)
19
+ data = {
20
+ fromUserId: params[:from_user_id],
21
+ objectName: params[:object_name],
22
+ content: params[:content],
23
+ pushContent: params[:push_content] || "",
24
+ pushData: params[:push_data] || "",
25
+ isPersisted: params[:is_persisted] || 1,
26
+ isCounted: params[:is_counted] || 1
27
+ }
28
+ case type
29
+ when :private
30
+ data[:toUserId] = params[:to_user_id]
31
+ data[:count] = params[:count] || 0
32
+ data[:verifyBlacklist ] = params[:verify_blacklist] || 0
33
+ when :group
34
+ data[:toGroupId] = params[:to_group_id]
35
+ end
36
+ get_response(data, ACTION_PUBLISH[type])
37
+ end
38
+
14
39
  end
15
40
  end
16
41
  end
@@ -1,3 +1,3 @@
1
1
  module RongCloudIM
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -5,7 +5,7 @@ require 'rong_cloud_im'
5
5
 
6
6
 
7
7
  RongCloudIM.app_key = 'c9kqb3rdklwcj'
8
- RongCloudIM.app_secret = 'RcSM2RQcHP5k'
8
+ RongCloudIM.app_secret = 'UdAkjlIgs7r'
9
9
 
10
10
  RSpec.configure do |config|
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rong_cloud_im
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - fwshun8023