Caleb Mingle e547c2a094 mqtt: fix connfail callback
I've not been able to get the mqtt `connfail` callback to work.

I'm consistently receiving `method not supported` errors:
```
application.lua:53: method not supported
stack traceback:
        [C]: in function 'on'
        application.lua:53: in main chunk
        [C]: in function 'dofile'
        init.lua:18: in function <init.lua:6>
```

Example code:
```
function on_connection_failed(client, reason)
    print("mqtt connection failed: " .. reason)
end

m:on("connfail", on_connection_failed)
```

I believed this to be caused by the incorrect length comparison for `connfail`
that is updated here.

Once I changed that, the error went away, however the callback was never called.

I believe the callback was never called because of an incorrect assignment.

However, I saw this somewhat confusing description in the docs so this
assignment may be expected?
> The second (failure) callback aliases with the "connfail" callback available through :on(). (The "offline" callback is only called after an already established connection becomes closed. If the connect() call fails to establish a connection, the callback passed to :connect() is called and nothing else.)
2020-08-11 17:20:17 +01:00
..
2020-06-09 22:26:06 +02:00
2019-07-23 18:47:18 +03:00
2019-07-23 18:47:18 +03:00
2020-07-07 14:35:37 +01:00
2020-06-09 22:26:52 +02:00
2020-08-11 17:20:17 +01:00
2020-06-09 22:26:52 +02:00
2019-07-23 18:47:18 +03:00
2019-07-23 18:47:18 +03:00
2019-07-23 18:47:18 +03:00
2019-07-23 18:47:18 +03:00
2019-07-23 18:47:18 +03:00
2019-07-23 18:47:18 +03:00
2020-06-10 02:14:29 +01:00