Send the pubsub pattern unsubscription notification to the client. * Pattern can be NULL: this is useful when the client sends a mass * punsubscribe command but there are no pattern to unsubscribe from: we * still send a notification. */
| 109 | * punsubscribe command but there are no pattern to unsubscribe from: we |
| 110 | * still send a notification. */ |
| 111 | void addReplyPubsubPatUnsubscribed(client *c, robj *pattern) { |
| 112 | if (c->resp == 2) |
| 113 | addReply(c,shared.mbulkhdr[3]); |
| 114 | else |
| 115 | addReplyPushLen(c,3); |
| 116 | addReply(c,shared.punsubscribebulk); |
| 117 | if (pattern) |
| 118 | addReplyBulk(c,pattern); |
| 119 | else |
| 120 | addReplyNull(c); |
| 121 | addReplyLongLong(c,clientSubscriptionsCount(c)); |
| 122 | } |
| 123 | |
| 124 | /*----------------------------------------------------------------------------- |
| 125 | * Pubsub low level API |
no test coverage detected