;IRcap8 9946f463d62fef4ff240fc7978144dd3

alias Setup_Jabber {
  if (!$s(p1)) { .hmake -s setupjabber | hload setupjabber "lng\ $+ %idioma $+ \jabber.lnh" }
  setup.cls
  %setup.pñ1 = 138 60 1 setupjabber2 $s(p1)  $s(p2)  $s(p3)
  var %i = 1 | while ($gettok(%jab.o,%i,44)) { set %setup.jab. [ $+ [ %i ] ] $gettok(%jab.o,%i,44) | inc %i }
  var %i = 100 | while ($gettok(%jab.tex,$calc(%i - 99),22)) { var %a = $gettok(%jab.tex,$calc(%i - 99),22) | if %a == * { %a = } | set %setup.jab. [ $+ [ %i ] ] %a | inc %i }
  setupjabber2 1
}

alias setupjabber2 {
  unset %setup.tx %setup.ls1 %setup.cb %setup.op
  cuag @setup 122 60 458 262 $gettok(%gui.cc,1,32) | pestana @setup setup.pñ1
  if $1 == 1 {
    %setup.jab.sb = off | if (sba.jabber isin %sbarra) { %setup.jab.sb = on }
    cuari @setup 354 76 1 232 gui
    cuari @setup 372 232 196 1 gui
    cuari @setup 140 252 196 1 gui
    cuari @setup 140 164 196 1 gui
    %setup.op = 156 116 setup.jab.1/s.j.o. $s(1) |156 140 setup.jab.2/s.j.o. $s(2) |156 204 setup.jab.4/s.j.o. $s(3) |156 180 setup.jab.3/s.j.o. $s(4) |156 228 setup.jab.5/s.j.o. $s(5) |376 80 setup.jab.6/s.j.o. $s(6) |376 136 setup.jab.7/s.j.o. $s(7) |372 252 setup.jab.9/s.j.o. $s(8) |156 292 setup.jab.sb/s.j.sb $s(9) |156 268 setup.jab.11/s.j.o. $s(10) |376 188 setup.jab.8/s.j.o. $s(11)
    %setup.tx = 544 276 24 setup.jab.100 $s(12) |376 292 192 setup.jab.101 ! $+ $s(13) |392 96 152 setup.jab.102 |392 152 152 setup.jab.103 |392 204 152 setup.jab.104
    %setup.bt = 548 92 6 s.j.wav_setup.jab.102 \|548 148 6 s.j.wav_setup.jab.103 \|548 200 6 s.j.wav_setup.jab.104 \
    %setup.cb = 156 92 150 jab.conex $s(14)
  }
  if $1 == 2 {
    %setup.ls1 = 140 220 372 6 1 0 s.j.f_click @hash1 0,210,260
    cuagr @setup 132 80 440 1 $s(15)
    cuagi @setup 132 148 440 1 gui $s(16)
    cuagr @setup 132 204 440 1 $s(17)
    %setup.tx = 144 104 92 setup.jab.us ! $+ $s(18) |252 104 92 setup.jab.sr @|396 104 76 setup.jab.ps ! $+ $s(19)
    %setup.bt = 348 100 8 s.j.ls ?|480 100 68 s.j.c_reg $s(20) |144 160 132 s.j.c_pass $s(21) |416 160 132 s.j.c_del $s(22) |296 160 100 s.j.c_vcard $s(23) |540 216 8 s.j.f_+ +|540 240 8 s.j.f_- -
    jabfavlist
  }
  if $1 == 3 {
    cuag @setup 136 76 436 236 gui $s(24)
    %setup.ls1 = 148 92 152 13 1 0 return @hash1
    %setup.op = 344 92 setup.jab.10/s.j.o. $s(25)
    %setup.bt = 148 284 50 s.j.v_blo+ +|256 284 50 s.j.v_blo- -
    jablocklist
  }
  muestrasetup
}

alias s.j.o. {
  if ($window(@jabber)) && (%setup.jab.11 == off) { guicierra @jabber } | if (!$window(@jabber)) && (%setup.jab.11 == on)  { jabgui }
  var %i = 1 | while ($gettok(%jab.o,%i,44)) { %jab.o = $puttok(%jab.o,%setup.jab. [ $+ [ %i ] ],%i,44) | inc %i }
  var %i = 100 | while ($gettok(%jab.tex,%i,22)) { %jab.tex = $puttok(%jab.tex,%setup.jab. [ $+ [ %i ] ],%i,22) | inc %i }
  writeini %perfil jabber op %jab.o
}
on 1:signal:setupedit: {
  if ($1 >= setup.jab.100) && ($1 <= setup.jab.104) {
    var %i = 100 | while ($gettok(%jab.tex,$calc(%i - 99),22)) { var %a = %setup.jab. [ $+ [ %i ] ] | if (!%a) { %a = * } | %jab.tex = $puttok(%jab.tex,%a,$calc(%i - 99),22) | inc %i }
  }
  writeini %perfil jabber txt $replace(%jab.tex,,)
}


alias s.j.sb {
  if  %setup.jab.sb == on { sbarset + jabber } | else { sbarset - jabber }
  window -a @setup
}

alias s.j.wav var %s = $dir=" $s(26) " [ c:\*.wav ] | % [ $+ [ $1 ] ] = $remove(%s,$mircdir) | guidib @setup | .signal -n setupedit setup.jab.100 | if (%s) slocal %s

alias s.j.v {
  goto $1
  :blo+ | var %a = $$?=" $s(27) " | %jab.block = $addtok(%jab.block,%a,22) | jablocklist | drawline @setup | goto L1
  :blo- | var %a = $sline(@hash1,1) | if (%a) { %jab.block = $remtok(%jab.block,%a,1,22) | jablocklist | drawline @setup }
  :L1
  wrini %perfil jabber blk $replace(%jab.block,,)
}

alias s.j.c {
  goto $1
  :reg
  if (!%setup.jab.us) || (!%setup.jab.sr) || (!%setup.jab.ps) { fallo | return }
  %ujabber = %setup.jab.us $+ @ $+ %setup.jab.sr $encode(%setup.jab.ps,m) 5222 IRcap
  jab.conn REG | return
  :pass
  var %at = %ujabber | %jab.con.id = $gettok(%ujabber,1,32) | jabpidepass | if %ujabber == %at return
  xm <iq to=" $+ $gettok($gettok(%ujabber,1,32),2,64) $+ " type="set" id="CPASS"><query xmlns="jabber:iq:register"><username> $+ $gettok(%ujabber,1,64) $+ </username><password> $+ $decode($gettok(%ujabber,2,32),m) $+ </password></query></iq>
  return
  :del
  if ($?!=" $mg(jdel,$gettok(%ujabber,1,32)) " != $true) return 
  xm <iq type="set" to=" $+ $gettok($gettok(%ujabber,1,32),2,64) $+ " id="DESREG"><query xmlns="jabber:iq:register"><remove/></query></iq>
  .timer -o 1 5 xmppui cancela
  return
  :vcard
  xmppui info $gettok(%ujabber,1,32)
}

alias s.j.ls {
  var %a = $sorttok(jabber.orgjabber.dk12jabber.comjabberes.orgjabber-hispano.orgjabber.czmyjabber.netnedlinux.nlaszlig.netdevelog.comjabber.anywise.comjabber.ccc.dejabber.frjabber.freenet.dejabber.sksourcecode.de,22) $+ - $s(28)
  if (!$1) { smenu s.j.ls 110 %a | return }
  if $1 == $numtok(%a,22) { url http://www.jabber.org/network | return }
  %setup.jab.sr = $gettok(%a,$1,22) | refres
}

alias s.j.f {
  goto $1
  :+
  var %j = $$?=" $mg2(jid1) "
  var %p = $$?=" $mg2(ppass) "
  var %pt = $?=" $mg2(jid2) " | if (!%pt) { %pt = 5222 }
  var %r = $?=" $mg2(jid3) " | if (!%r) { %r = IRcap }
  adpass Jabber $gettok(%j,1,32) $gettok(%p,1,32) $gettok(%pt,1,32) %r | jabfavlist | refres
  return
  :-
  var %a = $gettok($sline(@hash1,1),1,8)
  if (%a) { delpass Jabber %a 1 | jabfavlist | refres }
  return
  :click
  if $2 == 2 {
    if ($readini(%perfil,jabber,$3)) { %ujabber = $ifmatch | xmppui cancela }
  }
}

alias -l jablocklist window -c @hash1 | window -slh @hash1 | var %i = 1 | while ($gettok(%jab.block,%i,22)) { aline @hash1 $ifmatch | inc %i } | guilista @setup setup.ls1
alias -l jabfavlist window -c @hash1 | window -lh @hash1 | var %i = 1 | while ($readini(%perfil,jabber,%i)) { aline @hash1 $gettok($ifmatch,1,32) $+ $chr(8) $+ $gettok($ifmatch,3,32) $+ $chr(8) $+ $gettok($ifmatch,4-,32) | inc %i } | guilista @setup setup.ls1

alias -l S return $hget(setupjabber,$1)
alias -l MG return $replace($readini(lng\ $+ %idioma $+ \setup.ini,setup,$1),&1,$2,&2,$3,&3,$4,&4,$5)
alias -l MG2 return $replace($readini(lng\ $+ %idioma $+ \msg.ini,MSG1,$1),&1,$2,&2,$3,&3,$4,&4,$5)
on 1:signal:idioma: hfree -w setupjabber

;EOF-dt
