Skip to content

Commit

Permalink
Merge pull request #29 from abusesa/fix-muc-join
Browse files Browse the repository at this point in the history
idiokit.xmpp.muc: Add timeout to join_room()
  • Loading branch information
ecode-work authored Nov 29, 2016
2 parents e032cf1 + 489fec6 commit abbfd52
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.8.1 (2016-XX-YY)

### Fixes

* Add timeout to xmpp.muc.join() for case where connection dies while client is waiting for presence messages sent by server ([#29](https://github.com/abusesa/idiokit/pull/29))

## 2.8.0 (2016-06-22)

### Features
Expand Down
2 changes: 1 addition & 1 deletion idiokit/idiokit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ._selectloop import sleep, asap, iterate
from .values import Value

__version__ = "2.8.0"
__version__ = "2.8.1"

NULL = Value(None)

Expand Down
7 changes: 5 additions & 2 deletions idiokit/xmpp/muc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import random

from .. import idiokit
from .. import idiokit, timer
from ..xmlcore import Element
from .core import STANZA_NS, XMPPError
from .jid import JID
Expand Down Expand Up @@ -65,7 +65,10 @@ def join_room(jid, xmpp, output, password=None, history=False):
yield xmpp.core.presence(x, to=JID(jid))

while True:
element = yield output.next()
try:
element = yield timer.timeout(120.0, output.next())
except timer.Timeout:
raise MUCError("timeout while joining room {0!r}".format(unicode(jid.bare())))

parsed = parse_presence(element, jid)
if parsed is None:
Expand Down

0 comments on commit abbfd52

Please # to comment.