summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
authorNathan Fritz <nathan@andyet.net>2010-10-14 15:50:54 -0700
committerNathan Fritz <nathan@andyet.net>2010-10-14 15:50:54 -0700
commitdc001bb201268c5443c1be2a937d02a0c96ad4bb (patch)
tree21fca9b0f397d72cf20ae46013f93688c8dcd17b /sleekxmpp/basexmpp.py
parent0d0b963fe543169d069a2a69ae79735d404a2e33 (diff)
downloadslixmpp-dc001bb201268c5443c1be2a937d02a0c96ad4bb.tar.gz
slixmpp-dc001bb201268c5443c1be2a937d02a0c96ad4bb.tar.bz2
slixmpp-dc001bb201268c5443c1be2a937d02a0c96ad4bb.tar.xz
slixmpp-dc001bb201268c5443c1be2a937d02a0c96ad4bb.zip
deprecated jid, fulljid, server, user, resource properties and added boundjid JID
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py79
1 files changed, 68 insertions, 11 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 6e619270..2b4df809 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -113,12 +113,7 @@ class BaseXMPP(XMLStream):
self.default_ns = default_ns
self.stream_ns = 'http://etherx.jabber.org/streams'
- self.jid = ''
- self.fulljid = ''
- self.resource = ''
- self.jid = ''
- self.username = ''
- self.server = ''
+ self.boundjid = JID("")
self.plugin = {}
self.roster = {}
@@ -440,13 +435,75 @@ class BaseXMPP(XMLStream):
presence.append(nick)
presence.send()
+ @property
+ def jid(self):
+ """
+ Attribute accessor for bare jid
+ """
+ logging.warning("jid property deprecated. Use boundjid.bare")
+ return self.boundjid.bare
+
+ @jid.setter
+ def jid(self, value):
+ logging.warning("jid property deprecated. Use boundjid.bare")
+ self.boundjid.bare = value
+
+ @property
+ def fulljid(self):
+ """
+ Attribute accessor for full jid
+ """
+ logging.warning("fulljid property deprecated. Use boundjid.full")
+ return self.boundjid.full
+
+ @fulljid.setter
+ def fulljid(self, value):
+ logging.warning("fulljid property deprecated. Use boundjid.full")
+ self.boundjid.full = value
+
+ @property
+ def resource(self):
+ """
+ Attribute accessor for jid resource
+ """
+ logging.warning("resource property deprecated. Use boundjid.resource")
+ return self.boundjid.resource
+
+ @resource.setter
+ def resource(self, value):
+ logging.warning("fulljid property deprecated. Use boundjid.full")
+ self.boundjid.resource = value
+
+ @property
+ def username(self):
+ """
+ Attribute accessor for jid usernode
+ """
+ logging.warning("username property deprecated. Use boundjid.user")
+ return self.boundjid.user
+
+ @username.setter
+ def username(self, value):
+ logging.warning("username property deprecated. Use boundjid.user")
+ self.boundjid.user = value
+
+ @property
+ def server(self):
+ """
+ Attribute accessor for jid host
+ """
+ logging.warning("server property deprecated. Use boundjid.host")
+ return self.boundjid.server
+
+ @server.setter
+ def server(self, value):
+ logging.warning("server property deprecated. Use boundjid.host")
+ self.boundjid.server = value
+
def set_jid(self, jid):
"""Rip a JID apart and claim it as our own."""
- self.fulljid = jid
- self.resource = self.getjidresource(jid)
- self.jid = self.getjidbare(jid)
- self.username = jid.split('@', 1)[0]
- self.server = jid.split('@', 1)[-1].split('/', 1)[0]
+ logging.debug("setting jid to %s" % jid)
+ self.boundjid.full = jid
def getjidresource(self, fulljid):
if '/' in fulljid: