There is a bug in WeeChat when hdata is null, which happens when the
hotlist is empty (meaning all buffers are read). Our websocket callback
machinery expects every command with id to return data, so this code in
current versions of WeeChat will lead to a slow leak. But I think lots
of things in our code will do this already so I'm not entirely sure it's
too problematic to let this patch go by.
We could use infolists instead of hdata, but that is cumbersome to parse
and less performant for WeeChat, and sends more data over the wire.
I propose we make a separate attempt at cleaning up the callbacks. Since
we store time on them we could have a cleanuptask that looks through
them and deletes old callbacks. Maybe @dcormier could have a look?
Usage: fetchConfValue('weechat.look.buffer_time_format')
will result in models.wconfig['weechat.look.buffer_time_format'] to be
set when the result returns from WeeChat.
Could maybe be extended to also call a callback when it's available if
needed.
Instead of waiting for the websocket to really close, which can take a
long time because network latency, weechat inresponsiveness etc, we just
set our status to disconnected when user wants to disconnect, and we let
the websocket handle the close in its own time in the background.
If the user wants to reconnect this means there will be a new websocket
connection before the old one has failed, but this works just fine.
Requires turning IrcUtils into an Angular service, because the global variable
trick won't work with use strict.
Reuse is still easily possible by removing the angular wrapping around it.