Commit graph

273 commits

Author SHA1 Message Date
Lance Stout
7e5e9542e9 Add support for notify attribute when retracting an item. 2011-09-01 13:36:11 -07:00
Lance Stout
d7fc2aaa9c Add ability to get global/node default subscription options. 2011-09-01 13:25:35 -07:00
Lance Stout
8471a485d1 Clean up pubsub stanzas. 2011-09-01 13:12:26 -07:00
Lance Stout
462b375c8f Owners can modify subscriptions/affiliations. With tests.
94% coverage for the main pubsub plugin! (91% including stanzas)
2011-09-01 12:09:24 -07:00
Lance Stout
afbd506cfc Users can retrieve their affiliations now, with tests. 2011-09-01 11:30:55 -07:00
Lance Stout
ec01e45ed1 Add ability for a user to get retrieve subscriptions, with tests. 2011-09-01 11:19:25 -07:00
Lance Stout
993829b23f Add tests for pubsub subscription options. 2011-09-01 10:44:14 -07:00
Lance Stout
002257b820 Add tests for retrieving pubsub items. 2011-09-01 09:27:10 -07:00
Lance Stout
76bc0a2ba6 XEP-0060 v1.13 dictates publishing/retracting one item at a time. 2011-08-31 23:48:22 -07:00
Lance Stout
3f9ca0366b Add test for purging a pubsub node. 2011-08-31 21:09:25 -07:00
Lance Stout
b68785e19e Retract stanzas are behaving oddly when using stanza values. 2011-08-31 16:03:32 -07:00
Lance Stout
46f23f7348 Test publishng an item with options. 2011-08-31 14:55:37 -07:00
Lance Stout
09252baa71 Test publishing a single item. 2011-08-31 14:31:20 -07:00
Lance Stout
3623a7a16a More pubsub unit tests! 2011-08-31 14:05:29 -07:00
Lance Stout
cc504ab07c Fix pubsub get_items.
- item_ids checked for None
- pubsub node is set
2011-08-31 10:56:43 -07:00
Lance Stout
2500a0649b Fix requesting pubsub node configuration, and add tests.
- <default /> doesn't have a type attribute in the XEP
- <configure /> isn't used anymore for requesting default configuration
2011-08-31 10:43:33 -07:00
Lance Stout
5ec4e4a026 Added pubsub error stanza.
iq['error']['pubsub']['condition']
iq['error']['pubsub']['unsupported']
2011-08-31 00:42:37 -07:00
Lance Stout
628978fc8c Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-30 23:11:11 -07:00
Nathan Fritz
7fb9d68714 fixed form accessors in pubsub stanzas 2011-08-30 23:10:13 -07:00
Lance Stout
e0a1c477d0 Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-30 23:03:51 -07:00
Nathan Fritz
b70565720f fixed test further... but now I have an out of order problem 2011-08-30 23:03:04 -07:00
Lance Stout
33ac0c9dd6 Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-30 22:45:08 -07:00
Nathan Fritz
4699bdff60 Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-30 22:44:34 -07:00
Nathan Fritz
354641a3ce added publish-options element 2011-08-30 22:44:19 -07:00
Lance Stout
58a43e40c7 Get/set pubsub subscription options. 2011-08-30 22:27:21 -07:00
Lance Stout
13fdab0139 Test and fix XEP-0060 delete_node() 2011-08-30 21:57:11 -07:00
Lance Stout
2ce617b2ce Fix typo 2011-08-30 09:24:46 -07:00
Lance Stout
63e0496c30 Finish up all major actions in the current XEP-0060.
Still need tests and docs.
2011-08-29 23:05:14 -07:00
Lance Stout
850e3bb99b Stub out missing functionality for pubsub 2011-08-29 21:38:41 -07:00
Lance Stout
2d90deb96a The ifrom parameter doesn't need special treatment. 2011-08-26 22:06:32 -07:00
Lance Stout
3fb3f63e51 Add docs + extended Iq send arguments to pubsub methods. 2011-08-26 16:57:37 -07:00
Lance Stout
d12949ff1c Fix typos in XEP-0060, start of docs and tests. 2011-08-26 12:14:57 -07:00
Lance Stout
004eabf809 Update plugins that use Iq stanzas to work with new exceptions. 2011-08-17 21:30:47 -07:00
Lance Stout
62230fc970 Return '' instead of None from form fields with no values. 2011-08-17 21:22:03 -07:00
Lance Stout
331db30f8f Add form.field back in for backwards compatibility. 2011-08-13 08:34:23 -07:00
Lance Stout
017d7ec62b Add tests for setting a form's type to 'submit' or 'cancel'.
Form fields now remember their current type if the type is deleted. This
allows for fields to properly format their values if set after the form
has been changed to the 'submit' type.
2011-08-13 01:28:18 -07:00
Lance Stout
c26b716164 Update XEP-0050 to use new IQ exceptions.
IqError is now caught and forwarded to the command error handler referenced
in the session.

Errors are now caught and processed by the session's error handler
whether or not the results Iq stanza includes the <command> substanza.

Added the option for blocking command calls. The blocking option is set
during start_command with block=True. Subsequent command flow methods use
session['block'] to determine their blocking behaviour.

If you use blocking commands, then you will need to wrap your command calls
in a try/except block for IqTimeout exceptions.
2011-08-13 00:10:06 -07:00
Nathan Fritz
8f1d0e7a79 Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-12 16:36:03 -07:00
Nathan Fritz
88184ff955 fixed indenting and merged in exceptions branch 2011-08-12 16:35:36 -07:00
Nathan Fritz
0050c51124 updated pubsub plugin to use stanzas 2011-08-12 16:32:09 -07:00
Lance Stout
9b7ed73f95 Reorganize XEP-0004.
Changes:
    May now use underscored method names
    form.field is replaced by form['fields']
    form.get_fields no longer accepts use_dict parameter, it always
        returns an OrderedDict now
    form.set_fields will accept either an OrderedDict, or a list
        of (var, dict) tuples as before.
    Setting the form type to 'submit' will remove extra meta data
        from the form fields, leaving just the 'var' and 'value'
    Setting the form type to 'cancel' will remove all fields.
2011-08-11 21:59:55 -07:00
Lance Stout
156b3200e3 Don't include ping stanza in the ping result. 2011-08-10 09:05:43 -07:00
Lance Stout
75f23d1130 Fix XEP-0078 using the new stream feature workflow.
Honestly, this is mainly just a demo/proof of concept that we
can handle dependencies and ordering issues with stream features.

DON'T use XEP-0078 if you are able to use the normal SASL method,
which should be the case unless you are dealing with a very old
XMPP server implementation.
2011-08-06 12:30:56 -07:00
Lance Stout
47bc50d9fb Cosmetic PEP8 fixes. 2011-08-04 22:37:22 -07:00
Lance Stout
93a4a3f8a0 Fix Python3 issue with dict.has_key() 2011-08-04 22:36:23 -07:00
Lance Stout
6c8a135612 Fix imports using __all__. 2011-08-04 21:49:15 -07:00
Lance Stout
4d8933abdf Actually, we can work around needing dateutil.
If dateutil is present, we'll use that. If not, we'll use
some regexes from the fixed_datetime module.
2011-08-04 20:22:07 -07:00
Lance Stout
6eac0606cf Merge branch 'develop' of github.com:fritzy/SleekXMPP into develop 2011-08-04 19:07:04 -07:00
Lance Stout
7cd39a6aad Fix imports for xep_0060 2011-08-04 11:38:14 -07:00
Lance Stout
a0767f6af6 Sadly, dateutil is not actually part of the standard lib.
Thus, using the XEP-0082 and XEP-0202 introduces a dependency
on the dateutil package (installable using pip install python-dateutil).

Maybe we'll be able to rework how these plugins work to avoid
needing dateutil, but for now this will have to do.
2011-08-04 00:07:30 -07:00
Nathan Fritz
9ffdba8643 the great xep_0060 re-organization in preperation for rewrite 2011-08-03 23:56:24 -07:00
Lance Stout
9591cd3a7e Merge branch 'stream_features' into develop 2011-08-03 18:35:01 -07:00
Nathan Fritz
db92fa2330 started transition to xep_0060 rewrite 2011-08-03 18:11:00 -07:00
Lance Stout
3918ddb075 Merge branch 'develop' into stream_features 2011-08-03 17:02:33 -07:00
Lance Stout
1d22a04721 Added support for custom OOB transfer handlers.
Accepting download requests can be done using:

    self['xep_0066'].register_url_handler(handler=self.oob_download)
    # Add jid=... to specify a handler for a particular JID for a
    # componenent.

    def oob_download(self, iq):
        if iq['from'] not in self.custom_oob_whitelist:
            raise XMPPError('not-authorized')
        try:
            data = urllib2.urlopen(iq['oob_transfer']['url'])
            file = open('oob_download', 'w+')
            file.write(data.read())
            file.close()
            data.close()
        except:
            raise XMPPError('item-not-found')
2011-07-05 09:22:17 -07:00
Lance Stout
cccccdcc0a Add logging to XEP-0066. 2011-07-03 20:39:03 -07:00
Lance Stout
8d384ce44f Added XEP-0224 Attention plugin. 2011-07-03 20:37:21 -07:00
Lance Stout
4d6e7c7dbb Update version number to beta6.
XEP-0092 now uses sleekxmpp.__version__ as a default version number.
2011-07-03 15:47:12 -07:00
Lance Stout
9c5885c6b6 Let XEP-0202 specify the local timezone offset in the config. 2011-07-03 15:41:22 -07:00
Lance Stout
ec3a14e6d9 Updated XEP-0202 plugin to new format and use XEP-0082. 2011-07-03 15:30:06 -07:00
Lance Stout
c98f5d4450 Fix some bugs in time handling.
Namely, minutes and seconds were reversed.
2011-07-03 13:41:15 -07:00
Lance Stout
2e8e542bc9 Added XEP-0203 Delayed Delivery plugin. 2011-07-03 12:43:34 -07:00
Lance Stout
7ccc67c06d Added XEP-0082 plugin.
This should make things much easier for any stanza that uses timestamps.
2011-07-03 12:21:47 -07:00
Lance Stout
9a6eb333e6 Merge branch 'develop' into stream_features 2011-07-03 00:38:22 -07:00
Lance Stout
086bf89d69 Added XEP-0066: Out-of-Band Data 2011-07-03 00:36:36 -07:00
Lance Stout
754ac5092a Reorganize features into plugins. 2011-06-30 15:40:22 -07:00
Nathan Fritz
e2d18170b0 old xep_0050 plugin is now loadable 2011-06-10 04:14:01 +00:00
Lance Stout
e219c0f976 Added session_end event and some docs.
For now, session_end is the same as disconnected, but once support is
added later for stream management, the two events will become distinct.

Plugins should add handlers for session_end for cleaning any session
state.
2011-06-08 10:24:25 -07:00
Lance Stout
4266ee0fa4 Fix XEP-0050 issue with Unicode string type checking. 2011-06-08 10:00:28 -07:00
Nathan Fritz
016aac69f6 Pubsub/Unsubscribe was not getting registered 2011-04-14 17:35:20 -07:00
Lance Stout
d94811d81d Added new implementation for XEP-0086. 2011-03-24 13:14:26 -04:00
Lance Stout
a3d111be12 Added new XEP-0050 implementation.
Backward incompatibility alert!

Please see examples/adhoc_provider.py for how to use the new
plugin implementation, or the test examples in the files
tests/test_stream_xep_0050.py and tests/test_stanza_xep_0050.py.

Major changes:
    - May now have zero-step commands. Useful if a command is
      intended to be a dynamic status report that doesn't
      require any user input.
    - May use payloads other than data forms, such as a
      completely custom stanza type.
    - May include multiple payload items, such as multiple
      data forms, or a form and a custom stanza type.
    - Includes a command user API for calling adhoc commands
      on remote agents and managing the workflow.
    - Added support for note elements.

Todo:
    - Add prev action support.

You may use register_plugin('old_0050') to continue using the
previous XEP-0050 implementation.
2011-03-24 09:35:36 -04:00
Lance Stout
feb7f892ea Fix typo. 2011-03-23 19:00:20 -04:00
Lance Stout
833f95b53a Cleaned XEP-0249 plugin, added tests. 2011-03-23 10:00:32 -04:00
Lance Stout
4b1fadde4b Updated XEP-0128 plugin to work with the new XEP-0030 plugin.
Required fixing a few bugs in StanzaBase related to iterable
substanzas.
2011-03-22 20:42:43 -04:00
Lance Stout
450c313340 Fix error in stanza handler registration in XEP-0092. 2011-03-18 17:30:29 -04:00
Florent Le Coz
5635265203 Avoid infinite loop on version result
We need to check if type="get". otherwise we will send our version
when we will receive the version of the remote entity, and thus
going in an infinite loop.
2011-03-16 06:45:06 +08:00
Lance Stout
45ccb31356 Remove the occasional warning about XEP-0059 not loaded. 2011-02-24 16:13:44 -05:00
Lance Stout
1a81b2f464 Add tests for XEP-0085, fix some bugs. 2011-02-24 14:15:02 -05:00
Lance Stout
77251452c1 Updated the XEP-0085 plugin.
Can now be used as so:

>>> msg['chat_state']
''
>>> msg
<message />

>>> msg['chat_state'] = 'paused'
>>> msg
<message>
  <paused xmlns="http://jabber.org/protocol/chatstates" />
</message>

>>> msg['chat_state']
'paused'

>>> del msg['chat_state']
>>> msg
<message />
2011-02-24 12:10:29 -05:00
Nathan Fritz
2e2e16e281 fixes to ping: auto-ping off by default, fixed ping-time of zero bug, fixed class name mismatch 2011-02-15 15:24:58 -08:00
Lance Stout
75584d7ad7 Remap old method names in a better way.
This should prevent some reference cycles that will cause garbage
collection issues.
2011-02-14 13:49:43 -05:00
Lance Stout
c4b1212c44 Updated XEP-0199 plugin.
Now has docs and uses the new plugin format.
2011-02-11 00:30:45 -05:00
Nathan Fritz
3463bf46c6 added option to return false on ping error, added ping example 2011-02-10 13:45:35 -08:00
Lance Stout
13a01beb07 Fix same error for get_info default behaviour. 2011-02-09 09:12:44 -05:00
Lance Stout
145f577bde Fix get_items default behaviour. 2011-02-09 08:58:00 -05:00
Florent Le Coz
72ead3d598 Replace the print statement by a log.debug call
This print syntax is deprecated in python3, so
the plugin was working only with python2
2011-02-09 10:02:14 +08:00
Florent Le Coz
4b71fba64c Fix the xep_0009 import (no more relatives)
Also, remove trailing spaces in all files
of this plugin
2011-02-09 10:02:14 +08:00
Stefan de Konink
1ed06bebcd This fixes the configuration stuff, because type is form not submit with setNodeConfiguration. 2011-02-07 23:55:46 +08:00
Lance Stout
aa1996eba6 Fixed failing tests from new XEP-0009 plugin 2011-02-07 10:18:15 -05:00
Nathan Fritz
683f717cf7 fixed merge 2011-02-05 04:54:52 -08:00
Lance Stout
5313338c3a Fixes for XEP-0202 2011-01-31 15:40:00 -05:00
Florent Le Coz
b4004cd4d6 xep_0045: fix the 'to' value when configuring room 2011-01-27 09:34:32 +08:00
Lance Stout
0c8a8314b2 Cleanup for stanzabase.
Use stanza.values instead of _get/set_stanza_values where used.

ElementBase stanzas can now use .tag

May use class method tag_name() for stanza classes.

ElementBase now has .clear() method.
2011-01-26 11:27:41 -05:00
Stefan de Konink
c3be6ea0b2 My hunch is that these should also be updated. 2011-01-23 02:08:29 +08:00
Lance Stout
acc2d071ac Fix disco add_item.
If no JID is specified for the item, use xmpp.boundjid.full.
2011-01-19 17:27:53 -05:00
Lance Stout
f1db2fc156 Fix error in disco add_item.
None values were not being treated properly.
2011-01-19 12:08:28 -05:00
Lance Stout
a2891d7608 Fix how disco plugin looks up info and items for clients. 2011-01-15 10:08:35 -05:00
Dann Martens
4be6482ff3 Fixed 'nil' bug in unmarshalling. 2011-01-13 13:42:01 +01:00
Dann Martens
0a3a7b5a70 Removed binding XML namespace experiments. 2011-01-13 11:37:58 +01:00