dlink_list invited; /**< invites this client has to channels */
- char *cgisockhost; /**< if this client is a webirc client, this is the host of where they are from */
+ char *cgisockhost; /**< if this client is a webirc client, this is the ip of where they are from */
+ char *cgihost; /**< if this client is a webirc client, this is the host of where they are from */
};
sendto_one(client_p, ":%s ENCAP * CERTFP %s :%s",
ID(&me), ID(target_p), target_p->certfp);
- if (!EmptyString(target_p->cgisockhost))
- sendto_one(client_p, ":%s ENCAP * UWEBIRC %s :%s", ID(&me), ID(target_p), target_p->cgisockhost);
+ if (!EmptyString(target_p->cgisockhost) && !EmptyString(target_p->cgihost))
+ sendto_one(client_p, ":%s ENCAP * UWEBIRC %s %s :%s", ID(&me), ID(target_p), target_p->cgisockhost, target_p->cgihost);
}
if (target_p->away[0])
/* store original host */
if (target_p->cgisockhost == NULL)
target_p->cgisockhost = xstrdup(target_p->sockhost);
+ if (target_p->cgihost == NULL)
+ target_p->cgihost = xstrdup(target_p->realhost);
/* apply new ip and host */
strlcpy(target_p->sockhost, ip, sizeof(target_p->sockhost));
/*
* me_uwebirc
* parv[1] = user
- * parv[2] = webirc sochost
+ * parv[2] = webirc sockhost
+ * parv[3] = webirc realhost
*/
static void
me_uwebirc(struct Client *client_p, struct Client *source_p, int parc, char *parv[])
MyFree(target_p->cgisockhost);
target_p->cgisockhost = NULL;
- if (parc > 2 && !EmptyString(parv[2]))
+ MyFree(target_p->cgihost);
+ target_p->cgihost = NULL;
+
+ if (parc > 3 && !EmptyString(parv[3]))
+ {
target_p->cgisockhost = xstrdup(parv[2]);
+ target_p->cgihost = xstrdup(parv[3]);
+ }
}
static struct Message webirc_msgtab =
source_p->name, target_p->name);
}
- if (HasUMode(source_p, UMODE_OPER) && target_p->cgisockhost)
- sendto_one(source_p, form_str(RPL_WHOISREALIP), me.name, source_p->name, target_p->name, target_p->cgisockhost);
+ if (HasUMode(source_p, UMODE_OPER) && !EmptyString(target_p->cgihost) && !EmptyString(target_p->cgisockhost))
+ sendto_one(source_p, form_str(RPL_WHOISREALIP), me.name, source_p->name, target_p->name, target_p->cgihost, target_p->cgisockhost);
if (HasUMode(source_p, UMODE_OPER) || source_p == target_p)
{
MyFree(client_p->serv);
MyFree(client_p->certfp);
MyFree(client_p->cgisockhost);
+ MyFree(client_p->cgihost);
assert(dlink_list_length(&client_p->invited) == 0);
/* 606 */ [RPL_WATCHLIST] = ":%s 606 %s :%s",
/* 607 */ [RPL_ENDOFWATCHLIST] = ":%s 607 %s :End of WATCH %c",
/* 671 */ [RPL_WHOISSECURE] = ":%s 671 %s %s :is using a secure connection",
- /* 672 */ [RPL_WHOISREALIP] = ":%s 672 %s %s :is actually from %s",
+ /* 672 */ [RPL_WHOISREALIP] = ":%s 672 %s %s :is actually from %s [%s]",
/* 702 */ [RPL_MODLIST] = ":%s 702 %s %s %p %s %s",
/* 703 */ [RPL_ENDOFMODLIST] = ":%s 703 %s :End of /MODLIST.",
/* 704 */ [RPL_HELPSTART] = ":%s 704 %s %s :%s",
if (!EmptyString(source_p->certfp))
sendto_one(server, ":%s ENCAP * CERTFP %s :%s", ID(&me), ID(source_p), source_p->certfp);
- if (!EmptyString(source_p->cgisockhost))
- sendto_one(server, ":%s ENCAP * UWEBIRC %s :%s", ID(&me), ID(source_p), source_p->cgisockhost);
+ if (!EmptyString(source_p->cgisockhost) && !EmptyString(source_p->cgihost))
+ sendto_one(server, ":%s ENCAP * UWEBIRC %s %s :%s", ID(&me), ID(source_p), source_p->cgisockhost, source_p->cgihost);
}
}
}
json_object_set_new(j, "sockhost", json_string(client->sockhost));
json_object_set_new(j, "certfp", json_string(client->certfp));
json_object_set_new(j, "cgisockhost", json_string(client->cgisockhost));
+ json_object_set_new(j, "cgihost", json_string(client->cgihost));
if (client->localClient != NULL)
{
p = json_string_value(json_object_get(client, "cgisockhost"));
if (p)
client_p->cgisockhost = xstrdup(p);
+ p = json_string_value(json_object_get(client, "cgihost"));
+ if (p)
+ client_p->cgihost = xstrdup(p);
if (IsMe(client_p->servptr))
{