1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

let is_localhost() do its lower_case itself.. thx fip

This commit is contained in:
psyc://psyced.org/~lynX 2011-07-24 18:53:47 +02:00
parent 15dd8c0ada
commit a0cc248e00
15 changed files with 25 additions and 25 deletions

View file

@ -269,7 +269,7 @@ jabberMsg(XMLNode node) {
// if we dont know the host, complain
// put NAMEPREP(_host_XMPP) into the localhost mapping pleeeease
//if (target != NAMEPREP(_host_XMPP)) {
unless (is_localhost(lower_case(target))) {
unless (is_localhost(target)) {
monitor_report("_error_unknown_host",
sprintf("%O sent us a dialback packet believing we would be %O",
source, target));
@ -349,7 +349,7 @@ jabberMsg(XMLNode node) {
* then croak with a host-unknown and commit suicide
*/
// same as above...
unless (is_localhost(lower_case(target))) {
unless (is_localhost(target)) {
emit(sprintf("<db:verify from='%s' to='%s' id='%s' type='error'>"
"<error type='cancel'>"
"<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"
@ -498,7 +498,7 @@ open_stream(XMLNode node) {
if (node["@from"]) {
packet += "to='" + node["@from"] + "' ";
}
if (node["@to"] && !(is_localhost(lower_case(node["@to"])))) {
if (node["@to"] && !(is_localhost(node["@to"]))) {
emit(packet + ">");
STREAM_ERROR("host-unknown", "")
QUIT

View file

@ -84,8 +84,8 @@ virtual inherit JABBER_PATH "common";
# define _host_XMPP SERVER_HOST
#endif
// this is not ready for is_localhost
#define is_localhost(a) (a) == _host_XMPP
// net/jabber is not ready for regular is_localhost
#define is_localhost(a) (lower_case(a)) == _host_XMPP
#define JABSOURCE "_INTERNAL_source_jabber"

View file

@ -868,7 +868,7 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
case "jabber:iq:last":
switch(t) {
case "get":
if (isplacemsg || is_localhost(lower_case(target)))
if (isplacemsg || is_localhost(target))
o = "/" + (tu[UResource] || "");
else
o = summon_person(tu[UUser]);

View file

@ -338,7 +338,7 @@ jabberMsg(XMLNode node) {
}
// lets see if its one of our users
sscanf(deco, "%s@%s", u, ho);
unless (is_localhost(lower_case(ho))) {
unless (is_localhost(ho)) {
// wrong host
SASL_ERROR("invalid-authzid")
QUIT

View file

@ -449,7 +449,7 @@ message(XMLNode node) {
unless (u = parse_uniform(XMPP + node["@to"])) { D("impossible!\n"); }
isplacemsg = ISPLACEMSG(node["@to"]);
if (is_localhost(lower_case(node["@to"]))) {
if (is_localhost(node["@to"])) {
// it's too unusual to have commands without cmdchar
// so let's use input() instead of cmd() here
// IMHO this should check if input is a cmd
@ -828,7 +828,7 @@ iq(XMLNode node) {
case "get":
if (!node["@to"])
sendmsg(ME, "_request_list_feature", 0, vars);
else if (is_localhost(lower_case(node["@to"])))
else if (is_localhost(node["@to"]))
sendmsg("/", "_request_list_feature", 0, vars);
/* else... TODO */
break;
@ -847,7 +847,7 @@ iq(XMLNode node) {
if (!node["@to"])
// "my" places - let person.c handle this
sendmsg(ME, "_request_list_item", 0, vars);
else if (is_localhost(lower_case(node["@to"])))
else if (is_localhost(node["@to"]))
// server's places - let root.c handle this
sendmsg("/", "_request_list_item", 0, vars);
/* else... TODO */
@ -1114,7 +1114,7 @@ string jid2ppl(string jid) {
// }
sscanf(host, "%s/%s", host, resource);
#if 1 // wieso 0??? sendmsg() hätte das hinkriegen sollen.. war der gedanke
if (is_localhost(lower_case(host))) { // local user
if (is_localhost(host)) { // local user
P4(("is_localhost? %O, YES, then use %O\n", host, node))
// TODO: what about returning objects?
if (strlen(node) && ISPLACEMSG(node)) return PREFIXFREE(node);