From 4057b7dd5852575a415cca8f465b4d419dcbdf9d Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Sun, 23 Jun 2013 16:24:30 +0100 Subject: Now inbound_cap_ls() can enable extensions when a bouncer uses a namespace for the extension server-time. --- src/common/hexchat.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common/hexchat.h') diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 1a759f14..ca9f9c44 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -593,6 +593,7 @@ typedef struct server unsigned int have_idmsg:1; /* freenode's IDENTIFY-MSG */ unsigned int have_accnotify:1; /* cap account-notify */ unsigned int have_extjoin:1; /* cap extended-join */ + unsigned int have_server_time:1; /* cap server-time */ unsigned int have_sasl:1; /* SASL capability */ unsigned int have_except:1; /* ban exemptions +e */ unsigned int have_invite:1; /* invite exemptions +I */ -- cgit 1.4.1 From dcdb11a78bace7bb4ec36e3c79ea8418a7f4ccfd Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Mon, 24 Jun 2013 20:13:18 +0100 Subject: Added preferences options to enable the server-time extension when available. (Internationalization messages missing.) --- src/common/cfgfiles.c | 2 ++ src/common/hexchat.h | 1 + src/common/inbound.c | 10 ++++------ src/fe-gtk/setup.c | 5 +++-- 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src/common/hexchat.h') diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 20f1e848..008a0787 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -507,6 +507,7 @@ const struct prefs vars[] = {"irc_auto_rejoin", P_OFFINT (hex_irc_auto_rejoin), TYPE_BOOL}, {"irc_ban_type", P_OFFINT (hex_irc_ban_type), TYPE_INT}, + {"irc_cap_server_time", P_OFFINT (hex_irc_cap_server_time), TYPE_BOOL}, {"irc_conf_mode", P_OFFINT (hex_irc_conf_mode), TYPE_BOOL}, {"irc_extra_hilight", P_OFFSET (hex_irc_extra_hilight), TYPE_STR}, {"irc_hide_version", P_OFFINT (hex_irc_hide_version), TYPE_BOOL}, @@ -748,6 +749,7 @@ load_default_config(void) prefs.hex_text_thin_sep = 1; prefs.hex_text_wordwrap = 1; prefs.hex_url_grabber = 1; + prefs.hex_irc_cap_server_time = 0; /* NUMBERS */ prefs.hex_away_size_max = 300; diff --git a/src/common/hexchat.h b/src/common/hexchat.h index ca9f9c44..074d5a22 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -215,6 +215,7 @@ struct hexchatprefs unsigned int hex_irc_wallops; unsigned int hex_irc_who_join; unsigned int hex_irc_whois_front; + unsigned int hex_irc_cap_server_time; unsigned int hex_net_auto_reconnect; unsigned int hex_net_auto_reconnectonfail; unsigned int hex_net_proxy_auth; diff --git a/src/common/inbound.c b/src/common/inbound.c index 8547a70a..2645c438 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -1665,14 +1665,12 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str, */ if (!strcmp (extension, "znc.in/server-time")) { - strcat (buffer, "znc.in/server-time"); - strcat (buffer, " "); + strcat (buffer, "znc.in/server-time "); } - else if (!strcmp (extension, "server-time")) + if (prefs.hex_irc_cap_server_time + && !strcmp (extension, "server-time")) { - /* ignore. it is best to have server-time explicitly enabled or have - * a option in the preferences (or per server). - */ + strcat (buffer, "server-time "); } /* if the SASL password is set AND auth mode is set to SASL, request SASL auth */ diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index 391004ee..2c5b982f 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -522,12 +522,13 @@ static const setting advanced_settings[] = "Otherwise, include color information if the CONTROL key is held down " "while selecting."), 0, 0}, - {ST_HEADER, N_("Miscellaneous"),0,0,0}, + {ST_HEADER, N_("Miscellaneous"), 0, 0, 0}, {ST_ENTRY, N_("Real name:"), P_OFFSETNL(hex_irc_real_name), 0, 0, sizeof prefs.hex_irc_real_name}, #ifdef WIN32 - {ST_ENTRY, N_("Alternative fonts:"), P_OFFSETNL(hex_text_font_alternative), "Separate multiple entries with commas without spaces before or after.", 0, sizeof prefs.hex_text_font_alternative}, + {ST_ENTRY, N_("Alternative fonts:"), P_OFFSETNL(hex_text_font_alternative), N_("Separate multiple entries with commas without spaces before or after."), 0, sizeof prefs.hex_text_font_alternative}, #endif {ST_TOGGLE, N_("Display lists in compact mode"), P_OFFINTNL(hex_gui_compact), N_("Use less spacing between user list/channel tree rows."), 0, 0}, + {ST_TOGGLE, N_("Use server time if supported"), P_OFFINTNL(hex_irc_cap_server_time), N_("Display timestamps obtained from server if it supports the time-server extension."), 0, 0}, {ST_TOGGLE, N_("Automatically reconnect to servers on disconnect"), P_OFFINTNL(hex_net_auto_reconnect), 0, 0, 1}, {ST_NUMBER, N_("Auto reconnect delay:"), P_OFFINTNL(hex_net_reconnect_delay), 0, 0, 9999}, {ST_NUMBER, N_("Auto join delay:"), P_OFFINTNL(hex_irc_join_delay), 0, 0, 9999}, -- cgit 1.4.1