diff options
author | mightyBroccoli <nico@magicbroccoli.de> | 2018-07-20 23:16:59 +0200 |
---|---|---|
committer | mightyBroccoli <nico@magicbroccoli.de> | 2018-07-20 23:17:43 +0200 |
commit | b9a2e5adcda82bcf14e6a6ec3b504aec7908ec42 (patch) | |
tree | 39977218b2b0c3402465b8629c063d915bdcfb46 /main.py | |
parent | abbbb88191cabffd726e15eafec8e9af4b83b85e (diff) |
XEP-0157 finally finished
* fixed XEP 0157 functionality
* updated README.MD
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -157,12 +157,16 @@ class QueryBot(slixmpp.ClientXMPP): if field['type'] == 'hidden' and var == 'FORM_TYPE':
title = field['value'][0]
continue
- sep = '\n ' + len(var) * ' '
+ sep = ', '
field_value = field.get_value(convert=False)
value = sep.join(field_value) if isinstance(field_value, list) else field_value
server_info.append('%s: %s' % (var, value))
- self.send_message(mto=msg['from'].bare, mbody=server_info, mtype=msg['type'])
+ text = "contact addresses for %s are" % (line[1])
+ for count in range(len(server_info)):
+ text += "\n" + server_info[count]
+
+ self.send_message(mto=msg['from'].bare, mbody=text, mtype=msg['type'])
except NameError:
pass
except XMPPError:
@@ -221,6 +225,7 @@ if __name__ == '__main__': xmpp.register_plugin('xep_0060') # PubSub
xmpp.register_plugin('xep_0085') # Chat State Notifications
xmpp.register_plugin('xep_0092') # Software Version
+ xmpp.register_plugin('xep_0128') # Service Discovery Extensions
xmpp.register_plugin('xep_0199') # XMPP Ping
# connect and start receiving stanzas
|