FS-7889: [mod_conference] move conference chat to use an event channel so messages only go to the right 'room' for the conference

This commit is contained in:
Michael Jerris
2015-07-23 19:09:24 -05:00
parent c702eda6b2
commit 12a6b8bc53
7 changed files with 124 additions and 13 deletions

View File

@@ -70,15 +70,11 @@ function setupChat() {
$("#chatwin").html("");
$("#chatsend").click(function() {
if (!cur_call && chatting_with) {
if (!cur_call || !chatting_with || !confMan) {
return;
}
cur_call.message({to: chatting_with,
body: $("#chatmsg").val(),
from_msg_name: cur_call.params.caller_id_name,
from_msg_number: cur_call.params.caller_id_number
});
confMan.sendChat($("#chatmsg").val(), "message");
$("#chatmsg").val("");
});
@@ -307,7 +303,19 @@ var callbacks = {
displayID: "#conf_display",
dialog: dialog,
hasVid: check_vid(),
laData: data.pvtData
laData: data.pvtData,
chatCallback: function(v, e) {
console.log(e);
var from = e.data.fromDisplay || e.data.from || "Unknown";
var message = e.data.message || "";
$('#chatwin')
.append($('<span class="chatuid" />').text(from + ':'))
.append($('<br />'))
.append(messageTextToJQ(message))
.append($('<br />'));
$('#chatwin').animate({"scrollTop": $('#chatwin')[0].scrollHeight}, "fast");
}
});
if (!data.pvtData.canvasCount) {
@@ -366,7 +374,7 @@ var callbacks = {
$("#message").show();
}
chatting_with = data.pvtData.chatID;
chatting_with = data.pvtData.chatChannel;
}
break;