import utils
from twisted.internet import reactor, task, protocol, error
-from tlib.xmlw import Element, jid
+from twisted.words.xish.domish import Element
+from twisted.words.protocols.jabber.jid import internJID
from debug import LogEvent, INFO, WARN, ERROR
import svninfo
import jabw
ID = el.getAttribute("id")
ulang = utils.getLang(el)
- if config.admins.count(jid.intern(to).userhost()) == 0:
+ if config.admins.count(internJID(to).userhost()) == 0:
self.pytrans.discovery.sendIqError(to=to, fro=config.jid, ID=ID, xmlns=disco.COMMANDS, etype="cancel", condition="not-authorized")
return
def incomingIq(self, el):
itype = el.getAttribute("type")
fro = el.getAttribute("from")
- froj = jid.intern(fro)
+ froj = internJID(fro)
to = el.getAttribute("to")
ID = el.getAttribute("id")
def incomingIq(self, el):
itype = el.getAttribute("type")
fro = el.getAttribute("from")
- froj = jid.intern(fro)
+ froj = internJID(fro)
to = el.getAttribute("to")
- toj = jid.intern(to)
+ toj = internJID(to)
ID = el.getAttribute("id")
if itype != "get" and itype != "error":
self.pytrans.discovery.sendIqError(to=fro, fro=config.jid, ID=ID, xmlns="vcard-temp", etype="cancel", condition="feature-not-implemented")
def incomingIq(self, el):
itype = el.getAttribute("type")
fro = el.getAttribute("from")
- froj = jid.intern(fro)
+ froj = internJID(fro)
to = el.getAttribute("to")
- toj = jid.intern(to)
+ toj = internJID(to)
ID = el.getAttribute("id")
if(itype != "get" and itype != "error"):
else:
return errOut()
- froj = jid.intern(el.getAttribute("from"))
- toj = jid.intern(el.getAttribute("to"))
+ froj = internJID(el.getAttribute("from"))
+ toj = internJID(el.getAttribute("to"))
session = self.pytrans.sessions.get(froj.userhost(), None)
if not session:
return errOut()
def errOut():
self.pytrans.discovery.sendIqError(to=el.getAttribute("from"), fro=el.getAttribute("to"), ID=ID, xmlns=disco.SI, etype="cancel", condition="bad-request")
- toj = jid.intern(el.getAttribute("to"))
- froj = jid.intern(el.getAttribute("from"))
+ toj = internJID(el.getAttribute("to"))
+ froj = internJID(el.getAttribute("from"))
session = self.pytrans.sessions.get(froj.userhost(), None)
if not session:
return errOut()
if el.getAttribute("type") != "set":
return errOut()
- toj = jid.intern(el.getAttribute("to"))
- froj = jid.intern(el.getAttribute("from"))
+ toj = internJID(el.getAttribute("to"))
+ froj = internJID(el.getAttribute("from"))
query = el.query
if not (query and query.getAttribute("mode", "tcp") == "tcp"):