X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-info.c;h=03127b229f4008d203ce0fd700d9ca4173250043;hb=24f956abf7d6972cc3503a6c60c2ac83e6a84b91;hp=7bb453df67cc853addca41e34861201cba2b7982;hpb=6fc53558ed2117e5dd4e6bd1e9fb595bba67aa79;p=ngircd-alex.git diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 7bb453df..03127b22 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -138,7 +138,7 @@ who_flags_qualifier(CLIENT *Client, const char *chan_user_modes, static bool IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps) { - bool is_visible, is_member, is_ircop; + bool is_visible, is_member, is_ircop, is_oper; CL2CHAN *cl2chan; char flags[10]; CLIENT *c; @@ -148,9 +148,10 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps) assert( Chan != NULL ); is_member = Channel_IsMemberOf(Chan, Client); + is_oper = Client_HasMode(Client, 'o'); /* Secret channel? */ - if (!is_member && Channel_HasMode(Chan, 's')) + if (!is_member && !is_oper && Channel_HasMode(Chan, 's')) return IRC_WriteStrClient(Client, RPL_ENDOFWHO_MSG, Client_ID(Client), Channel_Name(Chan)); @@ -163,7 +164,7 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps) continue; is_visible = !Client_HasMode(c, 'i'); - if (is_member || is_visible) { + if (is_member || is_visible || is_oper) { memset(flags, 0, sizeof(flags)); if (Client_HasMode(c, 'a')) @@ -340,6 +341,7 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c) strlcat(str, " ", sizeof(str)); who_flags_qualifier(Client, Channel_UserModes(chan, c), + str, sizeof(str)); strlcat(str, Channel_Name(chan), sizeof(str)); if (strlen(str) > (COMMAND_LEN - CHANNEL_NAME_LEN - 4)) { @@ -406,7 +408,7 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c) /* Local client and requester is the user itself or an IRC Op? */ if (Client_Conn(c) > NONE && - (from == c || (!Conf_MorePrivacy && Client_HasMode(from, 'o')))) { + (from == c || Client_HasMode(from, 'o'))) { /* Client hostname */ if (!IRC_WriteStrClient(from, RPL_WHOISHOST_MSG, Client_ID(from), Client_ID(c), @@ -557,7 +559,15 @@ IRC_INFO(CLIENT * Client, REQUEST * Req) NGIRCd_Version)) return DISCONNECTED; -#if defined(__DATE__) && defined(__TIME__) +#if defined(BIRTHDATE) + char t_str[60]; + time_t t = BIRTHDATE; + (void)strftime(t_str, sizeof(t_str), "%a %b %d %Y at %H:%M:%S (%Z)", + localtime(&t)); + snprintf(msg, sizeof(msg), "Birth Date: %s", t_str); + if (!IRC_WriteStrClient(Client, RPL_INFO_MSG, Client_ID(prefix), msg)) + return DISCONNECTED; +#elif defined(__DATE__) && defined(__TIME__) snprintf(msg, sizeof(msg), "Birth Date: %s at %s", __DATE__, __TIME__); if (!IRC_WriteStrClient(Client, RPL_INFO_MSG, Client_ID(prefix), msg)) return DISCONNECTED; @@ -885,16 +895,16 @@ IRC_STATS( CLIENT *Client, REQUEST *Req ) list = Class_GetList(CLASS_GLINE); else list = Class_GetList(CLASS_KLINE); - list_item = Lists_GetFirst(list); - while (list_item) { - if (!IRC_WriteStrClient(from, RPL_STATSXLINE_MSG, + list_item = Lists_GetFirst(list); + while (list_item) { + if (!IRC_WriteStrClient(from, RPL_STATSXLINE_MSG, Client_ID(from), query, Lists_GetMask(list_item), Lists_GetValidity(list_item), Lists_GetReason(list_item))) - return DISCONNECTED; - list_item = Lists_GetNext(list_item); - } + return DISCONNECTED; + list_item = Lists_GetNext(list_item); + } break; case 'L': /* Link status (servers and user links) */ if (!Op_Check(from, Req))