Merge branch 'testing-version-002' of github.com:antobinary/bigbluebutton into testing-version-001
This commit is contained in:
commit
26eaa625fc
@ -110,16 +110,20 @@ class BigBlueButtonActor(outGW: MessageOutGateway) extends Actor {
|
||||
|
||||
for(i <- 0 until arr.length) {
|
||||
val id = arr(i)
|
||||
val duration = meetings.get(arr(i)).head.getDuration()
|
||||
val name = meetings.get(arr(i)).head.getMeetingName()
|
||||
val recorded = meetings.get(arr(i)).head.getRecordedStatus()
|
||||
val voiceBridge = meetings.get(arr(i)).head.getVoiceBridgeNumber()
|
||||
|
||||
var info = new MeetingInfo(id, name, recorded)
|
||||
var info = new MeetingInfo(id, name, recorded, voiceBridge, duration)
|
||||
resultArray(i) = info
|
||||
|
||||
//remove later
|
||||
println("for a meeting:" + id)
|
||||
println("Meeting Name = " + meetings.get(id).head.getMeetingName())
|
||||
println("isRecorded = " + meetings.get(id).head.getRecordedStatus())
|
||||
println("voiceBridge = " + voiceBridge)
|
||||
println("duration = " + duration)
|
||||
|
||||
//send the users
|
||||
this ! (new GetUsers(id, "nodeJSapp"))
|
||||
|
@ -29,6 +29,10 @@ class MeetingActor(val meetingID: String, val meetingName: String, val recorded:
|
||||
var muted = false;
|
||||
var meetingEnded = false
|
||||
|
||||
def getDuration():Long = {
|
||||
duration
|
||||
}
|
||||
|
||||
def getMeetingName():String = {
|
||||
meetingName
|
||||
}
|
||||
@ -36,6 +40,10 @@ class MeetingActor(val meetingID: String, val meetingName: String, val recorded:
|
||||
def getRecordedStatus():Boolean = {
|
||||
recorded
|
||||
}
|
||||
|
||||
def getVoiceBridgeNumber():String = {
|
||||
voiceBridge
|
||||
}
|
||||
|
||||
val TIMER_INTERVAL = 30000
|
||||
var hasLastWebUserLeft = false
|
||||
|
@ -104,4 +104,4 @@ case class MeetingPasswords(moderatorPass: String, viewerPass: String)
|
||||
case class MeetingDuration(duration: Int = 0, createdTime: Long = 0,
|
||||
startTime: Long = 0, endTime: Long = 0)
|
||||
|
||||
case class MeetingInfo(meetingID: String, meetingName: String, recorded: Boolean)
|
||||
case class MeetingInfo(meetingID: String, meetingName: String, recorded: Boolean, voiceBridge: String, duration: Long)
|
||||
|
@ -20,6 +20,9 @@
|
||||
meet?.meetingName
|
||||
else null
|
||||
|
||||
@getTimeOfJoining = ->
|
||||
Meteor.Users.findOne({"user.userid": getInSession("userId")})?.user?.time_of_joining
|
||||
|
||||
# Finds the names of all people the current user is in a private conversation with
|
||||
# Removes yourself and duplicates if they exist
|
||||
@getPrivateChatees = ->
|
||||
@ -116,6 +119,12 @@ Handlebars.registerHelper "isUserSharingAudio", (u) ->
|
||||
user?.user?.voiceUser?.joined
|
||||
else return false
|
||||
|
||||
Handlebars.registerHelper "isUserListenOnly", (u) ->
|
||||
if u?
|
||||
user = Meteor.Users.findOne({userId:u.userid})
|
||||
user?.user?.listenOnly
|
||||
else return false
|
||||
|
||||
Handlebars.registerHelper "isUserSharingVideo", (u) ->
|
||||
u.webcam_stream?.length isnt 0
|
||||
|
||||
|
@ -50,14 +50,14 @@ Template.chatbar.helpers
|
||||
after = before = greeting = []
|
||||
|
||||
if chattingWith is 'PUBLIC_CHAT' # find all public messages
|
||||
before = Meteor.Chat.find({'message.chat_type': chattingWith, 'message.from_time': {$lt: String(Meteor.Users.findOne({"user.userid": getInSession("userId")})?.user?.time_of_joining)}}).fetch()
|
||||
after = Meteor.Chat.find({'message.chat_type': chattingWith, 'message.from_time': {$gt: String(Meteor.Users.findOne({"user.userid": getInSession("userId")})?.user?.time_of_joining)}}).fetch()
|
||||
before = Meteor.Chat.find({'message.chat_type': chattingWith, 'message.from_time': {$lt: String(getTimeOfJoining())}}).fetch()
|
||||
after = Meteor.Chat.find({'message.chat_type': chattingWith, 'message.from_time': {$gt: String(getTimeOfJoining())}}).fetch()
|
||||
|
||||
greeting = [
|
||||
'message':
|
||||
'message': Template.chatbar.getChatGreeting(),
|
||||
'from_username': 'System',
|
||||
'from_time': Meteor.Users.findOne({"user.userid": getInSession("userId")})?.user?.time_of_joining
|
||||
'from_time': getTimeOfJoining()
|
||||
'from_color': '0x3399FF' # A nice blue in hex
|
||||
]
|
||||
else
|
||||
|
@ -4,9 +4,10 @@
|
||||
{{/if}}</td>
|
||||
|
||||
<!-- Should use much more noticeable icons than just bootstrap's volume-up & volume-down to differentiate talking but it is good for now -->
|
||||
<td>{{#if isUserSharingAudio user}}
|
||||
<td>
|
||||
{{#if isUserSharingAudio user}}
|
||||
{{#if isUserMuted user}}
|
||||
<span class="userListSettingIcon glyphicon glyphicon-volume-off"></span>
|
||||
<span class="userListSettingIcon glyphicon glyphicon-volume-off" title="Muted"></span>
|
||||
{{else}}
|
||||
{{#if isUserTalking user}}
|
||||
<span class="userListSettingIcon glyphicon glyphicon-volume-up"></span>
|
||||
@ -14,7 +15,12 @@
|
||||
<span class="userListSettingIcon glyphicon glyphicon-volume-down"></span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}</td>
|
||||
{{/if}}
|
||||
<!-- listen only: -->
|
||||
{{#if isUserListenOnly user}}
|
||||
<span class="userListSettingIcon glyphicon glyphicon-headphones" title="Listening only"></span>
|
||||
{{/if}}
|
||||
</td>
|
||||
|
||||
<td>{{#if user.presenter}}<span class="userListSettingIcon glyphicon glyphicon-picture"></span>{{/if}}</td>
|
||||
|
||||
|
@ -168,39 +168,26 @@ class Meteor.RedisPubSub
|
||||
]
|
||||
|
||||
unless message.header?.name in ignoredEventTypes
|
||||
#console.log "\nchannel=" + channel
|
||||
#console.log "correlationId=" + correlationId if correlationId?
|
||||
console.log "eventType=" + message.header?.name #+ "\n"
|
||||
#log.debug({ pattern: pattern, channel: channel, message: message}, "Received a message from redis")
|
||||
console.log jsonMsg
|
||||
|
||||
if message.header?.name is 'user_voice_talking_message'
|
||||
u = Meteor.Users.findOne({'userId': message.payload?.user?.userid, 'meetingId': meetingId})
|
||||
if u?
|
||||
if not u?.user?.voiceUser?.muted
|
||||
console.log "setting talking to #{message?.payload?.user?.voiceUser?.talking}"
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':message?.payload?.user?.voiceUser?.talking}})
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.joined':true}})
|
||||
else
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':false}})
|
||||
# handle voice events
|
||||
if message.header?.name in ['user_left_voice_message', 'user_joined_voice_message', 'user_voice_talking_message', 'user_voice_muted_message']
|
||||
voiceUser = message.payload?.user?.voiceUser
|
||||
@updateVoiceUser(meetingId, voiceUser)
|
||||
|
||||
if message.header?.name is 'user_voice_muted_message'
|
||||
u = Meteor.Users.findOne({'userId': message.payload?.user?.userid, 'meetingId': meetingId})
|
||||
console.log "\n\n\n got a muted event and the user is #{u}"
|
||||
|
||||
if u?
|
||||
# make sure the user is not currently in talking mode
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking': false}})
|
||||
# update to muted
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.muted':message?.payload?.user?.voiceUser?.muted}})
|
||||
else console.log "ERROR!! did not find a matching user to mute!!"
|
||||
# listen only
|
||||
if message.header?.name is 'user_listening_only'
|
||||
u = Meteor.Users.findOne({userId: message.payload?.userid, meetingId: meetingId})
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.listenOnly':message.payload?.listen_only}})
|
||||
# most likely we don't need to ensure that the user's voiceUser's {talking, joined, muted, locked} are false by default #TODO?
|
||||
|
||||
if message.header?.name is "get_all_meetings_reply"
|
||||
console.log "Let's store some data for the running meetings so that when an HTML5 client joins everything is ready!"
|
||||
listOfMeetings = message.payload?.meetings
|
||||
for meeting in listOfMeetings
|
||||
# we currently do not have voice_conf or duration in this message.
|
||||
Meteor.call("addMeetingToCollection", meeting.meetingID, meeting.meetingName, meeting.recorded, "", "")
|
||||
Meteor.call("addMeetingToCollection", meeting.meetingID, meeting.meetingName, meeting.recorded, meeting.voiceBridge, meeting.duration)
|
||||
|
||||
if message.header?.name is "get_users_reply" and message.payload?.requester_id is "nodeJSapp"
|
||||
unless Meteor.Meetings.findOne({MeetingId: message.payload?.meeting_id})?
|
||||
@ -226,9 +213,6 @@ class Meteor.RedisPubSub
|
||||
|
||||
if message.header?.name is "send_public_chat_message" or message.header?.name is "send_private_chat_message"
|
||||
messageObject = message.payload?.message
|
||||
|
||||
#use current_time instead of from_time for sorting the chat messages. We had issues with from_time
|
||||
messageObject.from_time = message.header?.current_time
|
||||
Meteor.call("addChatToCollection", meetingId, messageObject)
|
||||
|
||||
if message.header?.name is "meeting_created_message"
|
||||
@ -354,6 +338,18 @@ class Meteor.RedisPubSub
|
||||
unless message.header?.name is "disconnect_all_users_message"
|
||||
Meteor.call("removeMeetingFromCollection", meetingId)
|
||||
|
||||
#update a voiceUser
|
||||
updateVoiceUser: (meetingId, voiceUserObject) ->
|
||||
console.log "I am updating the voiceUserObject with the following: " + JSON.stringify voiceUserObject
|
||||
u = Meteor.Users.findOne({userId: voiceUserObject?.web_userid, meetingId: meetingId})
|
||||
if u?
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':voiceUserObject?.talking}})# talking
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.joined':voiceUserObject?.joined}})# joined
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.locked':voiceUserObject?.locked}})# locked
|
||||
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.muted':voiceUserObject?.muted}})# muted
|
||||
else
|
||||
console.log "ERROR! did not find such voiceUser!"
|
||||
|
||||
# message should be an object
|
||||
publish: (channel, message) ->
|
||||
console.log "Publishing channel=#{channel}, message=#{JSON.stringify(message)}"
|
||||
@ -390,3 +386,4 @@ class Meteor.RedisPubSub
|
||||
"payload": {} # I need this, otherwise bbb-apps won't recognize the message
|
||||
|
||||
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.meeting, JSON.stringify (message))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user