int mqttmessage_setIsRetained()

in src/mqtt_message.c [332:348]


int mqttmessage_setIsRetained(MQTT_MESSAGE_HANDLE handle, bool retainMsg)
{
    int result;
    /* Codes_SRS_MQTTMESSAGE_07_024: [If handle is NULL then mqttmessage_setIsRetained shall return a non-zero value.] */
    if (handle == NULL)
    {
        LogError("Invalid Parameter handle: %p.", handle);
        result = MU_FAILURE;
    }
    else
    {
        /* Codes_SRS_MQTTMESSAGE_07_025: [mqttmessage_setIsRetained shall store the retainMsg value in the MQTT_MESSAGE_HANDLE handle.] */
        handle->isMessageRetained = retainMsg;
        result = 0;
    }
    return result;
}