social_stream-presence 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,7 +24,7 @@ function connectButtonTimerFunction(){
24
24
  connectButtonTimerCounter++;
25
25
  if (connectButtonTimerCounter > (periodBetweenAttempts-1)) {
26
26
  clearTimeout(connectButtonTimer);
27
- $("#chat_header_title").html('<%=I18n.t('chat.disconnected')%>')
27
+ $("#chat_header_title").html(I18n.t('chat.disconnected'))
28
28
  }
29
29
  }
30
30
 
@@ -32,7 +32,7 @@ function requestConnectToChat(){
32
32
  if (connectButtonTimerCounter > (periodBetweenAttempts-1)) {
33
33
  connectButtonTimerCounter=0;
34
34
  connectButtonTimer = setInterval("connectButtonTimerFunction()", 1000)
35
- $("#chat_header_title").html('<%=I18n.t('chat.connecting')%>')
35
+ $("#chat_header_title").html(I18n.t('chat.connecting'))
36
36
  return true
37
37
  } else {
38
38
  return false
@@ -108,7 +108,7 @@ function setStatusWidgetTitle(status){
108
108
  }
109
109
 
110
110
  if(status=="default"){
111
- var defaultTitle = '<%=I18n.t('chat.status.choose')%>'
111
+ var defaultTitle = I18n.t('chat.status.choose');
112
112
  $(".dropdown dt a span").html(defaultTitle);
113
113
  return;
114
114
  }
@@ -324,11 +324,11 @@ function hideChatNotification(notification){
324
324
 
325
325
  function notifyWhenUsersDisconnect(){
326
326
  var notification = $("div.ui-chatbox-notify");
327
- var msg = '<%=I18n.t('chat.notify.offline')%>';
327
+ var msg = I18n.t('chat.notify.offline');
328
328
  showChatNotification(notification,msg);
329
329
  }
330
330
 
331
331
  function hideAllNotifications(){
332
332
  var notification = $("div.ui-chatbox-notify");
333
333
  hideChatNotification(notification);
334
- }
334
+ }
@@ -187,7 +187,7 @@ function onReconnect(){
187
187
  if (reconnectAttempts>0) {
188
188
  reconnectAttempts--;
189
189
 
190
- $("#chat_header_title").html('<%=I18n.t('chat.reconnecting')%>')
190
+ $("#chat_header_title").html(I18n.t('chat.reconnecting'))
191
191
 
192
192
  if (authByCookie()){
193
193
  //Authentication by cookie
@@ -198,7 +198,7 @@ function onReconnect(){
198
198
  }
199
199
  reconnectTimer = setTimeout ("onReconnect()", 9000);
200
200
  } else {
201
- $("#chat_header_title").html('<%=I18n.t('chat.unableconnect')%>')
201
+ $("#chat_header_title").html(I18n.t('chat.unableconnect'))
202
202
  //Notify issue to Rails App Server?
203
203
  }
204
204
 
@@ -323,4 +323,4 @@ function sendStatus(status){
323
323
  connection.send(pres.tree());
324
324
  setStatusWidgetTitle(status);
325
325
  }
326
- }
326
+ }
@@ -9,57 +9,55 @@ module SocialStream
9
9
  after_destroy :remove_buddy
10
10
  end
11
11
 
12
- module InstanceMethods
12
+ def save_buddy
13
13
 
14
- def save_buddy
15
-
16
- unless SocialStream::Presence.enable
17
- return
18
- end
19
-
20
- unless self.receiver and self.sender
21
- return
22
- end
23
-
24
- unless self.receiver.subject_type == "User" and self.sender.subject_type == "User"
25
- return
26
- end
27
-
28
- #XMPP DOMAIN
29
- domain = SocialStream::Presence.domain
30
- user_sid = self.sender.slug + "@" + domain
31
- user_name = self.sender.name
32
- buddy_sid = self.receiver.slug + "@" + domain
33
- buddy_name = self.receiver.name
34
- site_name = I18n.t('site.name').delete(' ')
14
+ unless SocialStream::Presence.enable
15
+ return
16
+ end
17
+
18
+ unless self.receiver and self.sender
19
+ return
20
+ end
21
+
22
+ unless self.receiver.subject_type == "User" and self.sender.subject_type == "User"
23
+ return
24
+ end
25
+
26
+ #XMPP DOMAIN
27
+ domain = SocialStream::Presence.domain
28
+ user_sid = self.sender.slug + "@" + domain
29
+ user_name = self.sender.name
30
+ buddy_sid = self.receiver.slug + "@" + domain
31
+ buddy_name = self.receiver.name
32
+ site_name = I18n.t('site.name').delete(' ')
33
+
34
+ #Check if is a positive and replied tie
35
+ if self.bidirectional?
36
+ #Execute setRosterForBidirectionalTie(userASid,userBSid,userANick,userBNick,groupForA,groupForB)
37
+ SocialStream::Presence::XmppServerOrder::setRosterForBidirectionalTie(user_sid,buddy_sid,user_name,buddy_name,site_name,site_name)
38
+ elsif self.positive?
39
+ #Case: Possitive tie unidirectional
40
+ #Execute addBuddyToRoster(userSID,buddySID,buddyNick,buddyGroup,subscription_type)
41
+ subscription_type = "from"
42
+ SocialStream::Presence::XmppServerOrder::addBuddyToRoster(user_sid,buddy_sid,buddy_name,site_name,subscription_type)
43
+ else
44
+ #Negative Tie
35
45
 
36
- #Check if is a positive and replied tie
37
- if self.bidirectional?
38
- #Execute setRosterForBidirectionalTie(userASid,userBSid,userANick,userBNick,groupForA,groupForB)
39
- SocialStream::Presence::XmppServerOrder::setRosterForBidirectionalTie(user_sid,buddy_sid,user_name,buddy_name,site_name,site_name)
40
- elsif self.positive?
41
- #Case: Possitive tie unidirectional
42
- #Execute addBuddyToRoster(userSID,buddySID,buddyNick,buddyGroup,subscription_type)
43
- subscription_type = "from"
44
- SocialStream::Presence::XmppServerOrder::addBuddyToRoster(user_sid,buddy_sid,buddy_name,site_name,subscription_type)
46
+ if self.contact.positive_replied?
47
+ #Bidirectional contacts
48
+ #Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)
49
+ SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,site_name)
45
50
  else
46
- #Negative Tie
47
-
48
- if self.contact.positive_replied?
49
- #Bidirectional contacts
50
- #Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)
51
- SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,site_name)
52
- else
53
- SocialStream::Presence::XmppServerOrder::removeBuddyFromRoster(user_sid,buddy_sid)
54
- end
55
-
56
- return
51
+ SocialStream::Presence::XmppServerOrder::removeBuddyFromRoster(user_sid,buddy_sid)
57
52
  end
58
53
 
54
+ return
59
55
  end
60
56
 
61
-
62
- def remove_buddy
57
+ end
58
+
59
+
60
+ def remove_buddy
63
61
  #
64
62
  # unless SocialStream::Presence.enable
65
63
  # return
@@ -95,10 +93,8 @@ module SocialStream
95
93
  # return
96
94
  # end
97
95
  #
98
- end
99
-
100
96
  end
101
97
  end
102
98
  end
103
99
  end
104
- end
100
+ end
@@ -1,5 +1,5 @@
1
1
  module Socialstream
2
2
  module Presence
3
- VERSION = "0.4.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  # Gem dependencies
22
- s.add_runtime_dependency('social_stream-base', '~> 0.13.0')
22
+ s.add_runtime_dependency('social_stream-base', '~> 0.14.0')
23
23
 
24
24
  s.add_runtime_dependency "xmpp4r"
25
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-presence
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-23 00:00:00.000000000Z
12
+ date: 2012-01-26 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: social_stream-base
16
- requirement: &73531950 !ruby/object:Gem::Requirement
16
+ requirement: &85041730 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.13.0
21
+ version: 0.14.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *73531950
24
+ version_requirements: *85041730
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: xmpp4r
27
- requirement: &73531310 !ruby/object:Gem::Requirement
27
+ requirement: &85041520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *73531310
35
+ version_requirements: *85041520
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: net-ssh
38
- requirement: &73530730 !ruby/object:Gem::Requirement
38
+ requirement: &85041290 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *73530730
46
+ version_requirements: *85041290
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: net-sftp
49
- requirement: &73530280 !ruby/object:Gem::Requirement
49
+ requirement: &85041080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *73530280
57
+ version_requirements: *85041080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: ruby-debug19
60
- requirement: &73529900 !ruby/object:Gem::Requirement
60
+ requirement: &85040870 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *73529900
68
+ version_requirements: *85040870
69
69
  description: Social Stream is a Ruby on Rails engine providing your application with
70
70
  social networking features and activity streams.
71
71
  email: