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.
@@ -2,7 +2,7 @@
2
2
  <div class="header">
3
3
  <%=image_tag("btn/btn_friend.png", :class => "header_icon")%>
4
4
  <div class="header_text">
5
- Chat Connecting
5
+ <%=t('chat.connecting')%>
6
6
  </div>
7
7
  </div>
8
8
  </div>
@@ -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
- Chat
7
+ <%=t('chat.title')%>
8
8
  </div>
9
9
  </div>
10
10
 
11
11
  <div id="status" class="dropdown">
12
- <dt><a href=""><span>Establecer estado</span></a></dt>
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=""/> Disponible <span class="value">chat</span></a></li>
16
- <li><a href="#" class="option"><img class="flag" src="assets/status/away.png" alt=""/> Ausente <span class="value">away</span></a></li>
17
- <li><a href="#" class="option"><img class="flag" src="assets/status/dnd.png" alt=""/> No molestar <span class="value">dnd</span></a></li>
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
- <%=image_tag("status/" + contact.user.status + ".png", :class => "presence_status") %></a>
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
- Chat Disconnected
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">Password</label>
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">
@@ -12,7 +12,6 @@
12
12
 
13
13
  <p> <a href="/xmpp4r_test">Test</a></p>
14
14
  <p> <a href="/active_users">Usuarios conectados al servidor XMPP</a></p>
15
- <p> <a href="/chat">Chat</a></p>
16
15
 
17
16
  </div>
18
17
  </body>
@@ -0,0 +1,11 @@
1
+ en:
2
+ chat:
3
+ connecting: "Chat Connecting"
4
+ disconnected: "Chat Disconnected"
5
+ title: "Chat"
6
+ password: "Password"
7
+ status:
8
+ choose: "Choose status"
9
+ available: "Available"
10
+ away: "Away"
11
+ dnd: "Busy"
@@ -0,0 +1,11 @@
1
+ es:
2
+ chat:
3
+ connecting: "Chat Conectando"
4
+ disconnected: "Chat Desconectado"
5
+ title: "Chat"
6
+ password: "Contraseña"
7
+ status:
8
+ choose: "Establecer estado"
9
+ available: "Disponible"
10
+ away: "Ausente"
11
+ dnd: "No molestar"
@@ -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
- #XMPP DOMAIN
66
- domain = SocialStream::Presence.domain
67
- user_sid = self.sender.slug + "@" + domain
68
- user_name = self.sender.name
69
- buddy_sid = self.receiver.slug + "@" + domain
70
- buddy_name = self.receiver.name
71
-
72
- #Check if is a positive and replied tie
73
- if self.bidirectional?
74
- #Execute unsetRosterForBidirectionalTie(user_sid,oldfriend_sid,oldfriendNick,oldfriendGroup)
75
- SocialStream::Presence::XmppServerOrder::unsetRosterForBidirectionalTie(buddy_sid,user_sid,user_name,"SocialStream")
76
- elsif self.positive?
77
- #Case: Possitive tie unidirectional
78
- #Execute removeBuddyFromRoster(user_sid,buddy_sid)
79
- SocialStream::Presence::XmppServerOrder::removeBuddyFromRoster(user_sid,buddy_sid)
80
- else
81
- return
82
- end
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
@@ -1,5 +1,5 @@
1
1
  module Socialstream
2
2
  module Presence
3
- VERSION = "0.0.18"
3
+ VERSION = "0.0.19"
4
4
  end
5
5
  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.18
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>