cburschka / cadence

A strophe.js-powered XMPP web client for chatrooms.
7 stars 2 forks source link

Timing problem when switching rooms #374

Closed cburschka closed 8 years ago

cburschka commented 8 years ago

Right now, joining another room while you're already inside a room will cause you to be instantly kicked out of the second room.

(Also, you will then see the output of the /list command twice.)

cburschka commented 8 years ago

Okay, timeline.

cburschka commented 8 years ago

This makes it clear that leaveRoom()'s dependency on xmpp.room.current is something of an anti-pattern. Ideally, the caller should decide whether .prejoin() must be called.

cburschka commented 8 years ago

Especially since leaveRoom is called by three functions (setRoom, /part and /configure), and only /part leaves the current room.