From 04a490887705b489f94b58df612c9c3d2eb849b7 Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Tue, 24 Apr 2018 15:43:14 +0200 Subject: [PATCH 1/3] new /set loginhistory --- place/berlin.c | 2 ++ place/git.c | 9 +++++++++ world/default/de/html.textdb | 5 +++++ world/default/en/html.textdb | 5 +++++ world/net/irc/user.c | 2 +- world/net/library/profiles.html | 1 + world/net/library/profiles.i | 2 ++ world/net/library/profiles.pl | 5 ++++- world/net/user.c | 3 ++- world/net/usercmd.i | 4 ++++ 10 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 place/git.c diff --git a/place/berlin.c b/place/berlin.c index 36e71ab..4a81b20 100644 --- a/place/berlin.c +++ b/place/berlin.c @@ -1,2 +1,4 @@ #define PLACE_HISTORY_EXPORT +#define PLACE_SCRATCHPAD +#define SECURE #include diff --git a/place/git.c b/place/git.c new file mode 100644 index 0000000..b3fb622 --- /dev/null +++ b/place/git.c @@ -0,0 +1,9 @@ +#include +#define NAME "git" + +//#ifdef BRAIN +# define REDIRECT "psyc://psyced.org/@PSYC" +//#endif + +#include // now generate the place according to the rules + diff --git a/world/default/de/html.textdb b/world/default/de/html.textdb index 432a5b2..addd971 100644 --- a/world/default/de/html.textdb +++ b/world/default/de/html.textdb @@ -722,6 +722,11 @@ _PAGES_help_settings |Mit "/set filter off" kann der private Firewall wieder abgeschaltet |werden. "default" geht auf die Voreinstellung zurück. | +| +|

/set loginhistory <Anzahl>

+|taugt zur Einschränkung wieviele Nachrichten aus der Historie vergangener +|öffentlicher Nachrichten beim Einloggvorgang dargestellt werden. +| | |

/set presencefilter [ on | off | all | automatic ]

|hilft die Menge an Anwesenheit- und Abwesenheitsbekundungen in Zaum zu diff --git a/world/default/en/html.textdb b/world/default/en/html.textdb index 11d9dc1..f5e33b8 100644 --- a/world/default/en/html.textdb +++ b/world/default/en/html.textdb @@ -203,6 +203,11 @@ _PAGES_help_display |wait to meet you in a room. "default" resets this value to |the local default. | +| +|

/set loginhistory <amount>

+|lets you define an upper limit in the number of history +|messages you want to see when logging into the server. +| | |{_HTML_info_split} |
diff --git a/world/net/irc/user.c b/world/net/irc/user.c index d8e0b1e..93909db 100644 --- a/world/net/irc/user.c +++ b/world/net/irc/user.c @@ -897,7 +897,7 @@ logon() { // version strings, only IRC makes it terribly complicated and // even political. oh of course, that's because on irc the server // admin isn't necessarily a person of your trusting. - w("_request_version", 0, 0, SERVER_UNIFORM); + w("_request_version"); //, 0, 0, SERVER_UNIFORM); # endif #endif return rc; diff --git a/world/net/library/profiles.html b/world/net/library/profiles.html index 6d5854c..e866dd2 100644 --- a/world/net/library/profiles.html +++ b/world/net/library/profiles.html @@ -24,6 +24,7 @@ _address_streetstreetstreetSTREETADR/STREETstreet _address_zone_timetimezoneTZTZ _affiliationaffiliationorg_nameORGNAMEORG/ORGNAMEo +_amount_history_loginloginhistory _character_actionactioncharacter _character_commandcommandcharacter _colorcolor diff --git a/world/net/library/profiles.i b/world/net/library/profiles.i index aa33926..2b358f4 100644 --- a/world/net/library/profiles.i +++ b/world/net/library/profiles.i @@ -166,6 +166,7 @@ volatile mapping psyc2set = ([ "_address_street" : "street", "_address_zone_time" : "timezone", "_affiliation" : "affiliation", + "_amount_history_login" : "loginhistory", "_character_action" : "actioncharacter", "_character_command" : "commandcharacter", "_color" : "color", @@ -288,6 +289,7 @@ volatile mapping set2psyc = ([ "street" : "_address_street", "timezone" : "_address_zone_time", "affiliation" : "_affiliation", + "loginhistory" : "_amount_history_login", "actioncharacter" : "_character_action", "commandcharacter" : "_character_command", "color" : "_color", diff --git a/world/net/library/profiles.pl b/world/net/library/profiles.pl index e3c977c..efe85b8 100644 --- a/world/net/library/profiles.pl +++ b/world/net/library/profiles.pl @@ -21,7 +21,7 @@ while () { $_ = $psyc = $1; $psyc{$psyc} = 1; next if /^_INTERNAL/; - s/_(address|contact|voice|scheme|source|flag|person|select)//g; + s/_(address|amount|contact|voice|scheme|source|flag|person|select)//g; s/_date/_day/g; s/_description/_text/g; s/_favorite/_fave/g; @@ -633,6 +633,9 @@ jProf places_lived PSYC _place_home set home +PSYC _amount_history_login +#set loginhistory + PSYC _flag_filter_strangers set filter diff --git a/world/net/user.c b/world/net/user.c index d0d9942..84f2e51 100644 --- a/world/net/user.c +++ b/world/net/user.c @@ -1724,7 +1724,8 @@ autojoin() { // says it, too. # endif teleport(v("place"), "_login", 0, 0, ([ "_amount_history": - _limit_amount_history_place_default ])); + v("loginhistory") ? to_int(v("loginhistory")) + : _limit_amount_history_place_default ])); # endif // subscriptions are stored in lowercase, warum auch immer if (sizeof(v("subscriptions"))) { diff --git a/world/net/usercmd.i b/world/net/usercmd.i index 839d18e..40991b0 100644 --- a/world/net/usercmd.i +++ b/world/net/usercmd.i @@ -2745,6 +2745,10 @@ checkVar(key, value) { if (value == "off" || value == "-") value = "-"; else if (value) value = "on"; break; + case "loginhistory": + // zero is an intentional value in this case + if (value == "0") break; + // fall through case "postalcode": // integer settings case "latitude": case "longitude": From 2e459558f54f3f228398738e31834cd45fabf834 Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Fri, 11 May 2018 17:08:52 +0200 Subject: [PATCH 2/3] _flag_disable_network_circuit_connect, _flag_disable_idna_stringprep, no PERSISTENT_MASTERS --- world/net/circuit.c | 10 ++++++---- world/net/http/server.c | 1 + world/net/include/net.h | 8 ++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/world/net/circuit.c b/world/net/circuit.c index d2a7807..cbb1664 100644 --- a/world/net/circuit.c +++ b/world/net/circuit.c @@ -261,29 +261,31 @@ runQ() { } connect(ho, po, transport, srv, extra) { +#ifndef _flag_disable_network_circuit_connect if (interactive()) return -8; P3(("connect: %O, %O, %O, %O for %O\n", ho, po, transport, srv, ME)) if (time() < time_of_connect_attempt + waitforme) return -2; if (ho) { // paranoid: stringp(ho) && strlen(ho)) { if (po) port = po; -#ifndef ERQ_WITHOUT_SRV +# ifndef ERQ_WITHOUT_SRV if (srv) { hostname = lower_case(ho); host = 0; } else -#endif +# endif host = lower_case(ho); P2(("connect.%s:\t%O, %O, %O\t%O\n", srv || "to", ho, po, transport, ME)) } -#ifndef ERQ_WITHOUT_SRV +# ifndef ERQ_WITHOUT_SRV P4(("connect->srv_choose? depends on srv %O\n", srv)) if (srv) return dns_srv_resolve(hostname, srv, // _psyc._tls.domain transport == "s" ? "tls" : "tcp", #'srv_choose, transport); -#endif +# endif if (::connect(host, port, transport, extra) >= 0) time_of_connect_attempt = time(); +#endif } disconnected(remaining) { diff --git a/world/net/http/server.c b/world/net/http/server.c index ab206a2..fcfb5cb 100644 --- a/world/net/http/server.c +++ b/world/net/http/server.c @@ -114,6 +114,7 @@ process_header() { parse_request(input) { P0(("=== HTTP got: %O from %O\n", input, query_ip_name(ME))) + if (input == "HEAD / HTTP/1.1") return 1; if (!input || input=="") { // should return error? diff --git a/world/net/include/net.h b/world/net/include/net.h index a9162cd..b93a37a 100644 --- a/world/net/include/net.h +++ b/world/net/include/net.h @@ -53,7 +53,8 @@ # define DEFAULT_CONTENT_TYPE "text/html; charset=" SYSTEM_CHARSET #endif -#if __EFUN_DEFINED__(idna_stringprep) && defined(DRIVER_PATH) +// 2018-05 tmp disabled stringprep: +#if __EFUN_DEFINED__(idna_stringprep) && defined(DRIVER_PATH) && !defined(_flag_disable_idna_stringprep) // stringprep needs utf8 arguments // this results in lots of conversions some of which look like // system->utf­>system->utf. luckily UTF8 is our system charset. @@ -221,7 +222,10 @@ # define WANT_S2S_TLS # define WANT_S2S_SASL # define ENTER_MEMBERS -# define PERSISTENT_MASTERS +// disabled 2018-05 due to stringprep messing up the _routes +// data structures *and* plenty of karteileichen which means +// that clean-up of _routes is not working!! +//# define PERSISTENT_MASTERS # define NEW_RENDER # define MUCSUC //# define XMPP_BIDI From 95fbeacb35ea60d487e446b7fa5ae6d61f63ade7 Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Wed, 23 May 2018 15:20:50 +0200 Subject: [PATCH 3/3] two minor runtime errors --- world/net/jabber/user.c | 7 ++++--- world/net/user.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/world/net/jabber/user.c b/world/net/jabber/user.c index e72c742..c325b81 100644 --- a/world/net/jabber/user.c +++ b/world/net/jabber/user.c @@ -672,12 +672,13 @@ iq(XMLNode node) { case "jabber:iq:roster": switch(node["@type"]) { case "get": - // TODO: this assumes that to is unset and the query is - // to itself + // TODO: this assumes that 'to' is unset and the query is + // to itself. we sometimes get here without a valid tag - + // what should we do then? hasroster = 1; packet = sprintf("" "", - myjid, tag); + myjid, stringp(tag)? tag: ""); // TODO: listAcq does the same basically foreach (friend : ppl) { mixed *u; diff --git a/world/net/user.c b/world/net/user.c index 84f2e51..276df4a 100644 --- a/world/net/user.c +++ b/world/net/user.c @@ -1777,7 +1777,7 @@ quit(immediate, variant) { int stayinalive = 0; // so, SUBSCRIBE_PERMANENT won't work for now. - if (sizeof(v("subscriptions")) && widthof(v("subscriptions"))) { + if (mappingp(v("subscriptions")) && sizeof(v("subscriptions")) && widthof(v("subscriptions"))) { foreach (o, s : places) { P3(("Stay in %O, %O?\n", o, s)) if (v("subscriptions")[lower_case(s)] != SUBSCRIBE_PERMANENT)