diff options
Diffstat (limited to 'sleekxmpp/plugins/xep_0054')
-rw-r--r-- | sleekxmpp/plugins/xep_0054/stanza.py | 40 | ||||
-rw-r--r-- | sleekxmpp/plugins/xep_0054/vcard_temp.py | 8 |
2 files changed, 37 insertions, 11 deletions
diff --git a/sleekxmpp/plugins/xep_0054/stanza.py b/sleekxmpp/plugins/xep_0054/stanza.py index 13865bb5..75b69d3e 100644 --- a/sleekxmpp/plugins/xep_0054/stanza.py +++ b/sleekxmpp/plugins/xep_0054/stanza.py @@ -72,6 +72,7 @@ class Nickname(ElementBase): name = 'NICKNAME' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'nicknames' interfaces = set([name]) is_extension = True @@ -94,6 +95,7 @@ class Email(ElementBase): name = 'EMAIL' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'emails' interfaces = set(['HOME', 'WORK', 'INTERNET', 'PREF', 'X400', 'USERID']) sub_interfaces = set(['USERID']) bool_interfaces = set(['HOME', 'WORK', 'INTERNET', 'PREF', 'X400']) @@ -103,8 +105,9 @@ class Address(ElementBase): name = 'ADR' namespace = 'vcard-temp' plugin_attrib = name - interfaces = set(['HOME', 'WORK', 'POSTAL', 'PARCEL', 'DOM', 'INTL', - 'PREF', 'POBOX', 'EXTADD', 'STREET', 'LOCALITY', + plugin_multi_attrib = 'addresses' + interfaces = set(['HOME', 'WORK', 'POSTAL', 'PARCEL', 'DOM', 'INTL', + 'PREF', 'POBOX', 'EXTADD', 'STREET', 'LOCALITY', 'REGION', 'PCODE', 'CTRY']) sub_interfaces = set(['POBOX', 'EXTADD', 'STREET', 'LOCALITY', 'REGION', 'PCODE', 'CTRY']) @@ -115,12 +118,13 @@ class Telephone(ElementBase): name = 'TEL' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'telephone_numbers' interfaces = set(['HOME', 'WORK', 'VOICE', 'FAX', 'PAGER', 'MSG', 'CELL', 'VIDEO', 'BBS', 'MODEM', 'ISDN', 'PCS', 'PREF', 'NUMBER']) sub_interfaces = set(['NUMBER']) - bool_interfaces = set(['HOME', 'WORK', 'VOICE', 'FAX', 'PAGER', - 'MSG', 'CELL', 'VIDEO', 'BBS', 'MODEM', + bool_interfaces = set(['HOME', 'WORK', 'VOICE', 'FAX', 'PAGER', + 'MSG', 'CELL', 'VIDEO', 'BBS', 'MODEM', 'ISDN', 'PCS', 'PREF']) def setup(self, xml=None): @@ -138,9 +142,10 @@ class Label(ElementBase): name = 'LABEL' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'labels' interfaces = set(['HOME', 'WORK', 'POSTAL', 'PARCEL', 'DOM', 'INT', 'PREF', 'lines']) - bool_interfaces = set(['HOME', 'WORK', 'POSTAL', 'PARCEL', 'DOM', + bool_interfaces = set(['HOME', 'WORK', 'POSTAL', 'PARCEL', 'DOM', 'INT', 'PREF']) def add_line(self, value): @@ -171,6 +176,7 @@ class Geo(ElementBase): name = 'GEO' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'geolocations' interfaces = set(['LAT', 'LON']) sub_interfaces = interfaces @@ -179,6 +185,7 @@ class Org(ElementBase): name = 'ORG' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'organizations' interfaces = set(['ORGNAME', 'ORGUNIT', 'orgunits']) sub_interfaces = set(['ORGNAME', 'ORGUNIT']) @@ -210,6 +217,7 @@ class Photo(ElementBase): name = 'PHOTO' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'photos' interfaces = set(['TYPE', 'EXTVAL']) sub_interfaces = interfaces @@ -218,14 +226,16 @@ class Logo(ElementBase): name = 'LOGO' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'logos' interfaces = set(['TYPE', 'EXTVAL']) sub_interfaces = interfaces class Sound(ElementBase): - name = 'LOGO' + name = 'SOUND' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'sounds' interfaces = set(['PHONETC', 'EXTVAL']) sub_interfaces = interfaces @@ -264,6 +274,7 @@ class Classification(ElementBase): name = 'CLASS' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'classifications' interfaces = set(['PUBLIC', 'PRIVATE', 'CONFIDENTIAL']) bool_interfaces = interfaces @@ -272,6 +283,7 @@ class Categories(ElementBase): name = 'CATEGORIES' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'categories' interfaces = set([name]) is_extension = True @@ -301,6 +313,7 @@ class Birthday(ElementBase): name = 'BDAY' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'birthdays' interfaces = set([name]) is_extension = True @@ -319,6 +332,7 @@ class Rev(ElementBase): name = 'REV' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'revision_dates' interfaces = set([name]) is_extension = True @@ -337,6 +351,7 @@ class Title(ElementBase): name = 'TITLE' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'titles' interfaces = set([name]) is_extension = True @@ -351,6 +366,7 @@ class Role(ElementBase): name = 'ROLE' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'roles' interfaces = set([name]) is_extension = True @@ -365,6 +381,7 @@ class Note(ElementBase): name = 'NOTE' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'notes' interfaces = set([name]) is_extension = True @@ -379,6 +396,7 @@ class Desc(ElementBase): name = 'DESC' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'descriptions' interfaces = set([name]) is_extension = True @@ -393,6 +411,7 @@ class URL(ElementBase): name = 'URL' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'urls' interfaces = set([name]) is_extension = True @@ -407,6 +426,7 @@ class UID(ElementBase): name = 'UID' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'uids' interfaces = set([name]) is_extension = True @@ -421,6 +441,7 @@ class ProdID(ElementBase): name = 'PRODID' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'product_ids' interfaces = set([name]) is_extension = True @@ -435,6 +456,7 @@ class Mailer(ElementBase): name = 'MAILER' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'mailers' interfaces = set([name]) is_extension = True @@ -449,6 +471,7 @@ class SortString(ElementBase): name = 'SORT-STRING' namespace = 'vcard-temp' plugin_attrib = 'SORT_STRING' + plugin_multi_attrib = 'sort_strings' interfaces = set([name]) is_extension = True @@ -463,6 +486,7 @@ class Agent(ElementBase): name = 'AGENT' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'agents' interfaces = set(['EXTVAL']) sub_interfaces = interfaces @@ -471,6 +495,7 @@ class JabberID(ElementBase): name = 'JABBERID' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'jids' interfaces = set([name]) is_extension = True @@ -485,11 +510,12 @@ class TimeZone(ElementBase): name = 'TZ' namespace = 'vcard-temp' plugin_attrib = name + plugin_multi_attrib = 'timezones' interfaces = set([name]) is_extension = True def set_tz(self, value): - time = xep_0082.time(offset=value) + time = xep_0082.time(offset=value) if time[-1] == 'Z': self.xml.text = 'Z' else: diff --git a/sleekxmpp/plugins/xep_0054/vcard_temp.py b/sleekxmpp/plugins/xep_0054/vcard_temp.py index 2c462037..672f948a 100644 --- a/sleekxmpp/plugins/xep_0054/vcard_temp.py +++ b/sleekxmpp/plugins/xep_0054/vcard_temp.py @@ -53,7 +53,7 @@ class XEP_0054(BasePlugin): def make_vcard(self): return VCardTemp() - def get_vcard(self, jid=None, ifrom=None, local=False, cached=False, + def get_vcard(self, jid=None, ifrom=None, local=False, cached=False, block=True, callback=None, timeout=None): if self.xmpp.is_component and jid.domain == self.xmpp.boundjid.domain: local = True @@ -84,12 +84,12 @@ class XEP_0054(BasePlugin): iq.enable('vcard_temp') vcard = iq.send(block=block, callback=callback, timeout=timeout) - + if block: self.api['set_vcard'](vcard['from'], args=vcard['vcard_temp']) return vcard - def publish_vcard(self, vcard=None, jid=None, block=True, ifrom=None, + def publish_vcard(self, vcard=None, jid=None, block=True, ifrom=None, callback=None, timeout=None): if self.xmpp.is_component: self.api['set_vcard'](jid, None, ifrom, vcard) @@ -107,7 +107,7 @@ class XEP_0054(BasePlugin): self.api['set_vcard'](jid=iq['from'], args=iq['vcard_temp']) return elif iq['type'] == 'get': - vcard = self.api['get_vard'](iq['from'].bare) + vcard = self.api['get_vcard'](iq['from'].bare) if isinstance(vcard, Iq): vcard.send() else: |