wechat 0.7.18 → 0.7.19

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: d0b12575c8ffeebc966babb8c7cf0655f68ca248
4
- data.tar.gz: c070e35dcee44d50d598d28d8b7c87a840bf43a1
3
+ metadata.gz: df08372a47386eb8866ba7739473380696224651
4
+ data.tar.gz: c9a4a4553563aa7c3fdbd5028b04953d7ae02c8c
5
5
  SHA512:
6
- metadata.gz: b1e9cdc976df510d35e93c06d538867729d690a3e2d1b8783459757d4e548643ccc11677a42bcd90b854ff2e15ed476093f9d2884092c3f5bca25aa39650c187
7
- data.tar.gz: 37689d8404fec0b04d5a8eba6e80f128826bd027940407356259980f18628f1d5b0282a4bed792ab276ebae905a40407c39324ba4af435cc13ecaab56b8ef94f
6
+ metadata.gz: 3b7d7be0b12629838ff9d6a5772400049003ec098ac5720358ce246c1561cf407cc1702a3aee51642ee0d8daa6f4b074b31978b34f01bee09acf13b1e971fdc9
7
+ data.tar.gz: 626f445c5e52cb11eee43a4b07f0459f7804562aeec381dd98cb598cf3e123c19e07bb9d922add8e07b7b03d3f667cf23fe1c98298dad91b090493e92bbdec8e
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.7.19 (released at 8/25/2016)
4
+
5
+ * Enterprise account now custom_image/voice/file works now. by @zymiboxpay #145
6
+ * Fix timeout setting no effective since introduct HTTP. found by @hsluo #74
7
+
3
8
  ## v0.7.18 (released at 8/21/2016)
4
9
 
5
10
  * Support label_location message, similar to location event, but sent by user with Label. #144
@@ -164,5 +164,9 @@ module Wechat
164
164
  def message_send(userid, message)
165
165
  post 'message/send', Message.to(userid).text(message).agent_id(agentid).to_json, content_type: :json
166
166
  end
167
+
168
+ def custom_message_send(message)
169
+ post 'message/send', message.agent_id(agentid).to_json, content_type: :json
170
+ end
167
171
  end
168
172
  end
@@ -2,11 +2,11 @@ require 'http'
2
2
 
3
3
  module Wechat
4
4
  class HttpClient
5
- attr_reader :base, :ssl_context
5
+ attr_reader :base, :ssl_context, :httprb
6
6
 
7
7
  def initialize(base, timeout, skip_verify_ssl)
8
8
  @base = base
9
- HTTP.timeout(:global, write: timeout, connect: timeout, read: timeout)
9
+ @httprb = HTTP.timeout(:global, write: timeout, connect: timeout, read: timeout)
10
10
  @ssl_context = OpenSSL::SSL::SSLContext.new
11
11
  @ssl_context.ssl_version = :TLSv1_client
12
12
  @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE if skip_verify_ssl
@@ -15,21 +15,21 @@ module Wechat
15
15
  def get(path, get_header = {})
16
16
  request(path, get_header) do |url, header|
17
17
  params = header.delete(:params)
18
- HTTP.headers(header).get(url, params: params, ssl_context: ssl_context)
18
+ httprb.headers(header).get(url, params: params, ssl_context: ssl_context)
19
19
  end
20
20
  end
21
21
 
22
22
  def post(path, payload, post_header = {})
23
23
  request(path, post_header) do |url, header|
24
24
  params = header.delete(:params)
25
- HTTP.headers(header).post(url, params: params, body: payload, ssl_context: ssl_context)
25
+ httprb.headers(header).post(url, params: params, body: payload, ssl_context: ssl_context)
26
26
  end
27
27
  end
28
28
 
29
29
  def post_file(path, file, post_header = {})
30
30
  request(path, post_header) do |url, header|
31
31
  params = header.delete(:params)
32
- HTTP.headers(header)
32
+ httprb.headers(header)
33
33
  .post(url, params: params,
34
34
  form: { media: HTTP::FormData::File.new(file),
35
35
  hack: 'X' }, # Existing here for http-form_data 1.0.1 handle single param improperly
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.18
4
+ version: 0.7.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Skinnyworm
@@ -31,7 +31,7 @@ cert_chain:
31
31
  R5k6Ma92sW8jupX4cqbSu9rntdVQkNRpoHIrfU0MZT0cKsg/D1zMteylxrO3KMsz
32
32
  SPQRv+nrI1J0zevFqb8010heoR8SDyUA0Mm3+Q==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-08-21 00:00:00.000000000 Z
34
+ date: 2016-08-25 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
metadata.gz.sig CHANGED
Binary file