fiorix/txredisapi — pull request #50 by twang817 (2013-06-21 22:55:55+00:00)
Title: Fix message and pmessage

As close as I can tell, subscribe and psubscribe are broken in the SubscriberProtocol.

When a subscribe/psubscribe happens, the redis server will first respond with a 'subscribe' message that confirms the channel that you subscribed to.

From then on, a subscribe will receive messages, and a psubscribe will receive pmessages.

A message will be in reply[-3], whereas a pmessage will be in reply[-4], so I updated the replyReceived callback for these two.

Furthermore, the SubscriberProtocol currently sends the initial subscribe message to the messageReceived callback as well as puts it on the replyQueue. From the arguments of the messageReceived callback, I assume that this is unintended behavior; therefore, the new code places it only on the replyQueue and does not forward it onward to the subscriber.