pusher/pusher-java-client — pull request #49 by roccozanni (2014-12-11 11:17:42+00:00)
Title: Allow unsubscribe while disconnected

**Allow unsubscribe while 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.

**Ignore unsubscribe request from not subscribed channels**

Just a small improvement to improve tolerancy against developer mistakes. If for any reason a developer invoke `Pusher.unsubscribe()` twice with the same channel name, the program will not break with an unhandled Exception