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(
|
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(
|
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 =
|
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 =
|
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(
|
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(
|
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
|
-
|
12
|
+
def save_buddy
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
-
|
37
|
-
|
38
|
-
#Execute
|
39
|
-
SocialStream::Presence::XmppServerOrder::
|
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
|
-
|
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
|
-
|
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
|
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
|
+
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-
|
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: &
|
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.
|
21
|
+
version: 0.14.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *85041730
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: xmpp4r
|
27
|
-
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: *
|
35
|
+
version_requirements: *85041520
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: net-ssh
|
38
|
-
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: *
|
46
|
+
version_requirements: *85041290
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: net-sftp
|
49
|
-
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: *
|
57
|
+
version_requirements: *85041080
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: ruby-debug19
|
60
|
-
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: *
|
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:
|