Skip to content

Commit

Permalink
use a different event
Browse files Browse the repository at this point in the history
  • Loading branch information
markoscalderon committed Jul 5, 2013
1 parent 2987659 commit d26265b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import org.bigbluebutton.core.api.Presenter
import scala.collection.mutable.HashMap
import org.bigbluebutton.core.api.UserJoining
import org.bigbluebutton.core.api.UserLeaving
import org.bigbluebutton.core.api.UserLeft
import org.bigbluebutton.core.api.AssignPresenter
import org.bigbluebutton.core.api.PresenterAssigned
import org.bigbluebutton.core.User
import org.bigbluebutton.core.api.MessageOutGateway
import org.bigbluebutton.core.api.GetUsers
import org.bigbluebutton.core.apps.users.messages.UserJoined
import org.bigbluebutton.core.apps.users.messages.UserLeft
import org.bigbluebutton.core.api.Role
import org.bigbluebutton.core.api.UserVO
import java.util.ArrayList
Expand Down Expand Up @@ -83,10 +83,13 @@ class UsersApp(meetingID: String, recorded: Boolean, outGW: MessageOutGateway) {
}

private def handleUserLeft(msg: UserLeaving):Unit = {
if (users.hasUser(msg.userID)) {
if (users.hasUser(msg.userID)) {
users.removeUser(msg.userID)
outGW.send(new UserLeft(msg.meetingID, recorded, msg.userID))
}
}
else{
println("This user is not here:" + msg.userID)
}
}

private def handleAssignPresenter(msg: AssignPresenter):Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.bigbluebutton.core.apps.users.messages.UserStatusChange
import org.bigbluebutton.conference.service.messaging.MessagingConstants
import com.google.gson.Gson
import org.bigbluebutton.core.apps.users.messages.UserJoined
import org.bigbluebutton.core.api.UserLeft
import org.bigbluebutton.core.apps.users.messages.UserLeft

class UsersEventRedisPublisher(service: MessageSender) extends OutMessageListener2 {

Expand Down Expand Up @@ -48,13 +48,15 @@ class UsersEventRedisPublisher(service: MessageSender) extends OutMessageListene
println("UsersEventRedisPublisher: end handleUserJoined")
}

private def handleUserLeft(msg: UserLeft) {
private def handleUserLeft(msg: UserLeft) {
println("UsersEventRedisPublisher: init handleUserLeft")
val map= new java.util.HashMap[String, String]();
map.put("meetingId", msg.meetingID);
map.put("messageId", MessagingConstants.USER_LEFT_EVENT);
map.put("internalUserId", msg.userID);

val gson= new Gson();
service.send(MessagingConstants.PARTICIPANTS_CHANNEL, gson.toJson(map));
println("UsersEventRedisPublisher: end handleUserLeft")
}
}

0 comments on commit d26265b

Please sign in to comment.