Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

idiokit.xmpp.muc: Add timeout to join_room() #29

Merged
3 commits merged into from
Nov 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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