Mercurial > libervia-backend
diff src/tools/jid.py @ 688:f7878ad3c846
tools: renamed tools.jid.JID attribute "short" to "bare"
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 29 Oct 2013 16:26:55 +0100 |
parents | 84a6e83157c2 |
children | 1fe00f0c9a91 |
line wrap: on
line diff
--- a/src/tools/jid.py Mon Oct 28 19:04:49 2013 +0100 +++ b/src/tools/jid.py Tue Oct 29 16:26:55 2013 +0100 @@ -27,7 +27,7 @@ return self def __parse(self): - """find node domaine and resource""" + """find node domain and resource""" node_end = self.find('@') if node_end < 0: node_end = 0 @@ -38,11 +38,11 @@ self.domain = self[(node_end + 1) if node_end else 0:domain_end] self.resource = self[domain_end + 1:] if not node_end: - self.short = self + self.bare = self else: - self.short = self.node + '@' + self.domain + self.bare = self.node + '@' + self.domain def is_valid(self): """return True if the jid is xmpp compliant""" - #FIXME: always return True for the moment - return True + #TODO: implement real check, according to RFCs + return self.domain != ""