snake unsubscription fixes
This commit is contained in:
		@@ -192,7 +192,7 @@ namespace ix
 | 
			
		||||
                    {
 | 
			
		||||
                        if (!handleUnsubscriptionResponse(data))
 | 
			
		||||
                        {
 | 
			
		||||
                            invokeErrorCallback("Error processing subscribe response", msg->str);
 | 
			
		||||
                            invokeErrorCallback("Error processing unsubscribe response", msg->str);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    else if (action == "rtm/unsubscribe/error")
 | 
			
		||||
 
 | 
			
		||||
@@ -287,12 +287,18 @@ namespace snake
 | 
			
		||||
        const AppConfig& appConfig,
 | 
			
		||||
        const nlohmann::json& pdu)
 | 
			
		||||
    {
 | 
			
		||||
        // extract subscription_id
 | 
			
		||||
        auto body = pdu["body"];
 | 
			
		||||
        auto subscriptionId = body["subscription_id"];
 | 
			
		||||
 | 
			
		||||
        state->redisClient().stop();
 | 
			
		||||
 | 
			
		||||
        nlohmann::json response = {
 | 
			
		||||
            {"action", "rtm/unsubscribe/ok"},
 | 
			
		||||
            {"id", pdu.value("id", 1)},
 | 
			
		||||
            {"body", {}}
 | 
			
		||||
            {"body", {
 | 
			
		||||
                {"subscription_id", subscriptionId}
 | 
			
		||||
            }}
 | 
			
		||||
        };
 | 
			
		||||
        ws->sendText(response.dump());
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user