social_stream-presence 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- data/app/views/xmpp/_chat_connecting.html.erb +1 -1
- data/app/views/xmpp/_chat_contacts.html.erb +6 -6
- data/app/views/xmpp/_chat_off.html.erb +2 -2
- data/app/views/xmpp/index.html +0 -1
- data/config/locales/en.yml +11 -0
- data/config/locales/es.yml +11 -0
- data/lib/social_stream/presence/models/buddy_manager.rb +45 -32
- data/lib/social_stream/presence/version.rb +1 -1
- data/lib/social_stream/presence/xmpp_server_order.rb +1 -37
- metadata +3 -2
- data/app/views/xmpp/chat.html.erb +0 -13
@@ -4,17 +4,17 @@
|
|
4
4
|
<div class="header">
|
5
5
|
<%=image_tag("btn/btn_friend.png", :class => "header_icon")%>
|
6
6
|
<div class="header_text">
|
7
|
-
|
7
|
+
<%=t('chat.title')%>
|
8
8
|
</div>
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<div id="status" class="dropdown">
|
12
|
-
<dt><a href=""><span
|
12
|
+
<dt><a href=""><span><%=t('chat.status.choose')%></span></a></dt>
|
13
13
|
<dd>
|
14
14
|
<ul>
|
15
|
-
<li><a href="#" class="option"><img class="flag" src="assets/status/available.png" alt=""/>
|
16
|
-
<li><a href="#" class="option"><img class="flag" src="assets/status/away.png" alt=""/>
|
17
|
-
<li><a href="#" class="option"><img class="flag" src="assets/status/dnd.png" alt=""/>
|
15
|
+
<li><a href="#" class="option"><img class="flag" src="assets/status/available.png" alt=""/> <%=t('chat.status.available')%> <span class="value">chat</span></a></li>
|
16
|
+
<li><a href="#" class="option"><img class="flag" src="assets/status/away.png" alt=""/> <%=t('chat.status.away')%> <span class="value">away</span></a></li>
|
17
|
+
<li><a href="#" class="option"><img class="flag" src="assets/status/dnd.png" alt=""/> <%=t('chat.status.dnd')%> <span class="value">dnd</span></a></li>
|
18
18
|
</ul>
|
19
19
|
</dd>
|
20
20
|
</div>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
<a title='<%=contact.name%>' class="presence_user_link" width="28">
|
31
31
|
<%=image_tag(contact.logo.url, :alt => contact.name , :size => "28x28")%>
|
32
32
|
<% if contact.user.status %>
|
33
|
-
|
33
|
+
<%=image_tag("status/" + contact.user.status + ".png", :class => "presence_status") %></a>
|
34
34
|
<% end %>
|
35
35
|
</a>
|
36
36
|
</div>
|
@@ -35,14 +35,14 @@
|
|
35
35
|
<div class="header">
|
36
36
|
<%=image_tag("btn/btn_friend.png", :class => "header_icon")%>
|
37
37
|
<div class="header_text">
|
38
|
-
|
38
|
+
<%=t('chat.disconnected')%>
|
39
39
|
</div>
|
40
40
|
</div>
|
41
41
|
</div>
|
42
42
|
|
43
43
|
<div class="chat_off">
|
44
44
|
<div id="passwordFormChat">
|
45
|
-
<label for="user_password" class="chatPasswordTitle"
|
45
|
+
<label for="user_password" class="chatPasswordTitle"><%=t('chat.password')%></label>
|
46
46
|
<input id="user_password" class="chat_password" type="password"></input>
|
47
47
|
</div>
|
48
48
|
<input class="connectChatButton storePass" value="Connect">
|
data/app/views/xmpp/index.html
CHANGED
@@ -42,6 +42,16 @@ module SocialStream
|
|
42
42
|
subscription_type = "to"
|
43
43
|
SocialStream::Presence::XmppServerOrder::addBuddyToRoster(user_sid,buddy_sid,buddy_name,"SocialStream",subscription_type)
|
44
44
|
else
|
45
|
+
#Negative Tie
|
46
|
+
|
47
|
+
if self.contact.positive_replied?
|
48
|
+
#Bidirectional contacts
|
49
|
+
#Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)
|
50
|
+
SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,"SocialStream")
|
51
|
+
else
|
52
|
+
SocialStream::Presence::XmppServerOrder::removeBuddyFromRoster(user_sid,buddy_sid)
|
53
|
+
end
|
54
|
+
|
45
55
|
return
|
46
56
|
end
|
47
57
|
|
@@ -49,38 +59,41 @@ module SocialStream
|
|
49
59
|
|
50
60
|
|
51
61
|
def remove_buddy
|
52
|
-
|
53
|
-
unless SocialStream::Presence.enable
|
54
|
-
return
|
55
|
-
end
|
56
|
-
|
57
|
-
unless self.receiver and self.sender
|
58
|
-
return
|
59
|
-
end
|
60
|
-
|
61
|
-
unless self.receiver.subject_type == "User" and self.sender.subject_type == "User"
|
62
|
-
return
|
63
|
-
end
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
#
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
62
|
+
#
|
63
|
+
# unless SocialStream::Presence.enable
|
64
|
+
# return
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
# unless self.receiver and self.sender
|
68
|
+
# return
|
69
|
+
# end
|
70
|
+
#
|
71
|
+
# unless self.receiver.subject_type == "User" and self.sender.subject_type == "User"
|
72
|
+
# return
|
73
|
+
# end
|
74
|
+
#
|
75
|
+
# if self.contact.established?
|
76
|
+
# return
|
77
|
+
# end
|
78
|
+
#
|
79
|
+
# #XMPP DOMAIN
|
80
|
+
# domain = SocialStream::Presence.domain
|
81
|
+
# user_sid = self.sender.slug + "@" + domain
|
82
|
+
# user_name = self.sender.name
|
83
|
+
# buddy_sid = self.receiver.slug + "@" + domain
|
84
|
+
#
|
85
|
+
# #Check if is a positive and replied tie
|
86
|
+
# if self.bidirectional?
|
87
|
+
# #Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)
|
88
|
+
# SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,"SocialStream")
|
89
|
+
# elsif self.positive?
|
90
|
+
# #Case: Possitive tie unidirectional
|
91
|
+
# #Execute removeBuddyFromRoster(user_sid,buddy_sid)
|
92
|
+
# SocialStream::Presence::XmppServerOrder::removeBuddyFromRoster(user_sid,buddy_sid)
|
93
|
+
# else
|
94
|
+
# return
|
95
|
+
# end
|
96
|
+
#
|
84
97
|
end
|
85
98
|
|
86
99
|
end
|
@@ -28,43 +28,7 @@ module SocialStream
|
|
28
28
|
|
29
29
|
def removeBuddyFromRoster(userSid,buddySid)
|
30
30
|
executeEmanagementCommand("removeBuddyFromRoster",[userSid,buddySid])
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
#Before delete contact (destroy ties) callback
|
35
|
-
def removeBuddy(contact)
|
36
|
-
|
37
|
-
unless SocialStream::Presence.enable
|
38
|
-
return
|
39
|
-
end
|
40
|
-
|
41
|
-
unless contact.receiver and contact.sender
|
42
|
-
return
|
43
|
-
end
|
44
|
-
|
45
|
-
unless contact.receiver.subject_type == "User" and contact.sender.subject_type == "User"
|
46
|
-
return
|
47
|
-
end
|
48
|
-
|
49
|
-
#XMPP DOMAIN
|
50
|
-
domain = SocialStream::Presence.domain
|
51
|
-
user_sid = contact.sender.slug + "@" + domain
|
52
|
-
user_name = contact.sender.name
|
53
|
-
buddy_sid = contact.receiver.slug + "@" + domain
|
54
|
-
buddy_name = contact.receiver.name
|
55
|
-
|
56
|
-
#Check for bidirecctional
|
57
|
-
|
58
|
-
if contact.sender.contact_actors(:type=>:user).include?(contact.receiver)
|
59
|
-
#Bidirectional contacts
|
60
|
-
#Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)
|
61
|
-
unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,"SocialStream")
|
62
|
-
elsif contact.sender.contact_actors(:type=>:user, :direction=>:sent).include?(contact.receiver)
|
63
|
-
#Unidirectional contacts
|
64
|
-
removeBuddyFromRoster(user_sid,buddy_sid)
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
31
|
+
end
|
68
32
|
|
69
33
|
|
70
34
|
def synchronizePresence
|
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.
|
5
|
+
version: 0.0.19
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Aldo Gordillo
|
@@ -94,9 +94,10 @@ files:
|
|
94
94
|
- app/views/xmpp/_chat_contacts.html.erb
|
95
95
|
- app/views/xmpp/_chat_off.html.erb
|
96
96
|
- app/views/xmpp/active_users.html.erb
|
97
|
-
- app/views/xmpp/chat.html.erb
|
98
97
|
- app/views/xmpp/index.html
|
99
98
|
- app/views/xmpp/test.html.erb
|
99
|
+
- config/locales/en.yml
|
100
|
+
- config/locales/es.yml
|
100
101
|
- config/routes.rb
|
101
102
|
- db/migrate/20110711111408_add_connected_column_to_user.rb
|
102
103
|
- db/migrate/20110928135031_add_status_column_to_user.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3
|
-
<head>
|
4
|
-
<title>Chat</title>
|
5
|
-
</head>
|
6
|
-
<body>
|
7
|
-
<script type="text/javascript">
|
8
|
-
sessionStorage.setItem("ss_user_pass","demonstration")
|
9
|
-
</script>
|
10
|
-
<%= render :partial => 'xmpp/chat' %>
|
11
|
-
<p> <a href="/test">Volver</a></p>
|
12
|
-
</body>
|
13
|
-
</html>
|