Merge pull request #3379 from ritzalam/fix-poll-voting
Cast Exception when sending Number from client to Red5
This commit is contained in:
commit
e2191a0426
@ -26,7 +26,7 @@ import org.bigbluebutton.red5.pubsub.MessagePublisher;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.red5.server.api.Red5;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
|
||||
public class CaptionService {
|
||||
private static Logger log = Red5LoggerFactory.getLogger( CaptionService.class, "bigbluebutton" );
|
||||
|
||||
@ -59,15 +59,29 @@ public class CaptionService {
|
||||
}
|
||||
|
||||
public void editCaptionHistory(Map<String, Object> msg) {
|
||||
int startIndex = (Integer) msg.get("startIndex");
|
||||
int endIndex = (Integer) msg.get("endIndex");
|
||||
String locale = msg.get("locale").toString();
|
||||
String localeCode = msg.get("localeCode").toString();
|
||||
String text = msg.get("text").toString();
|
||||
|
||||
String meetingID = Red5.getConnectionLocal().getScope().getName();
|
||||
String userID = getBbbSession().getInternalUserID();
|
||||
|
||||
|
||||
Integer startIndex;
|
||||
if (msg.get("startIndex") instanceof Double) {
|
||||
Double tempStartIndex = (Double) msg.get("startIndex");
|
||||
startIndex = tempStartIndex.intValue();
|
||||
} else {
|
||||
startIndex = (Integer) msg.get("startIndex");
|
||||
}
|
||||
|
||||
Integer endIndex;
|
||||
if (msg.get("endIndex") instanceof Double) {
|
||||
Double tempEndIndex = (Double) msg.get("endIndex");
|
||||
endIndex = tempEndIndex.intValue();
|
||||
} else {
|
||||
endIndex = (Integer) msg.get("endIndex");
|
||||
}
|
||||
|
||||
red5InGW.editCaptionHistory(meetingID, userID, startIndex, endIndex, locale, localeCode, text);
|
||||
}
|
||||
}
|
||||
|
@ -41,9 +41,23 @@ public class PollingService {
|
||||
String meetingID = Red5.getConnectionLocal().getScope().getName();
|
||||
String userId = getBbbSession().getInternalUserID();
|
||||
String pollId = (String) message.get("pollId");
|
||||
Integer questionId = (Integer) message.get("answerId");
|
||||
Integer answerId = (Integer) message.get("answerId");
|
||||
|
||||
|
||||
Integer questionId;
|
||||
if (message.get("answerId") instanceof Double) {
|
||||
Double tempQuestionId = (Double) message.get("answerId");
|
||||
questionId = tempQuestionId.intValue();
|
||||
} else {
|
||||
questionId = (Integer) message.get("answerId");
|
||||
}
|
||||
|
||||
Integer answerId;
|
||||
if (message.get("answerId") instanceof Double) {
|
||||
Double tempAnswerId = (Double) message.get("answerId");
|
||||
answerId = tempAnswerId.intValue();
|
||||
} else {
|
||||
answerId = (Integer) message.get("answerId");
|
||||
}
|
||||
|
||||
red5GW.votePoll(meetingID, userId, pollId, questionId, answerId);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user