summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2010-02-15 21:42:27 -0800
committerNathan Fritz <fritzy@netflint.net>2010-02-15 21:42:27 -0800
commit0dcbe92d1e49a9f009b39c39150307e3c15c9f9b (patch)
treec723aa7aae91f9dccb1a0bd0ff916e18449964ad /sleekxmpp/plugins
parentac1d76b23d7d4137b175e85fbabae94d663a9773 (diff)
downloadslixmpp-0dcbe92d1e49a9f009b39c39150307e3c15c9f9b.tar.gz
slixmpp-0dcbe92d1e49a9f009b39c39150307e3c15c9f9b.tar.bz2
slixmpp-0dcbe92d1e49a9f009b39c39150307e3c15c9f9b.tar.xz
slixmpp-0dcbe92d1e49a9f009b39c39150307e3c15c9f9b.zip
got rid of stupid iq set/get/error/result methods
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/xep_0060.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/sleekxmpp/plugins/xep_0060.py b/sleekxmpp/plugins/xep_0060.py
index 999b8197..cbc89df6 100644
--- a/sleekxmpp/plugins/xep_0060.py
+++ b/sleekxmpp/plugins/xep_0060.py
@@ -43,9 +43,9 @@ class xep_0060(base.base_plugin):
iq = self.xmpp.makeIqSet(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is False or result is None or result.get('type') == 'error': return False
+ if result is False or result is None or result['type'] == 'error': return False
return True
def subscribe(self, jid, node, bare=True, subscribee=None):
@@ -65,7 +65,7 @@ class xep_0060(base.base_plugin):
iq.attrib['from'] = self.xmpp.fulljid
id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is False or result is None or result.get('type') == 'error': return False
+ if result is False or result is None or result['type'] == 'error': return False
return True
def unsubscribe(self, jid, node, bare=True, subscribee=None):
@@ -83,9 +83,9 @@ class xep_0060(base.base_plugin):
iq = self.xmpp.makeIqSet(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is False or result is None or result.get('type') == 'error': return False
+ if result is False or result is None or result['type'] == 'error': return False
return True
def getNodeConfig(self, jid, node=None): # if no node, then grab default
@@ -101,10 +101,10 @@ class xep_0060(base.base_plugin):
iq.append(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
#self.xmpp.add_handler("<iq id='%s'/>" % id, self.handlerCreateNodeResponse)
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is None or result == False or result.get('type') == 'error':
+ if result is None or result == False or result['type'] == 'error':
logging.warning("got error instead of config")
return False
if node is not None:
@@ -125,9 +125,9 @@ class xep_0060(base.base_plugin):
iq.append(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is None or result == False or result.get('type') == 'error':
+ if result is None or result == False or result['type'] == 'error':
logging.warning("got error instead of config")
return False
else:
@@ -148,9 +148,9 @@ class xep_0060(base.base_plugin):
iq.append(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is None or result == False or result.get('type') == 'error':
+ if result is None or result == False or result['type'] == 'error':
logging.warning("got error instead of config")
return False
else:
@@ -171,7 +171,7 @@ class xep_0060(base.base_plugin):
iq.append(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
if result is not None and result is not False and result.attrib.get('type', 'error') != 'error':
return True
@@ -189,9 +189,9 @@ class xep_0060(base.base_plugin):
iq = self.xmpp.makeIqSet(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is None or result.get('type') == 'error':
+ if result is None or result['type'] == 'error':
return False
return True
@@ -210,9 +210,9 @@ class xep_0060(base.base_plugin):
iq = self.xmpp.makeIqSet(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is None or result is False or result.get('type') == 'error': return False
+ if result is None or result is False or result['type'] == 'error': return False
return True
def deleteItem(self, jid, node, item):
@@ -226,9 +226,9 @@ class xep_0060(base.base_plugin):
iq = self.xmpp.makeIqSet(pubsub)
iq.attrib['to'] = jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is None or result is False or result.get('type') == 'error': return False
+ if result is None or result is False or result['type'] == 'error': return False
return True
def addItem(self, jid, node, items=[]):
@@ -280,9 +280,9 @@ class xep_0060(base.base_plugin):
iq = self.xmpp.makeIqSet(pubsub)
iq.attrib['to'] = ps_jid
iq.attrib['from'] = self.xmpp.fulljid
- id = iq.get('id')
+ id = iq['id']
result = self.xmpp.send(iq, "<iq id='%s'/>" % id)
- if result is None or result is False or result.get('type') == 'error':
+ if result is None or result is False or result['type'] == 'error':
return False
return True