This introduces a new command called "handshake" in the weechat relay protocol.
It should be sent by the client before the "init" command, to negotiate the way
to authenticate with a password.
3 new options are added:
* relay.network.auth_password
* relay.network.hash_iterations
* relay.network.nonce_size
Colors changed:
* relay.color.status_active: lightblue -> green
* relay.color.status_auth_failed: lightred -> lightmagenta
* relay.color.status_connecting: yellow -> white
* relay.color.status_waiting_auth: brown -> yellow
The color relay.color.status_disconnected remains lightred by default.
Now the status "waiting_auth" is used and displayed in the relay buffer.
When a client connects, there are now 2 messages (except for irc protocol if
there's no password required):
relay: new client on port 9000: 1/weechat/1.2.3.4 (waiting auth)
relay: client 1/weechat/1.2.3.4 authenticated
If the authentication fails, the messages are:
relay: new client on port 9000: 1/weechat/1.2.3.4 (waiting auth)
=!= relay: authentication failed with client 1/weechat/1.2.3.4
configure.ac defines this to /usr/share/weechat, which means scripts can
load from this directory as a fallback for $HOME/.weechat/, but cmake
defines this instead as /usr/share, which means system-installed
fallback scripts would need to be installed to /usr/share/python/foo.py
instead, and that's completely insane!
Fix this discrepancy by creating a cmake define specifically for
WEECHAT_SHAREDIR based on the datarootdir, just like autotools does it.
This is how other build systems (e.g. autotools) see the variable, and
cmake's own GNUInstallDirs defines the same. It more clearly describes
what this setting does vs. the ambiguous "sharedir".
The memory leak was caused by a bug in function setlocale on FreeBSD:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243195
The fix is the following:
* Remove the calls to setlocale when formatting the result.
* The function snprintf is still called, and then is now locale dependent,
for example in French the decimal separator is a comma instead of a dot.
* A new function calc_sanitize_decimal_number is introduced to "sanitize" a
decimal number: keep only the decimal separator (replace it by a dot) and
remove any other separator found.
Unit tests are added on these functions:
* calc_sanitize_decimal_number
* calc_format_result
The evaluation allows to use different sort for the bar items, for example with
such value:
${if:${bar_item.name}==buflist?number:short_name}
This sorts by number on the first bar item and by short name on the two other
bar items.