social_stream-presence 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,7 @@ scripts_path=/my_scripts_path
16
16
  #API REST
17
17
  auth_api=http://localhost/users/sign_in
18
18
  auth_by_cookie_api=http://localhost/api/me
19
+ cookie_name=_rails_server_cookie
19
20
  set_connection_api=http://localhost/xmpp/setConnection
20
21
  unset_connection_api=http://localhost/xmpp/unsetConnection
21
22
  reset_connection_api=http://localhost/xmpp/resetConnection
@@ -33,6 +33,7 @@ end
33
33
 
34
34
  $accessUrl = getOption("auth_api=")
35
35
  $accessByCookieUrl = getOption("auth_by_cookie_api=")
36
+ $cookie_name = getOption("cookie_name=")
36
37
  $sslogin = getOption("ss_login=")
37
38
  $sspass = getOption("ss_password=")
38
39
 
@@ -80,7 +81,7 @@ end
80
81
 
81
82
  def authByCookie(username, cookie)
82
83
  begin
83
- response = RestClient.get $accessByCookieUrl, :cookies => {:_global_session => cookie}
84
+ response = RestClient.get $accessByCookieUrl, :cookies => {:"#{$cookie_name}" => cookie}
84
85
  doc = REXML::Document.new(response.body)
85
86
 
86
87
  slug = ""
@@ -149,6 +150,7 @@ loop do
149
150
  authByCookie(data[0], cookie)
150
151
  else
151
152
  $logger.info "#{Process.pid}: With username #{data[0]} and password ******"
153
+ #$logger.info "#{Process.pid}: With username #{data[0]} and password #{data[2]}"
152
154
  auth(data[0], data[2])
153
155
  end
154
156
 
@@ -17,6 +17,10 @@ module SocialStream
17
17
  return
18
18
  end
19
19
 
20
+ unless self.receiver and self.sender
21
+ return
22
+ end
23
+
20
24
  unless self.receiver.subject_type == "User" and self.sender.subject_type == "User"
21
25
  return
22
26
  end
@@ -50,6 +54,10 @@ module SocialStream
50
54
  return
51
55
  end
52
56
 
57
+ unless self.receiver and self.sender
58
+ return
59
+ end
60
+
53
61
  unless self.receiver.subject_type == "User" and self.sender.subject_type == "User"
54
62
  return
55
63
  end
@@ -1,5 +1,5 @@
1
1
  module Socialstream
2
2
  module Presence
3
- VERSION = "0.0.16"
3
+ VERSION = "0.0.17"
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: social_stream-presence
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.16
5
+ version: 0.0.17
6
6
  platform: ruby
7
7
  authors:
8
8
  - Aldo Gordillo