Add verbosity toggle
Add a switch to turn off some of the unnecessary messages in control channel. Fixes: #207 Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
This commit is contained in:
parent
9466079361
commit
7dd4bee918
3
README
3
README
|
@ -184,6 +184,9 @@ This section describes options available through "account set" bitlbee command
|
|||
"Foo.*,Bar.A" will exclude all channels from server "Foo" and channel "A"
|
||||
from server "Bar".
|
||||
|
||||
- verbose (type: boolean; default: off)
|
||||
Show more protocol-related messages in control channel.
|
||||
|
||||
Debugging
|
||||
---------
|
||||
You can enable extra debug output for bitlbee-discord, by setting BITLBEE_DEBUG
|
||||
|
|
|
@ -868,7 +868,9 @@ gboolean discord_parse_message(struct im_connection *ic, gchar *buf, guint64 siz
|
|||
dd->heartbeat_timeout_id = 0;
|
||||
}
|
||||
} else if (op == OPCODE_RECONNECT) {
|
||||
imcb_log(ic, "Reconnect requested");
|
||||
if (set_getbool(&ic->acc->set, "verbose")) {
|
||||
imcb_log(ic, "Reconnect requested");
|
||||
}
|
||||
discord_soft_reconnect(ic);
|
||||
} else if (op == OPCODE_INVALID_SESSION) {
|
||||
imcb_error(ic, "Invalid session, reconnecting");
|
||||
|
|
|
@ -121,7 +121,9 @@ static gboolean discord_ws_heartbeat_timeout(gpointer data, gint fd,
|
|||
b_input_condition cond)
|
||||
{
|
||||
struct im_connection *ic = data;
|
||||
imcb_log(ic, "Heartbeat timed out, reconnecting...");
|
||||
if (set_getbool(&ic->acc->set, "verbose")) {
|
||||
imcb_log(ic, "Heartbeat timed out, reconnecting...");
|
||||
}
|
||||
discord_soft_reconnect(ic);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -113,6 +113,8 @@ static void discord_init(account_t *acc)
|
|||
s = set_add(&acc->set, "friendship_mode", "on", set_eval_bool, acc);
|
||||
s->flags |= ACC_SET_OFFLINE_ONLY;
|
||||
|
||||
s = set_add(&acc->set, "verbose", "off", set_eval_bool, acc);
|
||||
|
||||
acc->flags |= ACC_FLAG_AWAY_MESSAGE;
|
||||
acc->flags |= ACC_FLAG_STATUS_MESSAGE;
|
||||
|
||||
|
@ -155,7 +157,9 @@ void discord_soft_reconnect(struct im_connection *ic)
|
|||
{
|
||||
discord_data *dd = ic->proto_data;
|
||||
|
||||
imcb_log(ic, "Performing soft-reconnect");
|
||||
if (set_getbool(&ic->acc->set, "verbose")) {
|
||||
imcb_log(ic, "Performing soft-reconnect");
|
||||
}
|
||||
discord_ws_cleanup(dd);
|
||||
dd->reconnecting = TRUE;
|
||||
discord_do_login(ic);
|
||||
|
|
Loading…
Reference in New Issue