canvas_webex 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,14 +18,24 @@
18
18
 
19
19
  class CiscoWebexConference < WebConference
20
20
 
21
+ user_setting_field :external_emails, {
22
+ name: ->{ t('external_emails_setting', 'External Emails') },
23
+ description: ->{ t('external_emails_setting_description', 'External emails') },
24
+ type: :text,
25
+ visible: true,
26
+ default: "",
27
+ location: 'members'
28
+ }
29
+
21
30
  # Public: Start a new conference and return its key. (required by WebConference)
22
31
  #
23
32
  # Returns a meeting.
24
33
  def initiate_conference
25
34
  unless self.conference_key.present?
26
- webex_meeting = CanvasWebex::Meeting.create(self.title)
27
35
  options = {}
28
36
  options[:duration] = self.duration || 999999
37
+ options[:emails] = settings[:external_emails].nil? ? [] : settings[:external_emails].strip.split(':')
38
+ webex_meeting = CanvasWebex::Meeting.create(self.title, options)
29
39
  self.conference_key = webex_meeting.meeting_key
30
40
  save
31
41
  end
@@ -39,7 +49,11 @@ class CiscoWebexConference < WebConference
39
49
  if meeting || self.started_at.nil?
40
50
  :active
41
51
  else
42
- self.close unless self.ended_at
52
+ unless self.ended_at
53
+ self.close
54
+ self.end_at = self.ended_at
55
+ self.save
56
+ end
43
57
  :closed
44
58
  end
45
59
  end
@@ -26,8 +26,8 @@ module CanvasWebex
26
26
  end
27
27
  end
28
28
 
29
- def self.create(meeting_name, client = CanvasWebex.client)
30
- if response = client.create_meeting(meeting_name)
29
+ def self.create(meeting_name, options = {}, client = CanvasWebex.client)
30
+ if response = client.create_meeting(meeting_name, options)
31
31
  if meeting_key = response.at_xpath('//meetingkey').try(:text)
32
32
  retrieve(meeting_key, client)
33
33
  end
@@ -34,6 +34,20 @@ module CanvasWebex
34
34
  xml.startDate
35
35
  xml.duration(options[:duration].to_i)
36
36
  }
37
+ if options[:emails]
38
+ xml.participants{
39
+ xml.attendees{
40
+ options[:emails].each do |email|
41
+ xml.attendee {
42
+ xml.emailInvitations true
43
+ xml.person {
44
+ xml.email email
45
+ }
46
+ }
47
+ end
48
+ }
49
+ }
50
+ end
37
51
  }
38
52
  end
39
53
  request(body)
@@ -17,6 +17,6 @@
17
17
  #
18
18
 
19
19
  module CanvasWebex
20
- VERSION = "0.2"
20
+ VERSION = "0.3"
21
21
  end
22
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_webex
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-30 00:00:00.000000000 Z
12
+ date: 2013-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake