bigbluebutton_rails 2.3.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -2
- data/Gemfile +0 -1
- data/Gemfile.lock +27 -27
- data/Rakefile +15 -14
- data/app/controllers/bigbluebutton/api/rooms_controller.rb +2 -2
- data/app/controllers/bigbluebutton/meetings_controller.rb +69 -0
- data/app/controllers/bigbluebutton/recordings_controller.rb +2 -8
- data/app/controllers/bigbluebutton/rooms_controller.rb +5 -4
- data/app/controllers/bigbluebutton/servers_controller.rb +2 -2
- data/app/models/bigbluebutton_meeting.rb +1 -1
- data/app/models/bigbluebutton_recording.rb +15 -3
- data/app/models/bigbluebutton_room.rb +28 -18
- data/app/models/bigbluebutton_server.rb +9 -9
- data/app/views/bigbluebutton/meetings/_form.html.erb +30 -0
- data/app/views/bigbluebutton/meetings/edit.html.erb +5 -0
- data/app/views/bigbluebutton/recordings/_form.html.erb +0 -4
- data/app/views/bigbluebutton/recordings/_recordings.html.erb +0 -1
- data/app/views/bigbluebutton/recordings/show.html.erb +0 -5
- data/app/views/bigbluebutton/rooms/_form.html.erb +2 -2
- data/app/views/bigbluebutton/rooms/_rooms.html.erb +1 -1
- data/app/views/bigbluebutton/rooms/show.html.erb +2 -2
- data/app/views/bigbluebutton/servers/_form.html.erb +2 -2
- data/app/views/bigbluebutton/servers/index.html.erb +1 -1
- data/app/views/bigbluebutton/servers/show.html.erb +2 -2
- data/app/workers/bigbluebutton_recordings_for_room_worker.rb +1 -1
- data/config/locales/en.yml +37 -24
- data/config/locales/pt-br.yml +37 -24
- data/lib/bigbluebutton_rails/configuration.rb +3 -0
- data/lib/bigbluebutton_rails/rails/routes.rb +6 -1
- data/lib/bigbluebutton_rails/version.rb +1 -1
- data/lib/generators/bigbluebutton_rails/templates/migration.rb +3 -3
- data/lib/generators/bigbluebutton_rails/templates/migration_2_4_0.rb +18 -0
- data/lib/generators/bigbluebutton_rails/templates/migration_2_5_0.rb +9 -0
- data/spec/controllers/bigbluebutton/api/rooms_controller_spec.rb +3 -3
- data/spec/controllers/bigbluebutton/meetings_controller_spec.rb +199 -0
- data/spec/controllers/bigbluebutton/recordings_controller_spec.rb +3 -3
- data/spec/controllers/bigbluebutton/rooms_controller_exception_handling_spec.rb +4 -2
- data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +12 -6
- data/spec/controllers/bigbluebutton/servers_controller_spec.rb +8 -8
- data/spec/factories/bigbluebutton_meeting.rb +1 -0
- data/spec/factories/bigbluebutton_recording.rb +0 -1
- data/spec/factories/bigbluebutton_room.rb +1 -1
- data/spec/factories/bigbluebutton_server.rb +1 -1
- data/spec/models/bigbluebutton_meeting_db_spec.rb +2 -0
- data/spec/models/bigbluebutton_meeting_spec.rb +1 -1
- data/spec/models/bigbluebutton_recording_db_spec.rb +0 -1
- data/spec/models/bigbluebutton_recording_spec.rb +0 -4
- data/spec/models/bigbluebutton_room_db_spec.rb +1 -1
- data/spec/models/bigbluebutton_room_spec.rb +58 -69
- data/spec/models/bigbluebutton_server_db_spec.rb +1 -1
- data/spec/models/bigbluebutton_server_spec.rb +26 -26
- data/spec/rails_app/features/step_definitions/create_rooms_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/create_servers_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/destroy_rooms_steps.rb +1 -1
- data/spec/rails_app/features/step_definitions/destroy_servers_steps.rb +1 -1
- data/spec/rails_app/features/support/templates.rb +10 -10
- data/spec/rails_app/lib/tasks/db/populate.rake +0 -1
- data/spec/routing/bigbluebutton/meetings_routing_spec.rb +14 -0
- data/spec/support/controllers/bigbluebutton/rooms_controller.rb +6 -2
- data/spec/support/mocked_server.rb +2 -2
- metadata +8 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11d54d5048d19522934b6204fd71ff45a618bd6a
|
4
|
+
data.tar.gz: 257cda68bff0f0fb1217761fe913892558cbebb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bec8ac81fede7c116cce3c7946ef1141ec4761eb5408252a6013bf2d90e0535f0862782e42b8f9e5d81020809172178f96bfe01d1a6e29e3adb1867323b8b48f
|
7
|
+
data.tar.gz: 904805e273db9719f0996eabe2b0acd6f1d9c7209a2331b35bec60b5622f2253e075b5158d72a0404912bb57489edecc90326a279fa9468edd322c285eb47a7c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [3.0.0] - 2019-11-18
|
4
|
+
|
5
|
+
* Rename Room's and Server's #param to #slug.
|
6
|
+
* New route and logic to remove meeting objects.
|
7
|
+
* Remove `description` from meetings, move contents to `title`.
|
8
|
+
* Add option for users to edit the title of meetings.
|
9
|
+
* Send participant count in the ajax response when the meeting is running.
|
10
|
+
* Use incremental numbers when generating dial numbers, not random ones.
|
11
|
+
* Remove recordings when a meeting is removed.
|
12
|
+
* Add state to recordings, following new developments in BigBlueButton's API.
|
13
|
+
* Run the worker to fetch recordings after a meeting ends a little faster
|
14
|
+
than before. Now that we track the state of recordings they will appear
|
15
|
+
faster in a `getRecordings` call.
|
16
|
+
* Set the default title of new meetings to the name of the room.
|
17
|
+
* Add option to turn on debug on API calls.
|
18
|
+
|
19
|
+
|
3
20
|
## [2.3.0] - 2019-11-14
|
4
21
|
|
5
22
|
* [#136] Improve matching between recordings and meetings and migrate old recordings to
|
@@ -319,8 +336,9 @@ https://github.com/mconf/bigbluebutton_rails/wiki/Migrate-to-1.3.0
|
|
319
336
|
* Controller to access servers and rooms
|
320
337
|
* rooms_controller interacts with a BBB server using bigbluebutton-api-ruby
|
321
338
|
|
322
|
-
[
|
323
|
-
[2.3.0]: https://github.com/mconf/bigbluebutton_rails/compare/v2.
|
339
|
+
[3.0.0]: https://github.com/mconf/bigbluebutton_rails/compare/v2.3.0...v3.0.0
|
340
|
+
[2.3.0]: https://github.com/mconf/bigbluebutton_rails/compare/v2.2.0...v2.3.0
|
341
|
+
[2.2.0]: https://github.com/mconf/bigbluebutton_rails/compare/v2.1.0...v2.2.0
|
324
342
|
[2.1.0]: https://github.com/mconf/bigbluebutton_rails/compare/v2.0.0...v2.1.0
|
325
343
|
[2.0.0]: https://github.com/mconf/bigbluebutton_rails/compare/v1.4.0...v2.0.0
|
326
344
|
[1.4.0]: https://github.com/mconf/bigbluebutton_rails/compare/v1.3.0...v1.4.0
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bigbluebutton_rails (
|
4
|
+
bigbluebutton_rails (3.0.0)
|
5
5
|
activerecord-import (~> 1.0)
|
6
6
|
bigbluebutton-api-ruby (~> 1.6)
|
7
7
|
browser (~> 0.8.0)
|
@@ -12,29 +12,29 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: http://rubygems.org/
|
14
14
|
specs:
|
15
|
-
actionmailer (4.1.
|
16
|
-
actionpack (= 4.1.
|
17
|
-
actionview (= 4.1.
|
18
|
-
mail (~> 2.5.4)
|
19
|
-
actionpack (4.1.
|
20
|
-
actionview (= 4.1.
|
21
|
-
activesupport (= 4.1.
|
15
|
+
actionmailer (4.1.14.2)
|
16
|
+
actionpack (= 4.1.14.2)
|
17
|
+
actionview (= 4.1.14.2)
|
18
|
+
mail (~> 2.5, >= 2.5.4)
|
19
|
+
actionpack (4.1.14.2)
|
20
|
+
actionview (= 4.1.14.2)
|
21
|
+
activesupport (= 4.1.14.2)
|
22
22
|
rack (~> 1.5.2)
|
23
23
|
rack-test (~> 0.6.2)
|
24
|
-
actionview (4.1.
|
25
|
-
activesupport (= 4.1.
|
24
|
+
actionview (4.1.14.2)
|
25
|
+
activesupport (= 4.1.14.2)
|
26
26
|
builder (~> 3.1)
|
27
27
|
erubis (~> 2.7.0)
|
28
|
-
activemodel (4.1.
|
29
|
-
activesupport (= 4.1.
|
28
|
+
activemodel (4.1.14.2)
|
29
|
+
activesupport (= 4.1.14.2)
|
30
30
|
builder (~> 3.1)
|
31
|
-
activerecord (4.1.
|
32
|
-
activemodel (= 4.1.
|
33
|
-
activesupport (= 4.1.
|
31
|
+
activerecord (4.1.14.2)
|
32
|
+
activemodel (= 4.1.14.2)
|
33
|
+
activesupport (= 4.1.14.2)
|
34
34
|
arel (~> 5.0.0)
|
35
35
|
activerecord-import (1.0.2)
|
36
36
|
activerecord (>= 3.2)
|
37
|
-
activesupport (4.1.
|
37
|
+
activesupport (4.1.14.2)
|
38
38
|
i18n (~> 0.6, >= 0.6.9)
|
39
39
|
json (~> 1.7, >= 1.7.7)
|
40
40
|
minitest (~> 5.1)
|
@@ -151,15 +151,15 @@ GEM
|
|
151
151
|
rack
|
152
152
|
rack-test (0.6.2)
|
153
153
|
rack (>= 1.0)
|
154
|
-
rails (4.1.
|
155
|
-
actionmailer (= 4.1.
|
156
|
-
actionpack (= 4.1.
|
157
|
-
actionview (= 4.1.
|
158
|
-
activemodel (= 4.1.
|
159
|
-
activerecord (= 4.1.
|
160
|
-
activesupport (= 4.1.
|
154
|
+
rails (4.1.14.2)
|
155
|
+
actionmailer (= 4.1.14.2)
|
156
|
+
actionpack (= 4.1.14.2)
|
157
|
+
actionview (= 4.1.14.2)
|
158
|
+
activemodel (= 4.1.14.2)
|
159
|
+
activerecord (= 4.1.14.2)
|
160
|
+
activesupport (= 4.1.14.2)
|
161
161
|
bundler (>= 1.3.0, < 2.0)
|
162
|
-
railties (= 4.1.
|
162
|
+
railties (= 4.1.14.2)
|
163
163
|
sprockets-rails (~> 2.0)
|
164
164
|
rails_best_practices (1.15.4)
|
165
165
|
activesupport
|
@@ -171,9 +171,9 @@ GEM
|
|
171
171
|
json
|
172
172
|
require_all
|
173
173
|
ruby-progressbar
|
174
|
-
railties (4.1.
|
175
|
-
actionpack (= 4.1.
|
176
|
-
activesupport (= 4.1.
|
174
|
+
railties (4.1.14.2)
|
175
|
+
actionpack (= 4.1.14.2)
|
176
|
+
activesupport (= 4.1.14.2)
|
177
177
|
rake (>= 0.8.7)
|
178
178
|
thor (>= 0.18.1, < 2.0)
|
179
179
|
rake (10.3.2)
|
data/Rakefile
CHANGED
@@ -3,8 +3,8 @@ require 'bundler/setup'
|
|
3
3
|
require 'rdoc/task'
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
require 'rubygems/package_task'
|
6
|
-
|
7
|
-
|
6
|
+
require 'cucumber'
|
7
|
+
require 'cucumber/rake/task'
|
8
8
|
|
9
9
|
desc 'Default: run specs and features.'
|
10
10
|
task :default => [:spec]
|
@@ -24,7 +24,6 @@ end
|
|
24
24
|
eval("$specification = begin; #{ IO.read('bigbluebutton_rails.gemspec')}; end")
|
25
25
|
Gem::PackageTask.new $specification do |pkg|
|
26
26
|
pkg.need_tar = true
|
27
|
-
# pkg.need_zip = true
|
28
27
|
end
|
29
28
|
|
30
29
|
namespace :rails_app do
|
@@ -60,19 +59,19 @@ namespace :rails_app do
|
|
60
59
|
end
|
61
60
|
end
|
62
61
|
|
63
|
-
|
64
|
-
#
|
65
|
-
|
62
|
+
task :cucumber do
|
63
|
+
# Disable all features that need the bot. It isn't working since BigBlueButton 0.81.
|
64
|
+
tags = "~@need-bot"
|
66
65
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
puts "* Dummy app features"
|
67
|
+
cd File.join(File.dirname(__FILE__), "spec", "rails_app")
|
68
|
+
sh "bundle exec cucumber features/ --tags #{tags}"
|
69
|
+
cd File.dirname(__FILE__)
|
70
|
+
end
|
72
71
|
|
73
|
-
|
74
|
-
|
75
|
-
|
72
|
+
task :notes do
|
73
|
+
puts `grep -r 'OPTIMIZE\\|FIXME\\|TODO' app/ public/ spec/`
|
74
|
+
end
|
76
75
|
|
77
76
|
desc 'Setup the rails_app using the migration files created when upgrading the gem
|
78
77
|
version, run all tests and destroys the generated files.'
|
@@ -87,6 +86,7 @@ namespace :spec do
|
|
87
86
|
sh "bundle exec rails generate bigbluebutton_rails:install 2.0.0 --migration-only --force"
|
88
87
|
sh "bundle exec rails generate bigbluebutton_rails:install 2.1.0 --migration-only --force"
|
89
88
|
sh "bundle exec rails generate bigbluebutton_rails:install 2.2.0 --migration-only --force"
|
89
|
+
sh "bundle exec rails generate bigbluebutton_rails:install 2.3.0 --migration-only --force"
|
90
90
|
|
91
91
|
sh "bundle exec rake db:drop RAILS_ENV=test"
|
92
92
|
sh "bundle exec rake db:create RAILS_ENV=test"
|
@@ -98,6 +98,7 @@ namespace :spec do
|
|
98
98
|
# Rake::Task["cucumber"].invoke
|
99
99
|
|
100
100
|
cd "spec/rails_app/"
|
101
|
+
sh "bundle exec rails destroy bigbluebutton_rails:install 2.3.0 --migration-only"
|
101
102
|
sh "bundle exec rails destroy bigbluebutton_rails:install 2.2.0 --migration-only"
|
102
103
|
sh "bundle exec rails destroy bigbluebutton_rails:install 2.1.0 --migration-only"
|
103
104
|
sh "bundle exec rails destroy bigbluebutton_rails:install 2.0.0 --migration-only"
|
@@ -49,7 +49,7 @@ class Bigbluebutton::Api::RoomsController < ApplicationController
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def join
|
52
|
-
error_room_not_running unless check_is_running
|
52
|
+
return error_room_not_running unless check_is_running
|
53
53
|
|
54
54
|
# map "meta[_-]" to "userdata-"
|
55
55
|
options = params.select{ |k,v| k.match(/^meta[-_]/) }
|
@@ -63,7 +63,7 @@ class Bigbluebutton::Api::RoomsController < ApplicationController
|
|
63
63
|
protected
|
64
64
|
|
65
65
|
def find_room
|
66
|
-
@room ||= BigbluebuttonRoom.find_by(
|
66
|
+
@room ||= BigbluebuttonRoom.find_by(slug: params[:id])
|
67
67
|
error_room_not_found if @room.nil?
|
68
68
|
end
|
69
69
|
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'bigbluebutton_api'
|
3
|
+
|
4
|
+
class Bigbluebutton::MeetingsController < ApplicationController
|
5
|
+
include BigbluebuttonRails::InternalControllerMethods
|
6
|
+
|
7
|
+
before_filter :find_meeting
|
8
|
+
|
9
|
+
respond_to :html
|
10
|
+
|
11
|
+
layout :determine_layout
|
12
|
+
|
13
|
+
def determine_layout
|
14
|
+
'application'
|
15
|
+
end
|
16
|
+
|
17
|
+
def destroy
|
18
|
+
if @meeting.ended?
|
19
|
+
if @meeting.destroy
|
20
|
+
respond_with do |format|
|
21
|
+
format.html {
|
22
|
+
flash[:success] = t('bigbluebutton_rails.meetings.delete.success')
|
23
|
+
redirect_to_using_params_or_back(request.referer)
|
24
|
+
}
|
25
|
+
end
|
26
|
+
else
|
27
|
+
flash[:error] = t('bigbluebutton_rails.meetings.notice.destroy.error_destroy')
|
28
|
+
redirect_to_using_params_or_back(request.referer)
|
29
|
+
end
|
30
|
+
else
|
31
|
+
flash[:error] = t('bigbluebutton_rails.meetings.notice.destroy.running.not_ended')
|
32
|
+
redirect_to_using_params_or_back(request.referer)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def find_meeting
|
37
|
+
@meeting ||= BigbluebuttonMeeting.find_by(id: params[:id])
|
38
|
+
end
|
39
|
+
|
40
|
+
def edit
|
41
|
+
respond_with(@meeting)
|
42
|
+
end
|
43
|
+
|
44
|
+
def meeting_params
|
45
|
+
unless params[:bigbluebutton_meeting].nil?
|
46
|
+
params[:bigbluebutton_meeting].permit(*meeting_allowed_params)
|
47
|
+
else
|
48
|
+
{}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def update
|
53
|
+
respond_with @meeting do |format|
|
54
|
+
if @meeting.update_attributes(meeting_params)
|
55
|
+
format.html {
|
56
|
+
message = t('bigbluebutton_rails.meetings.notice.update.success')
|
57
|
+
redirect_to_using_params @meeting, :notice => message
|
58
|
+
}
|
59
|
+
else
|
60
|
+
format.html { redirect_to_params_or_render :edit }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def meeting_allowed_params
|
66
|
+
[ :title ]
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
@@ -46,19 +46,13 @@ class Bigbluebutton::RecordingsController < ApplicationController
|
|
46
46
|
def destroy
|
47
47
|
error = false
|
48
48
|
begin
|
49
|
-
|
50
|
-
server = @recording.server
|
51
|
-
server.send_delete_recordings(@recording.recordid)
|
52
|
-
end
|
49
|
+
@recording.destroy
|
53
50
|
message = t('bigbluebutton_rails.recordings.notice.destroy.success')
|
54
51
|
rescue BigBlueButton::BigBlueButtonException => e
|
55
52
|
error = true
|
56
53
|
message = t('bigbluebutton_rails.recordings.notice.destroy.success_with_bbb_error', :error => e.to_s[0..200])
|
57
54
|
end
|
58
55
|
|
59
|
-
# TODO: what if it fails?
|
60
|
-
@recording.destroy
|
61
|
-
|
62
56
|
respond_with do |format|
|
63
57
|
format.html {
|
64
58
|
if error
|
@@ -156,7 +150,7 @@ class Bigbluebutton::RecordingsController < ApplicationController
|
|
156
150
|
end
|
157
151
|
|
158
152
|
def recording_allowed_params
|
159
|
-
[
|
153
|
+
[]
|
160
154
|
end
|
161
155
|
|
162
156
|
protected
|
@@ -124,7 +124,8 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
124
124
|
flash[:error] = e.to_s[0..200]
|
125
125
|
render :json => { :running => "false", :error => "#{e.to_s[0..200]}" }
|
126
126
|
else
|
127
|
-
|
127
|
+
info = @room.fetch_meeting_info
|
128
|
+
render :json => { :running => "#{@room.is_running?}", :participants_qty => info}
|
128
129
|
end
|
129
130
|
end
|
130
131
|
|
@@ -224,7 +225,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
224
225
|
protected
|
225
226
|
|
226
227
|
def find_room
|
227
|
-
@room ||= BigbluebuttonRoom.find_by(
|
228
|
+
@room ||= BigbluebuttonRoom.find_by(slug: params[:id])
|
228
229
|
end
|
229
230
|
|
230
231
|
def set_request_headers
|
@@ -234,7 +235,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
234
235
|
end
|
235
236
|
|
236
237
|
def join_check_room
|
237
|
-
@room ||= BigbluebuttonRoom.
|
238
|
+
@room ||= BigbluebuttonRoom.find_by(slug: params[:id]) unless params[:id].blank?
|
238
239
|
if @room.nil?
|
239
240
|
message = t('bigbluebutton_rails.rooms.errors.join.wrong_params')
|
240
241
|
redirect_to :back, :notice => message
|
@@ -363,7 +364,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
363
364
|
def room_allowed_params
|
364
365
|
[ :name, :meetingid, :attendee_key, :moderator_key, :welcome_msg,
|
365
366
|
:private, :logout_url, :dial_number, :voice_bridge, :max_participants, :owner_id,
|
366
|
-
:owner_type, :external, :
|
367
|
+
:owner_type, :external, :slug, :record_meeting, :duration, :default_layout, :presenter_share_only,
|
367
368
|
:auto_start_video, :auto_start_audio, :background,
|
368
369
|
:moderator_only_message, :auto_start_recording, :allow_start_stop_recording,
|
369
370
|
:metadata_attributes => [ :id, :name, :content, :_destroy, :owner_id ] ]
|
@@ -147,7 +147,7 @@ class Bigbluebutton::ServersController < ApplicationController
|
|
147
147
|
protected
|
148
148
|
|
149
149
|
def find_server
|
150
|
-
@server ||= BigbluebuttonServer.
|
150
|
+
@server ||= BigbluebuttonServer.find_by(slug: params[:id])
|
151
151
|
end
|
152
152
|
|
153
153
|
def publish_unpublish(ids, publish)
|
@@ -182,7 +182,7 @@ class Bigbluebutton::ServersController < ApplicationController
|
|
182
182
|
end
|
183
183
|
|
184
184
|
def server_allowed_params
|
185
|
-
[ :name, :url, :secret, :
|
185
|
+
[ :name, :url, :secret, :slug ]
|
186
186
|
end
|
187
187
|
|
188
188
|
end
|
@@ -7,7 +7,7 @@ class BigbluebuttonMeeting < ActiveRecord::Base
|
|
7
7
|
has_one :recording,
|
8
8
|
:class_name => 'BigbluebuttonRecording',
|
9
9
|
:foreign_key => 'meeting_id',
|
10
|
-
:dependent => :
|
10
|
+
:dependent => :destroy
|
11
11
|
|
12
12
|
has_many :attendees,
|
13
13
|
:class_name => 'BigbluebuttonAttendee',
|
@@ -7,6 +7,8 @@ class BigbluebuttonRecording < ActiveRecord::Base
|
|
7
7
|
belongs_to :room, class_name: 'BigbluebuttonRoom'
|
8
8
|
belongs_to :meeting, class_name: 'BigbluebuttonMeeting'
|
9
9
|
|
10
|
+
before_destroy :delete_from_server!
|
11
|
+
|
10
12
|
validates :server, :presence => true
|
11
13
|
|
12
14
|
validates :recordid,
|
@@ -27,10 +29,21 @@ class BigbluebuttonRecording < ActiveRecord::Base
|
|
27
29
|
|
28
30
|
serialize :recording_users, Array
|
29
31
|
|
32
|
+
STATES = {
|
33
|
+
processing: 'processing',
|
34
|
+
processed: 'processed',
|
35
|
+
published: 'published',
|
36
|
+
unpublished: 'unpublished'
|
37
|
+
}
|
38
|
+
|
30
39
|
def to_param
|
31
40
|
self.recordid
|
32
41
|
end
|
33
42
|
|
43
|
+
def is_published?
|
44
|
+
self.state.eql?(BigbluebuttonRecording::STATES[:published]) || self.state.eql?(BigbluebuttonRecording::STATES[:unpublished])
|
45
|
+
end
|
46
|
+
|
34
47
|
def get_token(user, ip)
|
35
48
|
server = BigbluebuttonServer.default
|
36
49
|
user.present? ? authName = user.username : authName = "anonymous"
|
@@ -218,7 +231,7 @@ class BigbluebuttonRecording < ActiveRecord::Base
|
|
218
231
|
def self.update_recording(server, recording, data)
|
219
232
|
recording.server = server
|
220
233
|
recording.room = BigbluebuttonRails.configuration.match_room_recording.call(data)
|
221
|
-
recording.attributes = data.slice(:meetingid, :name, :published, :start_time, :end_time, :size)
|
234
|
+
recording.attributes = data.slice(:meetingid, :name, :published, :start_time, :end_time, :size, :state)
|
222
235
|
recording.available = true
|
223
236
|
recording.recording_users = adapt_recording_users(data[:recordingUsers])
|
224
237
|
recording.save!
|
@@ -230,12 +243,11 @@ class BigbluebuttonRecording < ActiveRecord::Base
|
|
230
243
|
# The format expected for 'data' follows the format returned by
|
231
244
|
# BigBlueButtonApi#get_recordings but with the keys already converted to our format.
|
232
245
|
def self.create_recording(server, data)
|
233
|
-
filtered = data.slice(:recordid, :meetingid, :name, :published, :start_time, :end_time, :size)
|
246
|
+
filtered = data.slice(:recordid, :meetingid, :name, :published, :start_time, :end_time, :size, :state)
|
234
247
|
recording = BigbluebuttonRecording.create(filtered)
|
235
248
|
recording.available = true
|
236
249
|
recording.room = BigbluebuttonRails.configuration.match_room_recording.call(data)
|
237
250
|
recording.server = server
|
238
|
-
recording.description = I18n.t('bigbluebutton_rails.recordings.default.description', :time => Time.at(recording.start_time).utc.to_formatted_s(:long))
|
239
251
|
recording.meeting = BigbluebuttonRecording.find_matching_meeting(recording)
|
240
252
|
recording.recording_users = adapt_recording_users(data[:recordingUsers])
|
241
253
|
recording.save!
|
@@ -47,12 +47,12 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
47
47
|
:presence => true,
|
48
48
|
:numericality => { :only_integer => true, :greater_than_or_equal_to => 0 }
|
49
49
|
|
50
|
-
validates :
|
50
|
+
validates :slug,
|
51
51
|
:presence => true,
|
52
52
|
:uniqueness => true,
|
53
53
|
:length => { :minimum => 1 },
|
54
54
|
:format => { :with => /\A([a-zA-Z\d_]|[a-zA-Z\d_]+[a-zA-Z\d_-]*[a-zA-Z\d_]+)\z/,
|
55
|
-
:message => I18n.t('bigbluebutton_rails.rooms.errors.
|
55
|
+
:message => I18n.t('bigbluebutton_rails.rooms.errors.slug_format') }
|
56
56
|
|
57
57
|
# Passwords are 16 character strings
|
58
58
|
# See http://groups.google.com/group/bigbluebutton-dev/browse_thread/thread/9be5aae1648bcab?pli=1
|
@@ -68,7 +68,7 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
68
68
|
|
69
69
|
after_initialize :init
|
70
70
|
after_create :create_room_options
|
71
|
-
before_validation :
|
71
|
+
before_validation :set_slug
|
72
72
|
before_validation :set_keys
|
73
73
|
|
74
74
|
# the full logout_url used when logout_url is a relative path
|
@@ -94,12 +94,12 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
94
94
|
query_orders = []
|
95
95
|
|
96
96
|
words.reject(&:blank?).each do |word|
|
97
|
-
str = "name LIKE ? OR
|
97
|
+
str = "name LIKE ? OR slug LIKE ?"
|
98
98
|
query_strs << str
|
99
99
|
query_params += ["%#{word}%", "%#{word}%"]
|
100
100
|
query_orders += [
|
101
101
|
"CASE WHEN name LIKE '%#{word}%' THEN 1 ELSE 0 END + \
|
102
|
-
CASE WHEN
|
102
|
+
CASE WHEN slug LIKE '%#{word}%' THEN 1 ELSE 0 END"
|
103
103
|
]
|
104
104
|
end
|
105
105
|
where(query_strs.join(' OR '), *query_params.flatten).order(query_orders.join(' + ') + " DESC")
|
@@ -278,7 +278,7 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
278
278
|
opts.merge!({ userID: id }) unless id.blank? || options[:userID].present?
|
279
279
|
|
280
280
|
# Get options passed by the application, if any
|
281
|
-
user_opts = BigbluebuttonRails.configuration.get_join_options.call(self, user)
|
281
|
+
user_opts = BigbluebuttonRails.configuration.get_join_options.call(self, user, { username: username, role: role })
|
282
282
|
user_opts = {} if user_opts.blank?
|
283
283
|
opts.merge!(user_opts)
|
284
284
|
|
@@ -324,7 +324,7 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
324
324
|
end
|
325
325
|
|
326
326
|
def to_param
|
327
|
-
self.
|
327
|
+
self.slug
|
328
328
|
end
|
329
329
|
|
330
330
|
# The create logic.
|
@@ -416,6 +416,7 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
416
416
|
server_secret: server.secret,
|
417
417
|
meetingid: self.meetingid,
|
418
418
|
name: self.name,
|
419
|
+
title: self.name,
|
419
420
|
recorded: self.record_meeting,
|
420
421
|
create_time: self.create_time,
|
421
422
|
running: self.running,
|
@@ -476,7 +477,7 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
476
477
|
# have to keep polling the server for them
|
477
478
|
# 3 times so it tries at: 4, 9, 14 and 19
|
478
479
|
# no point trying more since there is a global synchronization process
|
479
|
-
Resque.enqueue_in(
|
480
|
+
Resque.enqueue_in(1.minutes, ::BigbluebuttonRecordingsForRoomWorker, self.id, 10)
|
480
481
|
end
|
481
482
|
end
|
482
483
|
|
@@ -540,14 +541,23 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
540
541
|
# Will always generate a unique number. Tries several times if the number already
|
541
542
|
# exists and returns `nil` in case it wasn't possible to generate a unique value.
|
542
543
|
def generate_dial_number!(pattern=nil)
|
543
|
-
pattern
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
544
|
+
unless pattern.nil?
|
545
|
+
dn = self.class.generate_dial_number(pattern)
|
546
|
+
return self.update_attributes(dial_number: dn)
|
547
|
+
else
|
548
|
+
nil
|
549
|
+
end
|
550
|
+
end
|
551
|
+
|
552
|
+
def self.generate_dial_number(pattern=nil)
|
553
|
+
unless pattern.nil?
|
554
|
+
unless BigbluebuttonRoom.maximum(:dial_number).nil?
|
555
|
+
return BigbluebuttonRoom.maximum(:dial_number).next
|
556
|
+
else
|
557
|
+
return pattern.gsub('x', '0')
|
548
558
|
end
|
559
|
+
nil
|
549
560
|
end
|
550
|
-
nil
|
551
561
|
end
|
552
562
|
|
553
563
|
def fetch_recordings(filter={})
|
@@ -654,10 +664,10 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
654
664
|
end
|
655
665
|
end
|
656
666
|
|
657
|
-
# if :
|
658
|
-
def
|
659
|
-
if self.
|
660
|
-
self.
|
667
|
+
# if :slug wasn't set, sets it as :name downcase and parameterized
|
668
|
+
def set_slug
|
669
|
+
if self.slug.blank?
|
670
|
+
self.slug = self.name.parameterize.downcase unless self.name.nil?
|
661
671
|
end
|
662
672
|
end
|
663
673
|
|