rfetion 0.4.1 → 0.4.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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/rfetion/fetion.rb +10 -5
  3. data/rfetion.gemspec +2 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -145,13 +145,18 @@ class Fetion
145
145
  call = next_call
146
146
  arg = '<args><device type="PC" version="284571220" client-version="3.3.0370" /><caps value="simple-im;im-session;temp-group;personal-group" /><events value="contact;permission;system-message;personal-group" /><user-info attributes="all" /><presence><basic value="400" desc="" /></presence></args>'
147
147
 
148
- register_first(call, arg)
149
-
150
148
  # get nonce, it failed, try again 16s later
149
+ begin
150
+ register_first(call, arg)
151
+ rescue
152
+ sleep 16
153
+ register_first(call, arg)
154
+ end
155
+
151
156
  begin
152
157
  register_second(call, arg)
153
158
  rescue
154
- sleep(16)
159
+ sleep 16
155
160
  register_second(call, arg)
156
161
  end
157
162
  @logger.info "fetion http register success"
@@ -310,11 +315,11 @@ class Fetion
310
315
 
311
316
  def logout
312
317
  @logger.info "fetion logout"
313
- msg = sip_create('R fetion.com.cn SIP-C/2.0', {'F' => @sid, 'I' => next_call, 'Q' => '2 R', 'X' => 0}, '') + FETION_SIPP
318
+ msg = sip_create('R fetion.com.cn SIP-C/2.0', {'F' => @sid, 'I' => 1, 'Q' => '3 R', 'X' => 0}, '') + FETION_SIPP
314
319
  curl_exec(next_url, @ssic, msg)
315
320
  response = curl_exec(next_url, @ssic, FETION_SIPP)
316
321
 
317
- raise FetionException.new("Fetion Error: Logout error") unless response.is_a? Net::HTTPSuccess
322
+ # raise FetionException.new("Fetion Error: Logout error") unless response.is_a? Net::HTTPSuccess
318
323
  @logger.info "fetion logout success"
319
324
  end
320
325
 
data/rfetion.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rfetion}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Richard Huang"]
12
- s.date = %q{2009-12-10}
12
+ s.date = %q{2009-12-15}
13
13
  s.description = %q{rfetion is a ruby gem for China Mobile fetion service that you can send SMS free.}
14
14
  s.email = %q{flyerhzm@gmail.com}
15
15
  s.executables = ["rfetion", "rfetion"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfetion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-10 00:00:00 +08:00
12
+ date: 2009-12-15 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency