FS-8036 [verto.js] #resolve Add chatCallback to $.verto.conf

This commit is contained in:
Joao Mesquita 2015-08-24 13:37:26 -03:00
parent 51a3ec7cbc
commit 749313a2b2
1 changed files with 26 additions and 1 deletions

View File

@ -1193,7 +1193,15 @@
conf.params.onBroadcast(verto, conf, e.data);
}
}
})
});
verto.subscribe(conf.params.laData.chatChannel, {
handler: function(v, e) {
if (typeof(conf.params.chatCallback) === "function") {
conf.params.chatCallback(v,e);
}
}
});
};
$.verto.conf.prototype.modCommand = function(cmd, id, value) {
@ -1219,6 +1227,10 @@
if (conf.params.laData.modChannel) {
conf.verto.unsubscribe(conf.params.laData.modChannel);
}
if (conf.params.laData.chatChannel) {
conf.verto.unsubscribe(conf.params.laData.chatChannel);
}
};
function createMainModeratorMethods() {
@ -1312,6 +1324,19 @@
}
this.modCommand("transfer", parseInt(memberID), "exten");
};
$.verto.conf.prototype.sendChat = function(message, type) {
var conf = this;
conf.verto.rpcClient.call("verto.broadcast", {
"eventChannel": conf.params.laData.chatChannel,
"data": {
"action": "send",
"message": message,
"type": type
}
});
};
}
$.verto.modfuncs = {};