#define TOK_PONG "Z"
#define TOK_POST "POST"
#define TOK_PRIVMSG "P"
-#define TOK_PRIVS "PR"
+#define TOK_PRIVS "PRIVS"
#define TOK_PROTO "PROTO"
#define TOK_QUIT "Q"
#define TOK_REHASH "REHASH"
irc_topic(struct userNode *service, struct userNode *who, struct chanNode *what, const char *topic)
{
- int type = 4, host_in_topic = 0, hasident = 0;
- const char *hstr, *tstr;
+ int type = 4, host_in_topic = 0, hasident = 0, hhtype = 0;
+ const char *hstr, *tstr, *hhstr, *htstr;
char *host, *hostmask;
char shost[MAXLEN];
char sident[MAXLEN];
tstr = conf_get_data("server/type", RECDB_QSTRING);
hstr = conf_get_data("server/host_in_topic", RECDB_QSTRING);
+ hhstr = conf_get_data("server/hidden_host", RECDB_QSTRING);
+ htstr = conf_get_data("server/hidden_host_type", RECDB_QSTRING);
if(tstr)
type = atoi(tstr);
else
type = 4;/* default to 040 style topics */
+ if (htstr)
+ hhtype = atoi(htstr);
if (hstr) {
- if (IsFakeHost(who))
+ if (IsHiddenHost(who) && IsFakeHost(who))
safestrncpy(shost, who->fakehost, sizeof(shost));
- else if (IsSetHost(who)) {
+ else if (IsHiddenHost(who) && IsSetHost(who)) {
hostmask = strdup(who->sethost);
if ((host = (strrchr(hostmask, '@')))) {
hasident = 1;
safestrncpy(sident, who->ident, sizeof(shost));
safestrncpy(shost, host, sizeof(shost));
+ } else if (IsHiddenHost(who) && (hhtype == 1) && who->handle_info && hhstr) {
+ snprintf(shost, sizeof(shost), "%s.%s", who->handle_info->handle, hhstr);
+ } else if (IsHiddenHost(who) && (hhtype == 2) && who->crypthost[0]) {
+ safestrncpy(shost, who->crypthost, sizeof(shost));
} else
safestrncpy(shost, who->hostname, sizeof(shost));
break;
}
case '%': {
+ ctype = 1;
for(parm = mysep(&argv[next], " "); /* parm = first param */
parm; /* While param is not null */
parm = mysep(&argv[next], " ") /* parm = next param */
)
{
- switch (parm[0]) {
- case '%': {
- ctype = 1;
- break;
- }
- case '~': {
- ctype = 2;
- break;
- }
- default: {
- break;
- }
- }
+ if (0 == strcmp("~", parm))
+ ctype = 2;
if (ctype == 1) {
if (bcheck == 0) {
/* strip % char off start of very first ban */
* Ghost response to a KILL we sent out earlier. So we only
* whine if the target is local.
*/
- if (!strncmp(argv[1], self->numeric, strlen(self->numeric)))
+ if (!strncmp(argv[1], self->numeric, strlen(self->numeric))) {
log_module(MAIN_LOG, LOG_ERROR, "Unable to find kill victim %s", argv[1]);
- return 0;
+ return 0;
+ }
+ return 1;
}
if (IsLocal(user) && IsService(user)) {