Commit graph

496 commits

Author SHA1 Message Date
Lance Stout
3918ddb075 Merge branch 'develop' into stream_features 2011-08-03 17:02:33 -07:00
Lance Stout
d4091dbde6 Integrate a modified version of Dave Cridland's Suelta SASL library. 2011-08-03 17:00:51 -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
5efb170e1d Added wait parameter to disconnect.
If wait=True, then the disconnect call will block until
the send queue has emptied.

WARNING: Using wait=True when more stanzas are being added to the
queue than can be processed such that the queue is never empty
will cause the disconnect call to block indefinitely without actually
disconnecting.
2011-07-04 18:47:57 -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
0224d028e7 SASL failure event now includes the failure stanza.
Broke SASL stanzas into separate files.

Fixed typo in feature_bind.
2011-07-02 23:09:29 -07:00
Lance Stout
540d749695 Fix ordering bug when retrieving an error condition. 2011-07-02 22:50:31 -07:00
Lance Stout
219df582da It isn't 2010 anymore.
I keep forgetting to update the copyright on new code.
2011-07-02 22:49:34 -07:00
Lance Stout
b898b14b77 Use a set to track negotiated features.
Added guards to prevent renegotiating STARTTLS or SASL in cases where
servers don't behave properly.
2011-07-02 22:30:55 -07:00
Lance Stout
fba235a801 Simplify SASL mech registration.
Moved SASL registration completely to the feature plugin, instead of
keeping a portion of it in ClientXMPP.
2011-07-02 21:57:50 -07:00
Lance Stout
b0297af38d Finish cleaning up stream feature organization.
Fixed missing references that weren't caught due to leftover pyc
file allowing tests to keep working when they shouldn't have.
2011-07-02 21:43:02 -07:00
Lance Stout
04def6d925 Merge branch 'develop' into stream_features 2011-07-01 15:19:37 -07:00
Lance Stout
2a2ac73845 So using sys.excepthook to catch errors only works once.
The error bubbles through the event processing loop, breaking it and
hanging the application.

Instead, there is now a .exception(e) method on XMLStream which may
be overridden or reassigned that will receive all unhandled exceptions
(read: not XMPPError) from event and stream handlers.
2011-07-01 15:18:10 -07:00
Lance Stout
634f5d691b Continued reorganization and streamlining. 2011-07-01 14:45:55 -07:00
Lance Stout
754ac5092a Reorganize features into plugins. 2011-06-30 15:40:22 -07:00
Lance Stout
9ed972ffeb Fix SASL mechanism selection bug.
ANONYMOUS was being treated as PLAIN, mechanism was being chosen
purely from supported mechanisms, not those provided by the server.

Broke nested handler methods into top-level methods.
2011-06-29 14:05:27 -07:00
Lance Stout
3b1f3fddf0 Reorganized stream level stanzas. 2011-06-28 11:06:44 -07:00
Lance Stout
fa716457a5 Merge branch 'develop' into stream_features 2011-06-20 16:27:55 -07:00
Lance Stout
d8d9e8df16 Fix stanza clobbering when replying to errors.
If a stanza handler raised an exception, the exception was processed
and replied by the modified stanza, not a stanza with the original
content.

A copy is now made before handler processing, and if an exception occurs
it is the copy that processes the exception using the original content.
2011-06-20 16:25:56 -07:00
Lance Stout
4efd41f1ba Merge branch 'develop' into stream_features 2011-06-15 10:56:33 -07:00
Lance Stout
58aa944a5e Fix another roster issue.
Caused by same issue of a JID being in the roster, but with an
incomplete entry.
2011-06-15 10:55:36 -07:00
Lance Stout
5d11ab269d Merge branch 'develop' into stream_features 2011-06-14 14:10:52 -07:00
Lance Stout
dd41a85efc Fix issue with components and roster.
If the roster contained a JID, but not any resource presence data, then
an error would occur when accessing self.roster[jid]['presence'].
2011-06-14 14:03:54 -07:00
Lance Stout
7a60e4b458 Merge branch 'develop' into stream_features 2011-06-10 15:14:51 -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
823c13707d Merge branch 'develop' into stream_features 2011-06-08 10:02:22 -07:00
Lance Stout
4266ee0fa4 Fix XEP-0050 issue with Unicode string type checking. 2011-06-08 10:00:28 -07:00
Lance Stout
3a62908703 Send component handshake immediately. 2011-06-08 10:00:01 -07:00
Lance Stout
8f9100c762 Merge branch 'develop' into stream_features 2011-06-01 15:17:13 -07:00
Lance Stout
1469323350 Cache stanza if sending fails.
The stanza will be sent first once the send queue is reactivated
after session start.

Stanzas sent by skipping the queue will not be cached.
2011-06-01 15:10:44 -07:00
Lance Stout
83a73ac9b7 Merge branch 'develop' into stream_features
Conflicts:
	sleekxmpp/clientxmpp.py
2011-05-31 11:05:54 -07:00
Lance Stout
a81162edd2 Apply connection backoff to reconnect attempts.
Backoff was only being done for the initial connection attempt
before. Now any reconnection will start with a minimum 1 sec
delay which will approximately double between attempts.
2011-05-31 10:55:15 -07:00
Lance Stout
8080b4cae2 Cleanup logging and exception handling.
The syntax and attribute errors raised during a disconnect/reconnect
attempt are now caught and produce nicer log messages.
2011-05-31 10:23:05 -07:00
Lance Stout
1735c194cd Don't use the send queue for stream initialization.
Use the parameter now=True to skip the queue when
sending Iq stanzas, or using xmpp.send().
2011-05-27 17:00:57 -07:00
Lance Stout
6997b2fbf8 Fix typo for SSL certificate use. 2011-05-27 16:39:45 -07:00
Lance Stout
b81ab97900 Add exponential backoff to connection attempts.
Delay will approximately double between attempts (random variation).

See issue #67.
2011-05-27 14:42:40 -07:00
Lance Stout
384e1a92b7 Added support for testind disconnect errors. 2011-05-27 11:01:30 -07:00
Lance Stout
9851a2a057 Merge branch 'develop' into stream_features 2011-05-20 21:41:44 -04:00
Lance Stout
6b274a2543 Fix double roster entry issue with Unicode.
JIDs with Unicode values were being encoded by the JID class
instead of leaving them as just Unicode strings.

It may still be a good idea to use

    from __future__ import unicode_literals

pretty much everywhere though.

Fixes issue #88.
2011-05-20 16:48:13 -04:00
Lance Stout
a269be485f Merge branch 'develop' into stream_features 2011-05-20 13:46:46 -04:00