123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
-
-
-
-
- if (!window.glob_mx){
- // window.glob_mx={}
- }
-
-
-
-
-
- /*
- msto_qx = {
- local:{},
- conference:{},
- participant:{},
- }
-
-
-
- msto_qx = {
- private_local:{},
- participant_local:{},
- conference:{},
- participant:{
- '<id_0>':{},
- '<id_1>':{},
- '<id_...>':{},
- '<id_n>':{
- rkey:{},
- },
-
- },
- }
- */
- 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"
- };
- // cstr:"onMsgx"
-
-
-
- mhndlr_opt_x = {
- cstr:"?",
- ns:"corner_mx",
- handler:mhndlr,
-
- }
- function rtrue(){
- // clog("rtrue...",this,arguments)
- // console.trace("rtrue")
- return true
- }
- function rtrue2(){
- clog("rtrue2...",this,arguments)
- // console.trace("rtrue2")
- return true
- }
- function rtrue3(){
- clog("rtrue3...",this,arguments)
- // console.trace("rtrue2")
- allevnt(...arguments)
- return true
- }
- mhndlr_opt_x_all = {
- cstr:"?",
- ns:"jabber:client",
- // name:"message",
- type:"groupchat",
- handler:allevnt,
- // isMatch:rtrue2,
- // run:rtrue3,
- // namespaceMatch:rtrue,
-
-
- }
-
- function add_handler_m(argument) {
- // minit()
- // if (!th.phx){
- // th.
- // }
- // var phx = APP.conference._room.room.connection.handlers[0].__proto__;
- var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
-
- var hxa=Object.create(phx)
- Object.assign(hxa,mhndlr_opt_null,mhndlr_opt_x)
- // APP.conference._room.room.connection.handlers.push(hxa)
- APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
- // th.hxa=hxa
- // th.hx
- // body...
- }
- function add_handler_m2(argument) {
- clog("ADD HANDLER M2")
- // minit()
- // if (!th.phx){
- // th.
- // }
- // var phx = APP.conference._room.room.connection.handlers[0].__proto__;
- var phx = APP.connection.xmpp.connection._stropheConn.handlers[0].__proto__;
-
- var hxa=Object.create(phx)
- Object.assign(hxa,mhndlr_opt_null,mhndlr_opt_x_all)
- // APP.conference._room.room.connection.handlers.push(hxa)
- APP.connection.xmpp.connection._stropheConn.addHandlers.push(hxa)
- return hxa
- // th.hxa=hxa
- // th.hx
- // body...
- }
-
- 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....",a0,a1,a2)
- clog("mhndlr... dflt")
- // setTimeout(window.onAll_rld_v2,1,this,a0,a1,a2,a3,a4)
- 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 allevnt(a0,a1,a2,a3,a4){
- clog("MH! allevnt")
- setTimeout(window.allevnt_rld,1,this,a0,a1,a2,a3,a4)
- return true
- }
- function rld_room(room){
- clog("rld_room...",room)
- window.location.assign(room)
- }
- function allevnt_rld(a0,a1,a2,a3,a4){
- // clog("MH!")
- // clog("allevnt_rld",a0,a1,a2,a3,a4)
-
- var msg = a1.querySelector(`body`)
- if (!msg){
- return
- }
- // clog("allevnt_rld...",a1)
-
-
- // clog("allevnt_rldw",_from.split("/").pop())
- // clog(msg)
- // return
- // @Joseph-Innace
- // clog(msg.innerHTML)
- var msg_txt = msg.innerHTML
- if (msg_txt.startsWith("moveto=")){
- var room = msg_txt.split("=").pop()
- if (room){
- var _from = a1.getAttribute("from").split("/").pop()
- if (get_local().id == _from){
- rld_room(room)
- } else {
- setTimeout(rld_room,2000,room)
-
- }
- // get_local().id
-
- }
-
- // clog("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",msg_txt.split("~"),msg_txt.split("~").pop())
- }
- // clog($(a1))
- // clog("z",$(a1)[0].innerHTML)
-
- // setTimeout(window.mhndlr_rld,1,this,a0,a1,a2,a3,a4)
- return true
- }
- /*
-
- delete Root_io
- {
-
- class Root_io {
- constructor(){}
- _pub_msg(m){
- clog("ixi PUB MSG",m)
- }
- _rec_msg(m){
- clog("ixi REC MSG",m)
- }
- }
- window.Root_io = Root_io
- }
- */
- // function allevnt(){
-
- // }
- clog("ZZZZZZZZZ")
- function init_mx(){
- clog("INITMX3")
- add_handler_m(mhndlr)
- add_handler_m2(allevnt)
- }
-
- ifn_obj.init_conf_join.push(init_mx)
-
-
-
- // sto_event
- // sto_update
-
-
- // pub_msg
- // rec_msg
-
-
- // set_local
-
-
-
-
-
-
-
-
-
|