Rename to slixmpp
[slixmpp.git] / slixmpp / plugins / xep_0153 / stanza.py
blobfe8d5e981bd594fbf44b094d50bb07007904cc14
1 """
2 Slixmpp: The Slick XMPP Library
3 Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
4 This file is part of Slixmpp.
6 See the file LICENSE for copying permission.
7 """
9 from slixmpp.xmlstream import ElementBase
12 class VCardTempUpdate(ElementBase):
13 name = 'x'
14 namespace = 'vcard-temp:x:update'
15 plugin_attrib = 'vcard_temp_update'
16 interfaces = set(['photo'])
17 sub_interfaces = interfaces
19 def set_photo(self, value):
20 if value is not None:
21 self._set_sub_text('photo', value, keep=True)
22 else:
23 self._del_sub('photo')
25 def get_photo(self):
26 photo = self.xml.find('{%s}photo' % self.namespace)
27 if photo is None:
28 return None
29 return photo.text