social_stream 0.22.0 → 0.22.1
Sign up to get free protection for your applications and to get access to all the features.
- data/base/app/assets/javascripts/social_stream.search.js.erb +27 -0
- data/base/app/assets/stylesheets/activities.css.scss +2 -0
- data/base/app/controllers/search_controller.rb +5 -2
- data/base/app/helpers/activities_helper.rb +19 -0
- data/base/app/helpers/search_helper.rb +37 -7
- data/base/app/models/actor.rb +2 -1
- data/base/app/models/group.rb +2 -0
- data/base/app/views/activities/_likes.html.erb +5 -0
- data/base/app/views/activities/_root.html.erb +3 -0
- data/base/app/views/cheesecake/_cheesecake.html.erb +1 -1
- data/base/app/views/search/_form.html.erb +27 -48
- data/base/config/locales/en.yml +21 -3
- data/base/config/locales/es.yml +14 -3
- data/base/lib/social_stream/base/version.rb +1 -1
- data/documents/config/locales/en.yml +12 -3
- data/documents/config/locales/es.yml +12 -4
- data/documents/lib/social_stream/documents/version.rb +1 -1
- data/documents/lib/social_stream/toolbar_config/documents.rb +2 -2
- data/documents/social_stream-documents.gemspec +1 -1
- data/events/app/views/events/index.html.erb +2 -2
- data/events/config/locales/en.yml +4 -1
- data/events/config/locales/es.yml +4 -1
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/presence/app/assets/javascripts/social_stream-presence.js +1 -0
- data/presence/app/assets/javascripts/xmpp_client_management.js.erb +14 -2
- data/presence/lib/social_stream/presence/engine.rb +6 -0
- data/presence/lib/social_stream/presence/models/group_manager.rb +41 -0
- data/presence/lib/social_stream/presence/version.rb +1 -1
- data/presence/lib/social_stream/presence/xmpp_server_order.rb +84 -10
- data/presence/lib/social_stream-presence.rb +1 -1
- data/presence/lib/tasks/presence/synchronize.rake +15 -0
- data/presence/social_stream-presence.gemspec +4 -4
- data/presence/vendor/assets/javascripts/strophe.muc.js +934 -0
- data/social_stream.gemspec +3 -3
- metadata +33 -29
@@ -0,0 +1,41 @@
|
|
1
|
+
module SocialStream
|
2
|
+
module Presence
|
3
|
+
module Models
|
4
|
+
module GroupManager
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
after_create :create_group_room
|
9
|
+
after_destroy :remove_group_room
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_group_room
|
13
|
+
|
14
|
+
unless SocialStream::Presence.enable
|
15
|
+
return
|
16
|
+
end
|
17
|
+
|
18
|
+
unless self.subject_type == "Group"
|
19
|
+
return
|
20
|
+
end
|
21
|
+
|
22
|
+
SocialStream::Presence::XmppServerOrder::createPersistentRoom(self.slug,SocialStream::Presence.domain)
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
def remove_group_room
|
27
|
+
|
28
|
+
unless SocialStream::Presence.enable
|
29
|
+
return
|
30
|
+
end
|
31
|
+
|
32
|
+
unless self.subject_type == "Group"
|
33
|
+
return
|
34
|
+
end
|
35
|
+
|
36
|
+
SocialStream::Presence::XmppServerOrder::destroyRoom(self.slug,SocialStream::Presence.domain)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -7,7 +7,11 @@ module SocialStream
|
|
7
7
|
class XmppServerOrder
|
8
8
|
|
9
9
|
class << self
|
10
|
-
|
10
|
+
|
11
|
+
##################
|
12
|
+
#Emanagement Calls
|
13
|
+
##################
|
14
|
+
|
11
15
|
def setRosterForBidirectionalTie(userASid,userBSid,userANick,userBNick,groupForA,groupForB)
|
12
16
|
executeEmanagementCommand("setBidireccionalBuddys",[userASid,userBSid,userANick,userBNick,groupForA,groupForB])
|
13
17
|
end
|
@@ -27,8 +31,23 @@ module SocialStream
|
|
27
31
|
executeEmanagementCommand("removeBuddyFromRoster",[userSid,buddySid])
|
28
32
|
end
|
29
33
|
|
34
|
+
|
35
|
+
def createPersistentRoom(roomName,domain)
|
36
|
+
executeEmanagementCommand("createPersistentRoom",[roomName,domain])
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def destroyRoom(roomName,domain)
|
41
|
+
executeEmanagementCommand("destroyRoom",[roomName,domain])
|
42
|
+
end
|
43
|
+
|
30
44
|
|
45
|
+
|
46
|
+
|
47
|
+
##################
|
31
48
|
# Presence synchronization
|
49
|
+
##################
|
50
|
+
|
32
51
|
def synchronizePresence(webDomain)
|
33
52
|
if isEjabberdNodeUp
|
34
53
|
if (webDomain=="all")
|
@@ -106,8 +125,12 @@ module SocialStream
|
|
106
125
|
end
|
107
126
|
|
108
127
|
|
109
|
-
|
110
|
-
|
128
|
+
|
129
|
+
|
130
|
+
##################
|
131
|
+
# Rosters synchronization
|
132
|
+
##################
|
133
|
+
|
111
134
|
def removeAllRosters(webDomain)
|
112
135
|
executeEmanagementCommand("removeAllRostersByDomain",[webDomain])
|
113
136
|
end
|
@@ -140,7 +163,39 @@ module SocialStream
|
|
140
163
|
end
|
141
164
|
|
142
165
|
|
143
|
-
|
166
|
+
|
167
|
+
|
168
|
+
##################
|
169
|
+
# Room (MUC) synchronization
|
170
|
+
##################
|
171
|
+
|
172
|
+
def removeAllRooms(webDomain)
|
173
|
+
executeEmanagementCommand("destroyAllRoomsByDomain",[webDomain])
|
174
|
+
end
|
175
|
+
|
176
|
+
|
177
|
+
def synchronizeRooms(webDomain)
|
178
|
+
commands = []
|
179
|
+
|
180
|
+
#Remove all mucs
|
181
|
+
commands << buildCommand("emanagement","destroyAllRoomsByDomain",[webDomain])
|
182
|
+
|
183
|
+
#Populate mucs
|
184
|
+
groups = Group.all
|
185
|
+
|
186
|
+
groups.each do |group|
|
187
|
+
commands << buildCommand("emanagement","createRoom",[group.slug,webDomain])
|
188
|
+
end
|
189
|
+
|
190
|
+
executeCommands(commands)
|
191
|
+
end
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
##################
|
197
|
+
# Installation methods
|
198
|
+
##################
|
144
199
|
|
145
200
|
def copyFolderToXmppServer(oPath,dPath)
|
146
201
|
if SocialStream::Presence.remote_xmpp_server
|
@@ -311,7 +366,12 @@ module SocialStream
|
|
311
366
|
puts "Finish"
|
312
367
|
end
|
313
368
|
|
314
|
-
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
##################
|
373
|
+
# Execution commands management
|
374
|
+
##################
|
315
375
|
|
316
376
|
def buildCommand(script,order,params)
|
317
377
|
command = SocialStream::Presence.scripts_path + "/" + script + " " + order
|
@@ -411,7 +471,12 @@ module SocialStream
|
|
411
471
|
end
|
412
472
|
|
413
473
|
|
414
|
-
|
474
|
+
|
475
|
+
|
476
|
+
##################
|
477
|
+
# Authorization methods
|
478
|
+
##################
|
479
|
+
|
415
480
|
def authorization(params)
|
416
481
|
case SocialStream::Presence.secure_rest_api
|
417
482
|
when true
|
@@ -509,11 +574,15 @@ module SocialStream
|
|
509
574
|
#Non Secure Mode
|
510
575
|
return params
|
511
576
|
end
|
512
|
-
end
|
577
|
+
end
|
513
578
|
|
514
579
|
|
515
|
-
|
516
|
-
|
580
|
+
|
581
|
+
|
582
|
+
##################
|
583
|
+
# Help methods
|
584
|
+
##################
|
585
|
+
|
517
586
|
def isEjabberdNodeUp
|
518
587
|
output = executeEmanagementCommand("isEjabberdNodeStarted",[])
|
519
588
|
nodeUp = output.split("\n")[0]
|
@@ -536,7 +605,12 @@ module SocialStream
|
|
536
605
|
end
|
537
606
|
|
538
607
|
|
539
|
-
|
608
|
+
|
609
|
+
|
610
|
+
##################
|
611
|
+
# Multidomain tasks
|
612
|
+
##################
|
613
|
+
|
540
614
|
def addWebDomain(domain,url)
|
541
615
|
commands = []
|
542
616
|
if url
|
@@ -14,9 +14,9 @@ module SocialStream
|
|
14
14
|
|
15
15
|
module Models
|
16
16
|
autoload :BuddyManager, 'social_stream/presence/models/buddy_manager'
|
17
|
+
autoload :GroupManager, 'social_stream/presence/models/group_manager'
|
17
18
|
end
|
18
19
|
|
19
|
-
|
20
20
|
mattr_accessor :domain
|
21
21
|
mattr_accessor :bosh_service
|
22
22
|
mattr_accessor :auth_method
|
@@ -32,5 +32,20 @@ namespace :presence do
|
|
32
32
|
SocialStream::Presence::XmppServerOrder::synchronizeRosters(domain)
|
33
33
|
puts "Rosters Synchronization complete"
|
34
34
|
end
|
35
|
+
|
36
|
+
desc "Synchronize Xmpp Server database with Social Stream Rails Application database."
|
37
|
+
desc "Remove all rooms and create one room (also knowledge as MUC) for each Social Stream group."
|
38
|
+
task :rooms, [:domain] => :environment do |t, args|
|
39
|
+
puts "Starting presence:synchronize:rooms"
|
40
|
+
unless args[:domain]
|
41
|
+
puts "No web domain specified"
|
42
|
+
domain = SocialStream::Presence.domain
|
43
|
+
puts "Executing rake presence:synchronize:rooms[" + domain + "]"
|
44
|
+
else
|
45
|
+
domain = args[:domain]
|
46
|
+
end
|
47
|
+
SocialStream::Presence::XmppServerOrder::synchronizeRooms(domain)
|
48
|
+
puts "Rooms Synchronization complete"
|
49
|
+
end
|
35
50
|
end
|
36
51
|
end
|
@@ -6,10 +6,10 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = "social_stream-presence"
|
7
7
|
s.version = SocialStream::Presence::VERSION
|
8
8
|
s.authors = ["Aldo Gordillo"]
|
9
|
-
s.email = ["
|
10
|
-
s.homepage = "https://github.com/ging/social_stream-
|
11
|
-
s.summary = "Presence capabilities for Social Stream, the core for building social network websites"
|
12
|
-
s.description = "Social Stream
|
9
|
+
s.email = ["agordillos@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/ging/social_stream/wiki/Getting-Started-With-Social-Stream-Presence"
|
11
|
+
s.summary = "Presence capabilities for Social Stream, the core for building social network websites."
|
12
|
+
s.description = "Social Stream Presence provides everything you need for including presence, instant messaging and video chat services in your social network website, including a complete chat fully integrated with Social Stream."
|
13
13
|
|
14
14
|
s.rubyforge_project = "social_stream-presence"
|
15
15
|
|