Send the pubsub unsubscription notification to the client. * Channel can be NULL: this is useful when the client sends a mass * unsubscribe command but there are no channels to unsubscribe from: we * still send a notification. */
| 80 | * unsubscribe command but there are no channels to unsubscribe from: we |
| 81 | * still send a notification. */ |
| 82 | void addReplyPubsubUnsubscribed(client *c, robj *channel) { |
| 83 | if (c->resp == 2) |
| 84 | addReply(c,shared.mbulkhdr[3]); |
| 85 | else |
| 86 | addReplyPushLen(c,3); |
| 87 | addReply(c,shared.unsubscribebulk); |
| 88 | if (channel) |
| 89 | addReplyBulk(c,channel); |
| 90 | else |
| 91 | addReplyNull(c); |
| 92 | addReplyLongLong(c,clientSubscriptionsCount(c)); |
| 93 | } |
| 94 | |
| 95 | /* Send the pubsub pattern subscription notification to the client. */ |
| 96 | void addReplyPubsubPatSubscribed(client *c, robj *pattern) { |
no test coverage detected