mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
things that happened in 2008
This commit is contained in:
parent
8f98522570
commit
94530cc322
136 changed files with 3222 additions and 2873 deletions
|
@ -1,3 +1,7 @@
|
|||
# This Makefile is for developers who edit profiles.pl only.
|
||||
# If this file contains funny stuff, it has been corrupted by
|
||||
# an evil program in your LPC sandbox. ;-D
|
||||
|
||||
it: profiles.c
|
||||
|
||||
profiles.c: profiles.pl
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// $Id: admin.c,v 1.26 2007/08/20 12:25:23 lynx Exp $ // vim:syntax=lpc
|
||||
// $Id: admin.c,v 1.27 2008/10/07 12:27:25 lynx Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// admin functions and shutdown procedure
|
||||
//
|
||||
|
@ -42,7 +42,7 @@ varargs int server_shutdown(string reason, int restart, int pass) {
|
|||
#ifdef DEFAULT_SHUTDOWN_REASON
|
||||
reason = DEFAULT_SHUTDOWN_REASON;
|
||||
#else
|
||||
reason = CHATNAME " is performing a quick full twist double "
|
||||
reason = SERVER_HOST " is performing a quick full twist double "
|
||||
"salto backwards.";
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// vim:syntax=lpc
|
||||
// info: to unfold and view the complete file, hit zR in your vim command mode.
|
||||
//
|
||||
// $Id: dns.c,v 1.112 2008/03/29 20:05:32 lynx Exp $
|
||||
// $Id: dns.c,v 1.113 2008/09/12 15:54:39 lynx Exp $
|
||||
//
|
||||
// {{{ meta-bla about foldmethod=marker
|
||||
// <lynX> hm.. find ich folding jetzt eher nützlich oder lästig? muss ich
|
||||
|
@ -53,9 +53,9 @@ volatile mapping localhosts = ([
|
|||
#endif
|
||||
// the hostnames need to be in lowercase... lets do it later
|
||||
// SERVER_HOST : 1,
|
||||
#if defined(JABBER_HOST)
|
||||
# if JABBER_HOST != SERVER_HOST
|
||||
// JABBER_HOST : 1,
|
||||
#if defined(_host_XMPP)
|
||||
# if _host_XMPP != SERVER_HOST
|
||||
// _host_XMPP : 1,
|
||||
# endif
|
||||
#endif
|
||||
]);
|
||||
|
|
|
@ -72,7 +72,9 @@ string make_json(mixed d) {
|
|||
P3(("\nintermediate: %O\n", m_values(x)))
|
||||
return "{"+ implode(m_values(x), ",") +"}";
|
||||
#endif
|
||||
}
|
||||
} else if (objectp(d))
|
||||
return "\'"+ psyc_name(d) +"\'";
|
||||
return "00";
|
||||
}
|
||||
|
||||
// see also net/place/storic.c for a JSON generator limited and optimized
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// vim:syntax=lpc
|
||||
// $Id: jsonparser.pike,v 1.2 2006/10/25 17:50:11 lynx Exp $
|
||||
// $Id: jsonparser.pike,v 1.5 2008/08/05 12:21:34 lynx Exp $
|
||||
//
|
||||
// I really hate those comments.
|
||||
//
|
||||
|
@ -107,6 +107,9 @@ PROTECTED void back() {
|
|||
myIndex -= 1;
|
||||
}
|
||||
|
||||
#ifndef GAMMA
|
||||
// funny.. we already have two better ways to do hex2int than this:
|
||||
//
|
||||
/// <summary>
|
||||
/// Get the hex value of a character (base16).
|
||||
/// </summary>
|
||||
|
@ -130,6 +133,7 @@ PROTECTED int dehexchar(int c) {
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the source string still contains characters that next() can consume.
|
||||
|
@ -331,12 +335,17 @@ PROTECTED varargs string unescape(string s)
|
|||
if (c == '+') {
|
||||
c = ' ';
|
||||
} else if (c == '%' && (i + 2 < len)) {
|
||||
#ifndef GAMMA
|
||||
int d = dehexchar(s[i+1]);
|
||||
int e = dehexchar(s[i+2]);
|
||||
if (d >= 0 && e >= 0) {
|
||||
c = (d*16 + e);
|
||||
i += 2;
|
||||
}
|
||||
#else
|
||||
i += 2;
|
||||
c = hex2int(s[i-1 .. i]);
|
||||
#endif
|
||||
}
|
||||
sb+=int2char(c);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// $Id: legal.c,v 1.16 2008/02/10 14:27:17 lynx Exp $ // vim:syntax=lpc
|
||||
// $Id: legal.c,v 1.18 2008/07/26 10:54:31 lynx Exp $ // vim:syntax=lpc
|
||||
#include <net.h>
|
||||
|
||||
// legal nickname/placename test..
|
||||
|
@ -21,7 +21,7 @@ string legal_name(string n) {
|
|||
}
|
||||
#endif
|
||||
// this saves applet/user from malfunction!
|
||||
if (index("!=-", n[0]) != -1) {
|
||||
if (index("!=-0123456789", n[0]) != -1) {
|
||||
P1(("not legal_name: %O has !=- as first char.\n", n))
|
||||
return 0;
|
||||
}
|
||||
|
@ -49,7 +49,8 @@ array(string) legal_password(string pw, string nick) {
|
|||
return ({ "_error_illegal_password_size",
|
||||
"That password is too short.\n" });
|
||||
|
||||
if (index(pw, '<') != -1 || index(pw, '>') != -1)
|
||||
if (index(pw, '<') != -1 || index(pw, '>') != -1 ||
|
||||
index(pw, ' ') != -1)
|
||||
return ({ "_error_illegal_password_characters",
|
||||
"Password contains illegal characters.\n" });
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<body bgcolor="#ff9900" text=black link=red vlink=black>
|
||||
<h1>PROFILING FIELD NAMES COMPARISON CHART</h1>
|
||||
<table cellspacing=2>
|
||||
<tr align=left><th>PSYC</th><th>/set</th><th>jProf</th><th>vCard</th><th>jCard</th><th>LDAP</th><th>FOAF</th></tr>
|
||||
<tr align=left><th>PSYC<br>variable</th><th>/set<br>command</th><th>jProf<br>XEP-0154</th><th>vCard<br>RFC 2426</th><th>jCard<br>XEP-0054</th><th>LDAP</th><th>FOAF</th></tr>
|
||||
<tr><td>_INTERNAL_image_photo</td><td></td><td>photo_data</td><td>PHOTO</td><td>PHOTO/BINVAL</td><td>jpegPhoto</td><td></td></tr>
|
||||
<tr><td>_INTERNAL_type_image_photo</td><td></td><td></td><td></td><td>PHOTO/TYPE</td><td></td><td></td></tr>
|
||||
<tr><td>_action_ask</td><td>askaction</td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
#!/usr/bin/perl
|
||||
# $Id: profiles.pl,v 1.54 2008/04/11 10:37:25 lynx Exp $
|
||||
# $Id: profiles.pl,v 1.56 2008/10/07 12:27:25 lynx Exp $
|
||||
#
|
||||
# generator of mappings between several profile file formats -lynX 2005
|
||||
# part of the psyced project. see documentation for copyrights and licenses.
|
||||
#
|
||||
# see below __DATA__ for the actual mapping data
|
||||
# this is just the perl program to make use of the data
|
||||
#
|
||||
# you should not be running this program yourself. it is a tool for the
|
||||
# developers, only. if you see funny modifications to this file, one of
|
||||
# your LPC apps is trying to break out of its sandbox by horsing you into
|
||||
# a trojan here. then of course you will read this message only if you are
|
||||
# wise enough to compare the file with the original from the distribution. ;)
|
||||
# but why should you come here to run this, anyway?
|
||||
|
||||
while (<main::DATA>) {
|
||||
next if /^\s*$/;
|
||||
|
@ -40,7 +47,7 @@ print O <<X;
|
|||
<h1>PROFILING FIELD NAMES COMPARISON CHART</h1>
|
||||
<table cellspacing=2>
|
||||
X
|
||||
print O "<tr align=left><th>PSYC</th><th>/set</th><th>jProf</th><th>vCard</th><th>jCard</th><th>LDAP</th><th>FOAF</th></tr>\n";
|
||||
print O "<tr align=left><th>PSYC<br>variable</th><th>/set<br>command</th><th>jProf<br>XEP-0154</th><th>vCard<br>RFC 2426</th><th>jCard<br>XEP-0054</th><th>LDAP</th><th>FOAF</th></tr>\n";
|
||||
foreach $k ( sort keys %psyc ) {
|
||||
print O "<tr><td>$k</td><td>$set{$k}</td><td>$jProf{$k}</td><td>$vCard{$k}</td><td>$jCard{$k}</td><td>$LDAP{$k}</td><td>$FOAF{$k}</td></tr>\n";
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// $Id: share.c,v 1.20 2008/02/10 11:31:10 lynx Exp $ // vim:syntax=lpc
|
||||
// $Id: share.c,v 1.25 2008/12/04 14:20:52 lynx Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// verrry simple way to keep single sets of data for all kinds of purposes.
|
||||
//
|
||||
|
@ -21,8 +21,8 @@
|
|||
|
||||
// share already contains "preset" data sets
|
||||
volatile mapping share = ([
|
||||
// 'mmp vars' belongs into here aswell.. TODO
|
||||
#ifdef JABBER_PATH
|
||||
# ifndef _flag_disable_module_presence
|
||||
"jabber2avail": ([
|
||||
0 : AVAILABILITY_HERE,
|
||||
"chat" : AVAILABILITY_TALKATIVE,
|
||||
|
@ -45,6 +45,8 @@ volatile mapping share = ([
|
|||
8 : "excited", // not bright
|
||||
9 : "invincible", // not nirvana
|
||||
]),
|
||||
# endif // _flag_disable_module_presence
|
||||
# ifndef _flag_disable_query_server
|
||||
"disco_identity" : ([
|
||||
"administrator" : "admin",
|
||||
"newbie" : "anonymous",
|
||||
|
@ -69,13 +71,17 @@ volatile mapping share = ([
|
|||
"private" : "muc_hidden",
|
||||
"persistent" : "muc_persistent",
|
||||
"temporary" : "muc_temporary",
|
||||
#ifndef _flag_disable_registration_XMPP
|
||||
"registration" : "jabber:iq:register",
|
||||
#endif
|
||||
"offlinestorage" : "msgoffline",
|
||||
"version" : "jabber:iq:version",
|
||||
"lasttime" : "jabber:iq:last",
|
||||
"time" : "jabber:iq:time",
|
||||
]),
|
||||
# endif // _flag_disable_query_server
|
||||
#endif
|
||||
#ifndef _flag_disable_module_presence
|
||||
// even if _degree_availability says it all, we still need
|
||||
// a string to feed to the textdb - even if it were only internal
|
||||
"avail2mc": ([
|
||||
|
@ -103,7 +109,9 @@ volatile mapping share = ([
|
|||
8 : "_bright",
|
||||
9 : "_nirvana",
|
||||
]),
|
||||
// see peers.h for these
|
||||
#endif // _flag_disable_module_presence
|
||||
#ifndef _flag_disable_module_friendship
|
||||
// see peers.h for these
|
||||
"ppl2psyc": ([
|
||||
PPL_DISPLAY : "_display",
|
||||
PPL_NOTIFY : "_notification",
|
||||
|
@ -125,11 +133,12 @@ volatile mapping share = ([
|
|||
PPL_NOTIFY_OFFERED : "_offered",
|
||||
PPL_NOTIFY_NONE : "_none",
|
||||
]),
|
||||
#endif
|
||||
// this table defines variable names to go into the routing layer
|
||||
// of PSYC. default is to handle them locally in the routing layer
|
||||
// PSYC_ROUTING_MERGE means to merge them into end-to-end vars at
|
||||
// parsing time. PSYC_ROUTING_RENDER to accept and render them from
|
||||
// application provided vars.
|
||||
// application provided vars. same data structure also in Net::PSYC.pm
|
||||
"routing": ([
|
||||
"_amount_fragments" : PSYC_ROUTING,
|
||||
"_context" : PSYC_ROUTING + PSYC_ROUTING_MERGE,
|
||||
|
@ -153,6 +162,8 @@ volatile mapping share = ([
|
|||
PSYC_ROUTING + PSYC_ROUTING_MERGE + PSYC_ROUTING_RENDER,
|
||||
#endif
|
||||
"_target" : PSYC_ROUTING + PSYC_ROUTING_MERGE,
|
||||
"_target_forward" : PSYC_ROUTING + PSYC_ROUTING_MERGE
|
||||
+ PSYC_ROUTING_RENDER, // new!
|
||||
"_target_relay" : PSYC_ROUTING + PSYC_ROUTING_MERGE,
|
||||
"_understand_modules" : PSYC_ROUTING,
|
||||
"_using_modules" : PSYC_ROUTING,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// $Id: text.c,v 1.17 2008/04/11 10:37:25 lynx Exp $ // vim:syntax=lpc
|
||||
// $Id: text.c,v 1.21 2008/07/17 17:23:25 lynx Exp $ // vim:syntax=lpc
|
||||
//
|
||||
// the marvellous psyctext() function, fundamental of any PSYC implementation.
|
||||
//
|
||||
|
@ -35,9 +35,14 @@ varargs string psyctext(string s, mapping m, vastring data,
|
|||
if (v == "_nick") r += p + (nick || m["_nick"]);
|
||||
else if (v == "_data") r += p + (data || "");
|
||||
else unless (member(m, v)) {
|
||||
if (v == "_source") r += p + to_string(source);
|
||||
if (v == "_source") r += p + UNIFORM(source);
|
||||
else {
|
||||
PT(("psyctext: ignoring [%s]\n", v))
|
||||
#ifdef _flag_debug_unresolved_psyctext
|
||||
raise_error(v +" unresolved in psyctext format\n");
|
||||
#else
|
||||
PT(("psyctext: ignoring [%s] in %O for %O\n", v,
|
||||
data, previous_object()))
|
||||
#endif
|
||||
r += p + "["+v+"]"; // pretend we havent seen it
|
||||
}
|
||||
}
|
||||
|
@ -47,21 +52,16 @@ varargs string psyctext(string s, mapping m, vastring data,
|
|||
}
|
||||
// if (member(m,v) && m[v]) r += p + m[v];
|
||||
else if (intp(m[v])) { // used by /lu and /edit
|
||||
if (v == "_time_idle") r += p + timedelta(m[v]);
|
||||
else if (abbrev("_time", v)) {
|
||||
// verrry similar code in net/user.c
|
||||
if (time() - m[v] > 24*60*60)
|
||||
r += p + isotime( m[v], 0 );
|
||||
else
|
||||
r += p + hhmmss(ctime( m[v] ));
|
||||
// r += p + hhmm(ctime(m[v]));
|
||||
} else
|
||||
if (v == "_time_idle")
|
||||
r += p + timedelta(m[v]);
|
||||
else if (abbrev("_time", v))
|
||||
r += p + time_or_date(m[v]);
|
||||
else
|
||||
r += p + to_string(m[v]);
|
||||
}
|
||||
else if (mappingp(m[v])) { // made by psyc/parse
|
||||
r += p + implode(m_indices(m[v]), ", ");
|
||||
}
|
||||
// used in rare cases where _identification is output
|
||||
else if (objectp(m[v])) r += p + psyc_name(m[v]);
|
||||
else {
|
||||
// in theory at this point we could perform
|
||||
|
|
|
@ -7,12 +7,6 @@ mapping tls_certificate(object who, int longnames) {
|
|||
cert = ([ ]);
|
||||
#if __EFUN_DEFINED__(tls_check_certificate)
|
||||
# ifdef WANT_S2S_SASL
|
||||
/*
|
||||
* some platforms (notably cygwin) still have a problem executing the following
|
||||
* #if ... even psyclpc bails out with an "illegal unary operator in #if"
|
||||
* which is nonsense. i simplify this by ifdeffing for psyclpc.
|
||||
*/
|
||||
//# if (__VERSION_MAJOR__ == 3 && __VERSION_MICRO__ > 712) || __VERSION_MAJOR__ > 3
|
||||
# ifdef __psyclpc__
|
||||
# if __EFUN_DEFINED__(enable_binary) // happens to be committed at the same time
|
||||
extra = tls_check_certificate(who, 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue