use of org.apache.openmeetings.db.util.ws.TextRoomMessage in project openmeetings by apache.
the class QuickPollManager method close.
public void close(Client c) {
Long roomId = c.getRoomId();
if (!c.hasRight(Room.Right.presenter) || !isStarted(roomId)) {
return;
}
map().remove(roomId);
WebSocketHelper.sendRoom(new TextRoomMessage(roomId, c, Type.quickPollUpdated, c.getUid()));
}
use of org.apache.openmeetings.db.util.ws.TextRoomMessage in project openmeetings by apache.
the class QuickPollManager method vote.
public void vote(Client c, boolean vote) {
Long roomId = c.getRoomId();
IMap<Long, Map<Long, Boolean>> polls = map();
polls.lock(roomId);
if (polls.containsKey(roomId)) {
Map<Long, Boolean> votes = map().get(roomId);
if (!votes.containsKey(c.getUserId())) {
votes.put(c.getUserId(), vote);
polls.put(roomId, votes);
WebSocketHelper.sendRoom(new TextRoomMessage(roomId, c, Type.quickPollUpdated, c.getUid()));
}
}
polls.unlock(roomId);
}
Aggregations