pusher/pusher-java-client — pull request #48 by roccozanni (2014-12-11 09:56:04+00:00)
Title: Allow unsubscribe when disconnected

Actually `Pusher` class throws an Exception when trying to unsubscribe from a Channel and the connection state is not CONNECTED. This can lead to issues implementing automatic reconnection because when `Pusher.connect()` is invoked, the library tries to re-subscribe to previouslly created channels, basically subscribing to a channel which nobody is interested to anymore.

With the proposed change, if the status is not CONNECTED the channel is only removed from the map and it will not re-subscribed again at the next connection attempt.

I also stopped throwing Exception on unsubscribe request from not subscribed channel. From the library POV it's just a no-op, and it's more tolerant to developer mistakes.