From a10d36ba5bafd5ac97987e740c667b9c38d0a2bb Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 10 Dec 2009 11:42:58 +0100 Subject: [PATCH 01/12] babeldos magicos --- CHANGESTODO | 7 +++++++ makefile | 3 +++ place/babeldos.i | 39 +++++++++++++++++++++++++-------------- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/CHANGESTODO b/CHANGESTODO index c632db6..a462761 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -382,6 +382,8 @@ TWITTER ________________________________________________________________________ == OTHER MAJOR TODOS =================================================== ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +- occasionally double data sets for psyc://ve.symlynx.com/~nick and nick + + provide a tuning for ACTIVE server-side PING (keepalive) ? see http://about.psyc.eu/Ping for explanations. @@ -1581,6 +1583,11 @@ ________________________________________________________________________ look at: http://freshmeat.net/projects/pyvoicechat/ dormant since 2004.. oops ++ tycho proposes /log reply of new messages should not necessarily + show automatically, in case you are connecting with a client on a + mobile phone, especially if you have permanent context subscriptions + flowing into your log nonstop. + RELAYING + net/spyc needs relaying (without parsing even), see TODO in parse_content() ? relaying doesn't work for psyc clients (xmpp: in particular) diff --git a/makefile b/makefile index 2cba28d..d0033e3 100644 --- a/makefile +++ b/makefile @@ -58,3 +58,6 @@ local/all.ls: .links: (cd world;../bin/findlinks */de/* */en/*) >$@ +exefix: + chmod +x bin/* run/* config/psyced.settings install.sh utility/multipatcher + diff --git a/place/babeldos.i b/place/babeldos.i index 6c538ae..723822e 100644 --- a/place/babeldos.i +++ b/place/babeldos.i @@ -10,13 +10,17 @@ #include #include +#include #define INHERIT_CONNECT start(); babel(); -#define CRESET start(); -inherit "net/connect"; +#define CREATE qInit(ME, 1000, 100); + +// too aggressive to connect babelfish on every reset!! +//efine CRESET start(); +inherit NET_PATH "connect"; #include #define emit binary_message @@ -26,10 +30,9 @@ volatile mixed *current; volatile string krank, buffer; start() { - qInit(ME, 1000, 100); unless (has_con || is_con) { is_con = 1; - call_out(#'connect, 0, "babelfish.altavista.com", 80); + call_out(#'connect, 0, "babelfish.yahoo.com", 80); } } @@ -37,21 +40,24 @@ escape(data) { return regreplace(data, "[^a-zA-Z0-9]", (: return sprintf("%%%x", $1[0]); :), 1); } -disconnect() { +disconnected() { + string k; + +//efine FMT "%~s
%s
%~s" +#define FMT "%~s%~s" + has_con = 0; + P0(("%O received %O bytes of buffer for %O\n", ME, sizeof(buffer), current)) switch (pointerp(current) ? current[0] : "") { - string k; case TRANSLATION: - if (sscanf(buffer, "%~s
%s
%~s", k)) { - krank = k; - } + if (sscanf(buffer, FMT, k)) krank = k; + else krank = "und es geschah ihr als sei es von der ferne"; #ifdef TRANSLATION2 babel(TRANSLATION2, current[1], current[2], krank, current[4]); break; case TRANSLATION2: - if (sscanf(buffer, "%~s
%s
%~s", k)) { - krank = k; - } + if (sscanf(buffer, FMT, k)) krank = k; + else krank = "und sie sah fern als sei es ein geschehen"; #endif ::msg(current[1], current[2], replace(krank, """, "\""), current[4]); default: @@ -103,8 +109,13 @@ babel(mode, source, mc, data, mapping vars) { buffer = ""; krank = 0; current = ({ mode, source, mc, data, vars }); - emit("GET /tr?lp=" + mode + "&urltext=" + escape(data) + " HTTP/1.1\r\n" - "Host: babelfish.altavista.com\r\n\r\n"); + // old API +// emit("GET /tr?lp=" + mode + "&urltext=" + escape(data) + " HTTP/1.1\r\n" +// "Host: babelfish.altavista.com\r\n\r\n"); + // new API + emit("GET /translate_txt?ei=UTF-8&doit=done&fr=bf-res&intl=1&lp="+ + mode +"&tt=urltext&trtext="+ + escape(data) +" HTTP/1.1\r\nHost: babelfish.yahoo.com\r\n\r\n"); } msg(source, mc, data, mapping vars) { From a63fb6c0d803d18e54db03ab2ec87e4a5b761023 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 10 Dec 2009 11:48:22 +0100 Subject: [PATCH 02/12] + --- CHANGESTODO | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGESTODO b/CHANGESTODO index 1660500..986e932 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -393,6 +393,8 @@ ________________________________________________________________________ ________________________________________________________________________ == OTHER MAJOR TODOS =================================================== ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +- occasionally double data sets for psyc://ve.symlynx.com/~nick and nick + + provide a tuning for ACTIVE server-side PING (keepalive) ? see http://about.psyc.eu/Ping for explanations. @@ -1564,6 +1566,11 @@ ________________________________________________________________________ look at: http://freshmeat.net/projects/pyvoicechat/ dormant since 2004.. oops ++ tycho proposes /log reply of new messages should not necessarily + show automatically, in case you are connecting with a client on a + mobile phone, especially if you have permanent context subscriptions + flowing into your log nonstop. + > RELAYING + net/spyc needs relaying (without parsing even), see TODO in parse_content() ? relaying doesn't work for psyc clients (xmpp: in particular) @@ -1584,6 +1591,8 @@ ________________________________________________________________________ but some of the old stuff does.. how do we find a proper solution? == DOCUMENTATION ISSUES ================================================ +? should we point to some manuals on how to make and add certificates? + * ich habs.. jede datei definiert am anfang in welche kategorie sie gehört.. "library" "user" "server" "language" etc... und jede funktion kann sich dann mit /** library: this stuff.. */ woanders einordnen.. jetzt brauchen wir From 1ec31a5479ea4deb51df55e0566777670b28d034 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 10 Dec 2009 12:16:46 +0100 Subject: [PATCH 03/12] december bugfix: mktime doesn't like month number 12 --- makefile | 5 +++-- world/net/jabber/mixin_parse.c | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index d0033e3..9446db1 100644 --- a/makefile +++ b/makefile @@ -58,6 +58,7 @@ local/all.ls: .links: (cd world;../bin/findlinks */de/* */en/*) >$@ -exefix: +rights: + find . -type d -exec chmod 755 {} \; + find . -type f -exec chmod 644 {} \; chmod +x bin/* run/* config/psyced.settings install.sh utility/multipatcher - diff --git a/world/net/jabber/mixin_parse.c b/world/net/jabber/mixin_parse.c index 6a63504..fc561d6 100644 --- a/world/net/jabber/mixin_parse.c +++ b/world/net/jabber/mixin_parse.c @@ -221,8 +221,10 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) { time[TM_YEAR], time[TM_MON], time[TM_MDAY], time[TM_HOUR], time[TM_MIN], time[TM_SEC]); - if (res == 6 && (res = mktime(time)) != -1) { - vars["_time_place"] = res; //helper["@stamp"]; + if (res == 6) { + // mktime uses month from 0 to 11, december error fixed + time[TM_MON]--; + if ((res = mktime(time)) != -1) vars["_time_place"] = res; } } #endif From 069fb1e801378d7f81c02f22af7aa94d50185d75 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 17 Dec 2009 14:37:53 +0100 Subject: [PATCH 04/12] fix /lusers xmpp:server --- CHANGESTODO | 3 --- world/net/jabber/mixin_render.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGESTODO b/CHANGESTODO index 986e932..e1c676d 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -1767,9 +1767,6 @@ das sieht doof aus.. gehts auch besser? hmm remain incarnated longer since mails seem to arrive often enough for some users to never leave memory. -+ disallow TLS/SSL connections from localhost to save CPU resources - for useful things - - re-examine everything looking for optimizations.. like, are any lower_case's being called twice etc. or introduce a "lowercased" flag into the driver's string structures *grin* diff --git a/world/net/jabber/mixin_render.c b/world/net/jabber/mixin_render.c index 865c872..b692b2a 100644 --- a/world/net/jabber/mixin_render.c +++ b/world/net/jabber/mixin_render.c @@ -99,7 +99,7 @@ int msg(string source, string mc, string data, $2["_amount_users_registered"] = helper["@value"]; break; case "users/online": - $2["_amount_users"] = helper["@value"]; + $2["_amount_users_loaded"] = helper["@value"]; break; } } From c64d8cc3c62f752a77b4fc168fc24dc23a77c897 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 17 Dec 2009 15:39:20 +0100 Subject: [PATCH 05/12] better info for dyndns installation, no 127.1 by default --- install.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index bcc8730..25f5b9b 100755 --- a/install.sh +++ b/install.sh @@ -304,10 +304,13 @@ ask "Server host name" HOST_NAME get DOMAIN_NAME "" # `grep ^domain /etc/resolv.conf | sed "s/^domain.//"` ask "Your domain name" DOMAIN_NAME -get HOST_IP "127.0.0.1" +#get HOST_IP "127.0.0.1" +get HOST_IP # `nslookup -sil $HOST_NAME | tail -n 2 | head -n 1 | awk '{print $2}' | sed "s/,//"` echo "" -echo "If you have a static IP address for your server, please tell me:" +echo "If you have a static IP address for your server, please tell me." +echo "Otherwise I will resolve my own hostname at runtime in order to get my" +echo "current IP address." ask "Server IP address" HOST_IP echo "" @@ -371,6 +374,7 @@ done #echo "[server output goes to $RUNTIME_OUTPUT]" ## BUG IN ORDER!!! we dont have $PSYC_PORT yet!!!!! TODO!!111 +## also HOST_IP may be empty RUNTIME_OUTPUT_DIR="$LOG_DIR/$HOST_IP-$PSYC_PORT" RUNTIME_OUTPUT_STDERR="$RUNTIME_OUTPUT_DIR/stderr" RUNTIME_OUTPUT_STDOUT="$RUNTIME_OUTPUT_DIR/stdout" @@ -793,6 +797,7 @@ else echo "[host name resolving disabled (don't start erq).]" fi +## TODO, should be disabled when there is no HOST_IP? get WANT_PORTRULES "y" echo "" @@ -986,7 +991,8 @@ _host_name = $HOST_NAME _host_domain = $DOMAIN_NAME ; Would you like to bind the server to a specific IP address? -; If you do you MUST also provide _host_name and _host_domain +; If you do, you MUST also provide _host_name and _host_domain +; If you leave this empty, psyced will find out at runtime. _host_IP = $HOST_IP ; Nickname for the chatserver. Appears in login message, telnet prompt, From eba0982e033d1ba646dec55fb6fecdbada7952cf Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Fri, 18 Dec 2009 19:32:54 +0100 Subject: [PATCH 06/12] don't panic about idn --- bin/psyconf | 3 ++- run/md5.pl | 2 ++ run/sha1.pl | 2 ++ world/net/include/net.h | 1 - world/net/jabber/mixin_parse.c | 4 ++++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/psyconf b/bin/psyconf index e84a32b..8322fd2 100755 --- a/bin/psyconf +++ b/bin/psyconf @@ -16,7 +16,8 @@ psyconf - a configuration tool for PSYCED Usage: psyconf [ ] -The default configuration file used is /etc/psyced.ini +The default configuration file used is either ./psyced.ini +or /etc/psyc/psyced.ini =cut diff --git a/run/md5.pl b/run/md5.pl index d19b0f8..cca1319 100755 --- a/run/md5.pl +++ b/run/md5.pl @@ -4,6 +4,8 @@ # (sort of like cgi) with LDMUD. but by now LDMUD knows how # to do MD5 and SHA1 itself, so they are not being used. # +# consult http://about.psyc.eu/spawn for instructions +# use Digest::MD5 qw(md5 md5_hex); $| = 1; diff --git a/run/sha1.pl b/run/sha1.pl index 308c3fd..a1940e0 100755 --- a/run/sha1.pl +++ b/run/sha1.pl @@ -4,6 +4,8 @@ # (sort of like cgi) with LDMUD. but by now LDMUD knows how # to do MD5 and SHA1 itself, so they are not being used. # +# consult http://about.psyc.eu/spawn for instructions +# use Digest::SHA1 qw(sha1 sha1_hex); $| = 1; diff --git a/world/net/include/net.h b/world/net/include/net.h index a627c1b..39379b0 100644 --- a/world/net/include/net.h +++ b/world/net/include/net.h @@ -64,7 +64,6 @@ # define NAMEPREP(s) FROM_UTF8(idna_stringprep(TO_UTF8(s), STRINGPREP_NAMEPREP)) # define RESOURCEPREP(s) FROM_UTF8(idna_stringprep(TO_UTF8(s), STRINGPREP_XMPP_RESOURCEPREP)) #else -# echo Warning: using lower_case instead of idna_stringprep! # define NODEPREP(s) lower_case(s) # define NAMEPREP(s) lower_case(s) # define RESOURCEPREP(s) (s) diff --git a/world/net/jabber/mixin_parse.c b/world/net/jabber/mixin_parse.c index fc561d6..1bb6d4f 100644 --- a/world/net/jabber/mixin_parse.c +++ b/world/net/jabber/mixin_parse.c @@ -4,6 +4,10 @@ #include "presence.h" #include +#if !__EFUN_DEFINED__(idna_stringprep) +# echo Warning: idn support as recommended for XMPP is missing from LPC driver. will try lower_case() instead. usually works. +#endif + // necessary to implement a minimum set of commands for remote jabber users // #undef USER_PROGRAM // #undef MYNICK From e01342241ab9057243c85f5762ba017749b467e0 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Fri, 18 Dec 2009 19:47:59 +0100 Subject: [PATCH 07/12] warn if key/cert have not been found --- bin/psyconf | 9 +++++++++ install.sh | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/bin/psyconf b/bin/psyconf index 8322fd2..33f0a18 100755 --- a/bin/psyconf +++ b/bin/psyconf @@ -387,14 +387,23 @@ X my $t = $c{_basic_path_PEM_key}; if ($t) { $t = "$config/$t" unless $t =~ m#^/#; + print STDERR </dev/null the error though... + echo "If the user doesn't exist yet, please make one." fi #while true #do @@ -335,6 +338,7 @@ fi get GROUP "psyc" #while true #do + echo "If such a group doesn't exist yet, please create it now." ask "Which group do you want to run psyced as" GROUP # if `id -Gn $USER | grep $GROUP > /dev/null` # then From 7bc16a510fa302a442fcbbb1b32cfbb52ca98880 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Mon, 21 Dec 2009 22:50:02 +0100 Subject: [PATCH 08/12] + --- world/drivers/ldmud/master/accept.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/drivers/ldmud/master/accept.c b/world/drivers/ldmud/master/accept.c index 429a3fb..db63890 100644 --- a/world/drivers/ldmud/master/accept.c +++ b/world/drivers/ldmud/master/accept.c @@ -129,7 +129,7 @@ object connect(int uid, int port, string service) { peerport = pointerp(arg) ? (arg[2]*256 + arg[3]) : 0; if (peerport < 0) peerport = 65536 + peerport; // no support for non-AF_INET nets yet - if (peerport == SPYC_SERVICE) peerport = 0; + if (peerport == PSYC_SERVICE) peerport = 0; # else // as long as the object names don't collide, this is okay too peerport = 65536 + random(9999999); From 00713a840ea1f4a2b1b2d9a885ef8f12e0a9e936 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Mon, 28 Dec 2009 04:19:44 +0100 Subject: [PATCH 09/12] a possible way to croak() in spyc --- CHANGESTODO | 9 ++++++++ world/net/spyc/circuit.c | 9 +++++--- world/net/spyc/parse.c | 50 +++++++++++++++++++++------------------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/CHANGESTODO b/CHANGESTODO index e1c676d..9b2d728 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -4,6 +4,12 @@ vim:nosmarttab:syntax=diff | Essentially: whenever you fix something, move that line to the end of file. | - marks bugs & fixes, + marks new features, ? marks issues, * marks big stuff ________________________________________________________________________ +== SERIOUS!!! ========================================================== +¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +- large submissions into scratchpad can crash the driver + +- configure script fails on libidn now being in glibc +________________________________________________________________________ == NEXT RELEASE ======================================================== ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ - interserver xmpp /me expects no leading newline, but pidgin recently @@ -1079,6 +1085,9 @@ cel'>< ________________________________________________________________________ == RELEASE INSTALLER =================================================== ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ++ the psyced script could check if psyced.ini has been changed recently + and autorun psyconf? or maybe just spit out a warning.. + - _charset_console can still lead to unexpected convert_charset errors when outputting random data. convert_charset must be non-fatal here! diff --git a/world/net/spyc/circuit.c b/world/net/spyc/circuit.c index 1c80fd3..4c0383c 100644 --- a/world/net/spyc/circuit.c +++ b/world/net/spyc/circuit.c @@ -25,7 +25,7 @@ volatile string netloc; // this is completely anti-psyc. it should take mcs as arguments // and look up the actual message from textdb.. FIXME -#define CIRCUITERROR(reason) { debug_message("SPYC CIRCUIT: " reason "\n"); \ +#define CIRCUITERROR(reason) { \ croak("_error_circuit", "circuit error: " \ reason); \ return 0; \ @@ -55,9 +55,12 @@ void feed(string data) { // yes, this is a funny implementation of croak // it does not use msg(). Yes, that is intended varargs mixed croak(string mc, string data, vamapping vars, vamixed source) { + PT(("croak(%O) in %O (%O)\n", mc, ME, query_ip_name())) + unless (data) data = T(mc, ""); binary_message(sprintf("\n%s\n%s\n|\n", mc, data)); - remove_interactive(ME); - destruct(ME); + // right behaviour for all croaks!? + remove_interactive(ME); +// destruct(ME); return 0; } diff --git a/world/net/spyc/parse.c b/world/net/spyc/parse.c index e4972dc..316e61b 100644 --- a/world/net/spyc/parse.c +++ b/world/net/spyc/parse.c @@ -15,21 +15,21 @@ int may_parse_more; array(mixed) tvars; mapping hvars; -// this is completely anti-psyc. it should take mcs as arguments -// and look up the actual message from textdb.. FIXME -#define PARSEERROR(reason) { debug_message("PSYC PARSE ERROR: " reason "\n"); \ - croak("_error_syntax_broken", "Failed parsing: " \ - reason); \ - return 0; \ - } - - +// being faded out in favor of regular croak() +#define PARSEERROR(reason) { \ + croak("_error_syntax_broken", \ + "Failed parsing: " reason); \ + return 0; } + #define DELIM S_GLYPH_PACKET_DELIMITER "\n" #define C_LINEFEED '\n' #define MVAR_GLYPH 0 #define MVAR_STATE 1 #define MVAR_VALUE 2 +#ifndef PSYC_UDP +# define QUIT remove_interactive(ME); return 0; +#endif step(); // prototype @@ -76,9 +76,7 @@ void feed(string data) { // overload this as needed -varargs mixed croak(string mc, string data, vamapping vars, vamixed source) { - return 0; -} +varargs mixed croak(string mc, string data, vamapping vars) { return 0; } // called when a complete packet has arrived @@ -101,16 +99,18 @@ mapping process_header(mixed varops) { case C_GLYPH_MODIFIER_DIMINISH: case C_GLYPH_MODIFIER_QUERY: case C_GLYPH_MODIFIER_ASSIGN: - PARSEERROR("header modifier with glyph other than ':', this is not implemented") - break; + croak("_failure_unavailable_state"); + QUIT default: - PARSEERROR("header modifier with unknown glyph") - break; + croak("_failure_unknown_glyph"); + QUIT } - // FIXME: not every legal varname is a mmp varname + // FIXME: not every legal varname is a routing varname // look at shared_memory("routing") if (!legal_keyword(vname) || abbrev("_INTERNAL", vname)) { - PARSEERROR("illegal varname in header") + croak("_error_illegal_protocol_variable", 0, + ([ "_variable_name": vname ])); + return 0; } } return vars; @@ -158,7 +158,8 @@ void parse_header() { buffer = buffer[1..]; break; default: - PARSEERROR("noglyph") + croak("_error_syntax_expected_routing"); + QUIT } fit = sscanf(buffer, "%.1s%t", vname); if (fit != 1) { @@ -222,6 +223,7 @@ void parse_psyc() { PARSEERROR("negative binary length") } if (strlen(body_buffer) < len) { + // ouch, this is a problem here PARSEERROR("not enough to read binary arg, may not happen") } vvalue = body_buffer[..len-1]; @@ -290,9 +292,9 @@ void parse_content() { } fit = sscanf(body_buffer, "%.1s\n%.0s", method, body_buffer); if (fit != 2 || !legal_keyword(method)) { - croak("_error_illegal_method", - "That's not a valid method name."); - return; // NOTREACHED + croak("_error_illegal_method"); + // "That's not a valid method name."); + return; } // mhmm... why does body_buffer still contain the newline? @@ -359,8 +361,8 @@ void step() { first_response(); step(); } else { - croak("_error_syntax_initialization", - "The new protocol begins with a pipe and a line feed."); + croak("_error_syntax_initialization"); + // "The new protocol begins with a pipe and a line feed."); } break; default: // uhm... if we ever get here this is the programmers fault From b00a28cbfa82cc8cb295c60d17fdc4dc2fcee0c5 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Mon, 28 Dec 2009 04:29:22 +0100 Subject: [PATCH 10/12] rkeywordgrep --- utility/rkeywordgrep | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 utility/rkeywordgrep diff --git a/utility/rkeywordgrep b/utility/rkeywordgrep new file mode 100755 index 0000000..e4adb3d --- /dev/null +++ b/utility/rkeywordgrep @@ -0,0 +1,42 @@ +#!/usr/bin/perl +# +# recursive PSYC keyword (methods, variables) collector --lynx98 +# you may like how it looks after a subsequent sort +# see also http://about.psyc.eu/Rename + +require 'find.pl'; + +$flags = ''; +$flags = shift if $ARGV[0] =~ /^-/; +$verbose = $flags !~ /s/; + +$|=1; +&find($#ARGV >= 0 ? @ARGV : '.'); +print STDERR '=' x 78, "\n" if $verbose; +exit; + + +sub wanted { + ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, + $atime,$mtime,$ctime,$blksize,$blocks) + = lstat; + + return unless /\.[chi]$/ or /\.gen$/; + return if -d _; +# return unless $blocks; # skip symlinks + return if $size < 10; + + if ($verbose) { + $len = length $name; + print STDERR $name, ' ', '=' x (77-$len), "\r" if $len < 77; + } + + if (open(I, $_)) { + while() { + printf "%-41s -\t$name\n", $1 while s/"(_\w+)"/"got"/; + } + close I; + } else { + print STDERR "$name: $!\n"; + } +} From 7c9a7e82dd12df930dccfa9e72d61e8037a8c1c3 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 31 Dec 2009 19:28:27 +0100 Subject: [PATCH 11/12] + --- world/default/de/plain.textdb | 3 +++ world/default/en/plain.textdb | 12 ++++++++++++ world/net/psyc/active.c | 2 +- world/net/twitter/polly.c | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/world/default/de/plain.textdb b/world/default/de/plain.textdb index c0f94ec..f35a39d 100644 --- a/world/default/de/plain.textdb +++ b/world/default/de/plain.textdb @@ -551,6 +551,9 @@ _request_description _request_open_page |Bitte folgende Seite aufrufen: [_page] +_request_open_page_login +|Bitte öffne [_page_login] um einzuloggen. + _request_open_page_edit |Zur Bearbeitung der Einstellungen bitte folgende Seite aufrufen: |[_page_edit] diff --git a/world/default/en/plain.textdb b/world/default/en/plain.textdb index 4527c01..1306ba8 100644 --- a/world/default/en/plain.textdb +++ b/world/default/en/plain.textdb @@ -1,6 +1,18 @@ ## vim:syntax=mail ## Check utf-8: Praise Atatürk! +_failure_unavailable_state +|State module is not available as yet. + +_failure_unknown_glyph +|Unknown modifier glyph encountered. + +_error_illegal_protocol_variable +|You are not allowed to present a variable named [_variable_name]. + +_error_type_degree +|Your value for variable [_variable] does not qualify for a degree. + _error_necessary_nick_local |This command only accepts local nicknames. diff --git a/world/net/psyc/active.c b/world/net/psyc/active.c index 80d2d1e..ef2d683 100644 --- a/world/net/psyc/active.c +++ b/world/net/psyc/active.c @@ -70,7 +70,7 @@ int msg(string source, string method, string data, return ::msg(source, method, data, vars, showingLog, target); #else // }}} { - P2(("%O ist nicht interactive\n", ME)) + P2(("%O is not interactive (no network connection)\n", ME)) if (!member(vars, "_source")) vars["_source"] = UNIFORM(source); // this stuff is causing loops and i don't know how to fix it right now diff --git a/world/net/twitter/polly.c b/world/net/twitter/polly.c index 2fd03a1..fb9d922 100644 --- a/world/net/twitter/polly.c +++ b/world/net/twitter/polly.c @@ -28,7 +28,7 @@ parse(string body, mapping headers) { P4((body)) //#endif unless (pointerp(wurst = parse_json(body))) { - monitor_report("_failure_network_fetch_twitter_empty", + monitor_report("_failure_network_fetch_twitter_broken", "[_source] failed to parse its timeline"); return; } From 0050ebd46b8c6bfdae7fde4e2b8784954833973f Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 31 Dec 2009 21:39:07 +0100 Subject: [PATCH 12/12] route local xmpp: uniforms (thx indigo6) --- world/default/en/plain.textdb | 2 +- world/net/library.i | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/world/default/en/plain.textdb b/world/default/en/plain.textdb index 1306ba8..1faa626 100644 --- a/world/default/en/plain.textdb +++ b/world/default/en/plain.textdb @@ -1353,7 +1353,7 @@ _notice_link_service _notice_link |[_location] linked to [_identification]. -|You are now connected to this big marshmellow in the sky. +|## You are now connected to this big marshmellow in the sky. _notice_unlink_exit |I wish you good sleep or a fun night-out. diff --git a/world/net/library.i b/world/net/library.i index 3ef9933..a82aab0 100644 --- a/world/net/library.i +++ b/world/net/library.i @@ -812,10 +812,23 @@ varargs mixed sendmsg(mixed target, string mc, mixed data, vamapping vars, // fall thru case "xmpp": #ifdef SWITCH2PSYC + // maybe we should treat all of this just as if + // no scheme was given (jid treatment below) P4(("LOOKing for %O in %O\n", "psyc://"+u[UHost]+"/", targets)) tmp = targets["psyc://"+u[UHost]+"/"]; - if (tmp) { // && interactive(tmp)) { + if (tmp) { + // are we talking to our own net/root? + // in the past we used interactive() here + unless (clonep(tmp)) { + tmp = summon_person(u[UNick]); + unless (tmp) { + // doesn't have to be an error.. use jid treatment below? + sendmsg(source, "_failure_unavailable_route_place_XMPP", + "Sorry, you can't talk to a local chatroom via XMPP uniform."); + return 0; + } + } PT(("SWITCH2PSYC delivery %O for %O (%s)\n", tmp, target, mc || "0")) // we should very probably generate a redirect here instead! TODO