123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
-
-
-
-
- if (!window.glob_mx){
- // window.glob_mx={}
- }
- function disp(o){
- APP.store.dispatch(o)
- }
-
-
- // default event handler this should match all events
- mhndlr_opt_null = {
- from: undefined,
- handler: "onAll",
- id: null,
- name: null,
- // "http://jitsi.org/jitmeet"
- ns: null,
- options: {matchBareFromJid: false, ignoreNamespaceFragment: false},
- type: null,
- user: true,
- cstr:"test"
- };
-
-
-
- mhndlr_opt_x = {
- cstr:"?",
- ns:"corner_mx",
- handler:mhndlr,
-
- }
-
-
- function add_handler_m(handler) {
- var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
-
- var hxa=Object.create(phx)
- Object.assign(hxa,mhndlr_opt_null,handler)
- APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
- }
-
-
- function tmsgx(data,tag="div",attrs={}){
- // return
- var ns = {xmlns:"corner_mx"}
- var msg = $build("message",{ to: window.APP.conference._room.room.roomjid,
- type: 'groupchat',
- });
- var payload=JSON.stringify(data)
-
- Object.assign({},ns,attrs)
-
- msg.c(tag, payload,Object.assign({},ns,attrs)).up();
- // console.log("zzzz")
- APP.conference._room.room.connection.send(msg)
- }
-
-
-
- function tmsgx2(data,opt_arg={},attrs={}){
- // return
- dflt_opt = {
- tag:"code",
- type:"chat",
- to:window.APP.conference._room.room.roomjid,
- }
- var opt = Object.assign({},dflt_opt,opt_arg)
-
- var ns = {xmlns:"corner_mx"}
- var msg = $build("message",{ to: opt.to,
- type: opt.type,
- });
- var payload=JSON.stringify(data)
-
- Object.assign({},ns,attrs)
-
- msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
- // console.log("zzzz")
- APP.conference._room.room.connection.send(msg)
- }
- function tmsgx3(data,opt_arg={},attrs={}){
- // return
- dflt_opt = {
- tag:"code",
- // type:"chat",
- to:window.APP.conference._room.room.roomjid,
- }
- var opt = Object.assign({},dflt_opt,opt_arg)
- clog("T:",data,opt,opt.type)
- if (!opt.type){
- clog("NO TYPE")
- opt.to == dflt_opt.to ? opt.type = "groupchat" : opt.type = "chat"
- }
- clog("T:",data,opt,opt.type)
-
- var ns = {xmlns:"corner_mx"}
- var msg = $build("message",{ to: opt.to,
- type: opt.type,
- // from: "nnnx@conference.jfidev.com/3db7bf15",
- // xtra: "nnnx@conference.jfidev.com/3db7bf15",
- });
- var payload=JSON.stringify(data)
-
- Object.assign({},ns,attrs)
-
- msg.c(opt.tag, payload,Object.assign({},ns,attrs)).up();
- // console.log("zzzz")
- APP.conference._room.room.connection.send(msg)
- }
-
-
-
- function mhndlr_rld_dflt(a0,a1,a2,a3,a4){
- clog("mhndlr... dflt")
- return true
- }
- if (!window.mhndlr_rld){
- window.mhndlr_rld = mhndlr_rld_dflt
- }
- function mhndlr(a0,a1,a2,a3,a4){
- // clog("MH!")
- setTimeout(window.mhndlr_rld,1,this,a0,a1,a2,a3,a4)
- return true
- }
-
-
- function init_mx(){
- clog("INITMX")
- add_handler_m(mhndlr_opt_x)
- // add_handler_m(mhndlr_opt_x_all)
- }
-
- // init_mx will be called once we join th confrence
- ifn_obj.init_conf_join.push(init_mx)
-
|