Ejemplo n.º 1
0
void SetLogMsgUser(Cfg *cfg, HostSub *hostSub, THosts *hosts, LogMsg *logmsg)
{
	Host	*host = hostSub->addr.IsEnabled() ? hosts->GetHostByAddr(hostSub) :
		 hosts->GetHostByName(hostSub);

	LogHost	log_host;
	log_host.uid  = hostSub->u.userName;
	log_host.addr = hostSub->addr.S();
	log_host.host = hostSub->u.hostName;

	if (host && IsSameHost(hostSub, &host->hostSub)
		 || GetUserNameDigestField(hostSub->u.userName) &&
		 	(host = cfg->priorityHosts.GetHostByName(hostSub))) {
		log_host.gname = host->groupName;
		log_host.nick  = host->nickName;
		if (!hostSub->addr.IsEnabled()) {
			log_host.addr = host->hostSub.addr.S();
		}
	}

	if (!log_host.nick) {
		log_host.nick = hostSub->u.userName;
	}

	logmsg->host.push_back(log_host);
}
Ejemplo n.º 2
0
/*
	ログ記録/ウィンドウ表示用の HostEntry表示文字列
*/
void MakeListString(Cfg *cfg, HostSub *hostSub, THosts *hosts, char *buf, BOOL is_log)
{
    Host	*host;

    if ((host = hosts->GetHostByAddr(hostSub)) && IsSameHost(hostSub, &host->hostSub)
            || GetUserNameDigestField(hostSub->userName) &&
            (host = cfg->priorityHosts.GetHostByName(hostSub)))
        MakeListString(cfg, host, buf, is_log);
    else {
        Host	host;

        memset(&host, 0, sizeof(host));
        host.hostSub = *hostSub;
        MakeListString(cfg, &host, buf, is_log);
    }
}