diff --git a/labs/meteor-client/client/globals.coffee b/labs/meteor-client/client/globals.coffee index e0ac979ca4..326cc9814d 100755 --- a/labs/meteor-client/client/globals.coffee +++ b/labs/meteor-client/client/globals.coffee @@ -80,20 +80,6 @@ Meteor.methods Handlebars.registerHelper "getMeetingName", -> window.getMeetingName() -Handlebars.registerHelper "isCurrentUserTalking", -> - u = Meteor.Users.findOne({'userId': getInSession("userId")}) - if u? - console.log u - u.user?.voiceUser?.talking - false - -Handlebars.registerHelper "isCurrentUserSharingAudio", -> - getInSession "isSharingAudio" - -Handlebars.registerHelper "isUserSharingAudio", (u) -> - if u? - u.user?.voiceUser?.talking? - Handlebars.registerHelper "isUserSharingVideo", (u) -> u.webcam_stream.length isnt 0 @@ -106,3 +92,14 @@ Handlebars.registerHelper "getUsersInMeeting", -> @getTime = -> # returns epoch in ms (new Date).valueOf() + +Handlebars.registerHelper "isUserTalking", (u) -> + console.log "inside isUserTalking" + console.log u + if u? + u.voiceUser?.talking + else + return false + +Handlebars.registerHelper "isUserSharingAudio", -> + getInSession "isSharingAudio" diff --git a/labs/meteor-client/client/main.html b/labs/meteor-client/client/main.html index 5a792bc94f..44313750f6 100755 --- a/labs/meteor-client/client/main.html +++ b/labs/meteor-client/client/main.html @@ -41,6 +41,12 @@ {{> makeButton id=user.externUserId btn_class="audioFeedIcon navbar-brand" i_class="volume-off" sharingAudio=false _id=_id}} {{/if}} + {{#if isUserTalking user}} + TALKING + {{else}} + NO TALKING + {{/if}} + {{> makeButton id="" btn_class="hideNavbarIcon pull-right navbar-brand" i_class="chevron-up"}} {{> makeButton id="user.externUserId" btn_class="signOutIcon pull-right navbar-brand" i_class="log-out"}} {{> makeButton id="user.externUserId" btn_class="settingsIcon pull-right navbar-brand" i_class="cog"}} diff --git a/labs/meteor-client/client/views/users/user_item.html b/labs/meteor-client/client/views/users/user_item.html index f3a37aaf79..777de6a858 100755 --- a/labs/meteor-client/client/views/users/user_item.html +++ b/labs/meteor-client/client/views/users/user_item.html @@ -28,8 +28,8 @@ {{#if user.handRaised}} {{> makeButton id=user.externUserId btn_class="raiseHand btn-primary" i_class="hand-up" _id=_id isDisabled="disabled"}} - {{else}} - {{> makeButton id=user.externUserId btn_class="raiseHand btn-primary" i_class="hand-up" _id=_id}} + {{/if}} diff --git a/labs/meteor-client/server/redispubsub.coffee b/labs/meteor-client/server/redispubsub.coffee index d63ea39f40..fdc23982c2 100755 --- a/labs/meteor-client/server/redispubsub.coffee +++ b/labs/meteor-client/server/redispubsub.coffee @@ -98,15 +98,9 @@ class Meteor.RedisPubSub if message.header?.name is 'user_voice_talking_message' u = Meteor.Users.findOne({'userId': message.payload?.user?.userid}) if u? - console.log "setting talking to true\n\n\n\n" - Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':true}}) - else - u = Meteor.Users.findOne({'userId': message.payload?.user?.userid}) - if u? - console.log 'setting talking to false\n\n\n\n--------------------------------------------------------------------' - console.log jsonMsg - console.log '--------------------------------------------------------------------' - Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':false}}) + console.log "setting talking to #{message?.payload?.user?.voiceUser?.talking}\n\n\n\n" + Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':message?.payload?.user?.voiceUser?.talking}}) + 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!"