mirror of
https://github.com/ChronosX88/psyced.git
synced 2024-11-08 11:31:01 +00:00
things that happened in 2008
This commit is contained in:
parent
8f98522570
commit
94530cc322
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
CVS
|
CVS
|
||||||
|
.config
|
||||||
~$*
|
~$*
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.metadata
|
.metadata
|
||||||
|
757
CHANGESTODO
757
CHANGESTODO
File diff suppressed because it is too large
Load Diff
47
bin/psyconf
Normal file → Executable file
47
bin/psyconf
Normal file → Executable file
@ -6,7 +6,7 @@
|
|||||||
# psyconf(8) - tool that generates psyc configuration
|
# psyconf(8) - tool that generates psyc configuration
|
||||||
# files out of a common psyced.ini
|
# files out of a common psyced.ini
|
||||||
#
|
#
|
||||||
# $Id: psyconf,v 1.75 2008/02/08 11:44:57 lynx Exp $
|
# $Id: psyconf,v 1.80 2008/10/26 15:24:01 lynx Exp $
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ sub say {
|
|||||||
use Getopt::Std;
|
use Getopt::Std;
|
||||||
&getopt;
|
&getopt;
|
||||||
|
|
||||||
print STDERR '$Id: psyconf,v 1.75 2008/02/08 11:44:57 lynx Exp $', "\n";
|
print STDERR '$Id: psyconf,v 1.80 2008/10/26 15:24:01 lynx Exp $', "\n";
|
||||||
|
|
||||||
my $conf = shift || 'psyced.ini';
|
my $conf = shift || 'psyced.ini';
|
||||||
$conf = '/etc/psyc/psyced.ini' unless -r $conf;
|
$conf = '/etc/psyc/psyced.ini' unless -r $conf;
|
||||||
@ -127,31 +127,39 @@ sub say {
|
|||||||
my $config = $c{_basic_path_configuration} || $base;
|
my $config = $c{_basic_path_configuration} || $base;
|
||||||
# this isn't taking $ARCH_DIR from install.sh into account
|
# this isn't taking $ARCH_DIR from install.sh into account
|
||||||
# but maybe it shouldn't anyway..
|
# but maybe it shouldn't anyway..
|
||||||
|
say "Looking for driver in $arch/$driver\n";
|
||||||
unless (-x $arch && -x "$arch/$driver") {
|
unless (-x $arch && -x "$arch/$driver") {
|
||||||
$arch = "$base/bin-$_type_system";
|
$arch = "$base/bin-$_type_system";
|
||||||
|
say "Looking for driver in $arch/$driver\n";
|
||||||
unless (-x $arch && -x "$arch/$driver") {
|
unless (-x $arch && -x "$arch/$driver") {
|
||||||
$arch = "$base/bin-linux";
|
$arch = "$base/bin-linux";
|
||||||
|
say "Looking for driver in $arch/$driver\n";
|
||||||
if (-x $arch && -x "$arch/$driver") {
|
if (-x $arch && -x "$arch/$driver") {
|
||||||
say "\nBug in $0: We didn't find $base/bin-linux in the appropriate way.\nThat's not nice. Continuing however.\n"
|
say "\nBug in $0: We didn't find $base/bin-linux in the appropriate way.\nThat's not nice. Continuing however.\n"
|
||||||
} elsif (not -x ($arch = "$base/bin") && -x "$arch/$driver") {
|
} elsif (not -x ($arch = "$base/bin") && -x "$arch/$driver") {
|
||||||
|
say "Looking for driver in $arch/$driver\n";
|
||||||
# bad place for psyclpc really..
|
# bad place for psyclpc really..
|
||||||
# since it is usually of no commandline use
|
# since it is usually of no commandline use
|
||||||
# but where else should psyclpc.ebuild
|
# but where else should psyclpc.ebuild
|
||||||
# install it? in /opt/psyclpc? for two files?
|
# install it? in /opt/psyclpc? for two files?
|
||||||
$arch = "/usr/sbin";
|
$arch = "/usr/sbin";
|
||||||
|
say "Looking for driver in $arch/$driver\n";
|
||||||
# the following is very unlikely to happen:
|
# the following is very unlikely to happen:
|
||||||
die <<X unless -x $arch && -x "$arch/$driver";
|
die <<X unless -x $arch && -x "$arch/$driver";
|
||||||
could not find any directory containing $driver.
|
Could not find any directory containing $driver.
|
||||||
X
|
X
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
say "Found driver in $arch/$driver\n";
|
||||||
|
|
||||||
my $user = $c{_basic_system_user} || 'daemon';
|
my $user = $c{_basic_system_user} || 'daemon';
|
||||||
my ($login,$pass,$uid,$gid) = getpwnam($user)
|
my ($login,$pass,$uid,$gid) = getpwnam($user)
|
||||||
or die "uid '$user' not defined on this system";
|
or die "uid '$user' not defined on this system";
|
||||||
# this doesn't mean psyconf is intended to run as $user too!!
|
# this doesn't mean psyconf is intended to run as $user too!!
|
||||||
say "psyced will later be running as user $user ($uid:$gid)\n";
|
say "psyced must later be running as user $user ($uid:$gid)\n";
|
||||||
|
# will automatically, when started via etc/init.d but if you
|
||||||
|
# start it manually, you have to switch to that user yourself
|
||||||
|
|
||||||
my $ho = $c{_basic_host_name} || $ENV{HOST} || 'psyc';
|
my $ho = $c{_basic_host_name} || $ENV{HOST} || 'psyc';
|
||||||
my $chatname = $c{_basic_nick_server} ||
|
my $chatname = $c{_basic_nick_server} ||
|
||||||
@ -259,6 +267,7 @@ X
|
|||||||
// CAUTION! This file has been generated using $0.
|
// CAUTION! This file has been generated using $0.
|
||||||
// Don't edit unless you are no longer going to use the configuration tool.
|
// Don't edit unless you are no longer going to use the configuration tool.
|
||||||
// Edit $conf instead, then run $0 again.
|
// Edit $conf instead, then run $0 again.
|
||||||
|
// If you want to tune psyced, edit local.h instead!
|
||||||
|
|
||||||
X
|
X
|
||||||
if ( $c{_optional_config_HTTP} ) {
|
if ( $c{_optional_config_HTTP} ) {
|
||||||
@ -365,25 +374,33 @@ X
|
|||||||
#WARNING: Because of some funny bug the driver will probably not bind properly
|
#WARNING: Because of some funny bug the driver will probably not bind properly
|
||||||
#to _basic_host_IP as it also needs _basic_host_name and _basic_host_domain
|
#to _basic_host_IP as it also needs _basic_host_name and _basic_host_domain
|
||||||
#to be provided. Hopefully this shortcoming will soon be history.
|
#to be provided. Hopefully this shortcoming will soon be history.
|
||||||
#In the meantime please re-edit the psyconf.ini to provide all variables.
|
#In the meantime please re-edit the psyced.ini to provide all variables.
|
||||||
print STDERR <<X if $hc == 1;
|
print STDERR <<X if $hc == 1;
|
||||||
|
|
||||||
WARNING: _basic_host_IP, _basic_host_name and _basic_host_domain need to be
|
WARNING: _basic_host_IP, _basic_host_name and _basic_host_domain need to be
|
||||||
provided together as the driver won't figure out the proper name for the IP
|
provided together as the driver won't figure out the proper name for the IP
|
||||||
number or vice versa. Please re-edit the psyconf.ini to provide all variables.
|
number or vice versa. Please re-edit the psyced.ini to provide all variables.
|
||||||
|
|
||||||
X
|
X
|
||||||
if ($c{_protocols_use_encryption}) {
|
if ($c{_protocols_use_encryption}) {
|
||||||
$psyced .= " --tls-key $config/$c{_basic_path_PEM_key}"
|
my $t = $c{_basic_path_PEM_key};
|
||||||
if $c{_basic_path_PEM_key};
|
if ($t) {
|
||||||
$psyced .= " --tls-cert $config/$c{_basic_path_PEM_certificate}"
|
$t = "$config/$t" unless $t =~ m#^/#;
|
||||||
if $c{_basic_path_PEM_certificate};
|
$psyced .= " --tls-key $t";
|
||||||
$psyced .= " --tls-trustdirectory $config/$c{_basic_path_trust}"
|
}
|
||||||
if $c{_basic_path_trust};
|
if ($t = $c{_basic_path_PEM_certificate}) {
|
||||||
|
$t = "$config/$t" unless $t =~ m#^/#;
|
||||||
|
$psyced .= " --tls-cert $t";
|
||||||
|
}
|
||||||
|
if ($t = $c{_basic_path_trust}) {
|
||||||
|
$t = "$config/$t" unless $t =~ m#^/#;
|
||||||
|
$psyced .= " --tls-trustdirectory $t";
|
||||||
|
}
|
||||||
# ldmud doesn't support this yet
|
# ldmud doesn't support this yet
|
||||||
# $psyced .= " --tlscrldirectory $config/$c{_basic_path_revocation}"
|
# $psyced .= " --tlscrldirectory $config/$c{_basic_path_revocation}"
|
||||||
# if $c{_basic_path_revocation};
|
# if $c{_basic_path_revocation};
|
||||||
}
|
}
|
||||||
|
$psyced .= ' '. $c{_optional_extra_debug} if $c{_optional_extra_debug};
|
||||||
|
|
||||||
# you can divert UDP if you know what you are doing.
|
# you can divert UDP if you know what you are doing.
|
||||||
my $portUDP = $c{_protocols_port_UDP} || $c{_protocols_port_PSYC};
|
my $portUDP = $c{_protocols_port_UDP} || $c{_protocols_port_PSYC};
|
||||||
@ -545,6 +562,12 @@ X
|
|||||||
chmod 0744, $t;
|
chmod 0744, $t;
|
||||||
chown $uid, $gid, $t if $uid;
|
chown $uid, $gid, $t if $uid;
|
||||||
|
|
||||||
|
# TODO: generate a psyced.gdb file kind of like this
|
||||||
|
print <<X if 0;
|
||||||
|
file /bin/psyclpc
|
||||||
|
run -DDEBUG=1 -u 4404 4404 2323 6667 5222 9999 etc. whatever flags necessary
|
||||||
|
X
|
||||||
|
|
||||||
# PSYCED INIT.D SCRIPT
|
# PSYCED INIT.D SCRIPT
|
||||||
$t = "$base/etc";
|
$t = "$base/etc";
|
||||||
mkdir($t);
|
mkdir($t);
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
# you can also create a ~/.cvsrc where you keep your favorite
|
# you can also create a ~/.cvsrc where you keep your favorite
|
||||||
# cvs flags. we recommend to put 'cvs -z9' in there
|
# cvs flags. we recommend to put 'cvs -z9' in there
|
||||||
|
|
||||||
#alias cup cvs -q update -d # was, until de/irc was deleted
|
alias difvu 'vim -R "+set syntax=diff"'
|
||||||
|
|
||||||
alias cup cvs -q update -dP
|
alias cup cvs -q update -dP
|
||||||
|
alias sup svn update
|
||||||
|
alias gup '(git fetch origin && git diff master..origin/master && git merge origin) |& difvu -'
|
||||||
|
|
||||||
alias ci cvs ci
|
alias ci cvs ci
|
||||||
alias ci+ cvs ci -m +
|
alias ci+ cvs ci -m +
|
||||||
@ -17,13 +20,21 @@ alias cvsaddr 'cvs add `find . -name "*CVS*" -prune -o -print`'
|
|||||||
# how to add a binary file.. cause i never remember!!
|
# how to add a binary file.. cause i never remember!!
|
||||||
alias cvsaddbin 'cvs add -kb'
|
alias cvsaddbin 'cvs add -kb'
|
||||||
|
|
||||||
alias canno 'cvs annotate \!*|vim -R -'
|
alias cblame 'cvs annotate \!*|& $PAGER'
|
||||||
alias cdif 'cvs diff -bur HEAD \!* |& egrep -v " (Diffing |no longer exists)"|vim -R "+set syntax=diff" -'
|
|
||||||
|
alias cdiff 'cvs diff -bpu8r'
|
||||||
|
alias gdiff 'git-diff -b'
|
||||||
|
alias cdifr 'cdiff \!* |& egrep -v " (Diffing |no longer exists)"|& difvu -'
|
||||||
|
alias sdifr 'svn diff -r \!* |& difvu -'
|
||||||
|
alias gdifr 'gdiff \!* |& difvu -'
|
||||||
|
alias cdif 'cdifr HEAD'
|
||||||
|
alias sdif 'sdifr HEAD'
|
||||||
|
alias gdif 'gdifr HEAD'
|
||||||
|
|
||||||
alias Ci '(cd $PSYCEDHOME;ci)'
|
alias Ci '(cd $PSYCEDHOME;ci)'
|
||||||
alias Cup '(cd $PSYCEDHOME;cup)'
|
alias Cup '(cd $PSYCEDHOME;cup)'
|
||||||
alias Cdif '(cd $PSYCEDHOME;cdif)'
|
alias Cdif '(cd $PSYCEDHOME;cdif)'
|
||||||
|
|
||||||
alias ctoc '(cd $CVSHOME;cvs diff -bur HEAD CHANGESTODO|vim -R "+set syntax=diff" -)'
|
alias ctoc '(cd $CVSHOME;cvs diff -bur HEAD CHANGESTODO|& difvu -'
|
||||||
alias ctodo '(cd $PSYCEDHOME;cvs update CHANGESTODO;x CHANGESTODO;cvs ci -m + CHANGESTODO)'
|
alias ctodo '(cd $PSYCEDHOME;cvs update CHANGESTODO;$EDITOR CHANGESTODO;cvs ci -m + CHANGESTODO)'
|
||||||
|
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
|
|
||||||
banner.txt is the file that is shown to
|
|
||||||
telnet users at login
|
|
||||||
|
|
||||||
config.c is currently not being used, really.
|
|
||||||
|
|
||||||
config.h is of no interest.
|
|
||||||
|
|
||||||
hosts.h lets you specify ip ranges that are
|
|
||||||
particularely trustworthy or untrustworthy.
|
|
||||||
|
|
||||||
init.ls contains the list of classes that
|
|
||||||
will be compiled at boot-time. it is mostly
|
|
||||||
useful for debugging, as in a healthy
|
|
||||||
system any required class can be compiled
|
|
||||||
at the moment it is used for the first time.
|
|
||||||
so for production use this is kept to the
|
|
||||||
bare minimum. only the parts of psyced you
|
|
||||||
are actually using will be loaded.
|
|
||||||
|
|
||||||
local.h hosts your personal tunings to the
|
|
||||||
psyced system.
|
|
||||||
|
|
||||||
path.h lets you rearrange the directories
|
|
||||||
where the code for the protocol implementations
|
|
||||||
reside. you don't need to do that normally.
|
|
||||||
|
|
||||||
ports.h is generated by the installation
|
|
||||||
procedure and contains the port numbers you
|
|
||||||
chose for the services you want to use.
|
|
||||||
|
|
||||||
psyconf.h is also generated that way by the
|
|
||||||
psyconf utility. it contains the settings
|
|
||||||
from psyced.ini in a form pleasant for LPC.
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
[connected]
|
|
||||||
|
|
||||||
PROTOCOL for SYNCHRONOUS CONFERENCING http://www.psyced.org/
|
|
||||||
--------------- ___ __ _ _ __ ___ __ ------------------
|
|
||||||
| \ (__ \ / / | | \
|
|
||||||
|__/ \ V | |- | )
|
|
||||||
>>> | (__/ | \__ |__ |_/ <<<
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
// $Id: config.c,v 1.9 2006/11/07 07:58:36 lynx Exp $ vim:syntax=lpc
|
|
||||||
#include <net.h>
|
|
||||||
|
|
||||||
/* a data file or an include can be read by any file in the system but
|
|
||||||
* we want this information to be readable by the gateway code only
|
|
||||||
* that's why it has to be lpc code
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef GATEWAY_PATH
|
|
||||||
|
|
||||||
/* if you are positive that you want to run your own gateways to
|
|
||||||
* legacy messaging systems, please insert your gateway credentials
|
|
||||||
* into the fields below and activate the code by turning #if 0 to #if 1
|
|
||||||
*
|
|
||||||
* update: these bot-style gateways are not functional. don't switch
|
|
||||||
* them to 1 as either the python scripts or the jabber code isn't
|
|
||||||
* up to date with them.
|
|
||||||
*/
|
|
||||||
|
|
||||||
# define USE_ICQ_GATEWAY 0 // don't change
|
|
||||||
# define USE_AIM_GATEWAY 0 // don't change
|
|
||||||
|
|
||||||
qConfig() {
|
|
||||||
string p = file_name(previous_object());
|
|
||||||
# ifdef __COMPAT_MODE__
|
|
||||||
p = "/"+p;
|
|
||||||
# endif
|
|
||||||
P3(("\n%O: config requested by %s\n", ME, p))
|
|
||||||
# if USE_ICQ_GATEWAY
|
|
||||||
if (abbrev(GATEWAY_PATH "icq", p)) return
|
|
||||||
(["host" : "icq.localhost",
|
|
||||||
"port" : 5234,
|
|
||||||
"scheme" : "icq",
|
|
||||||
"name" : "icqlinker",
|
|
||||||
"secret" : "myicqsecret",
|
|
||||||
"nickname" : "your uin here",
|
|
||||||
"password" : "and your password please" ]);
|
|
||||||
# endif
|
|
||||||
# if USE_AIM_GATEWAY
|
|
||||||
if (abbrev(GATEWAY_PATH "aim2", p)) return
|
|
||||||
(["host" : "aim.localhost",
|
|
||||||
"port" : 5233,
|
|
||||||
"scheme" : "aim",
|
|
||||||
"name" : "aimlinker",
|
|
||||||
"secret" : "myaimsecret",
|
|
||||||
"nickname" : "screen name",
|
|
||||||
"password" : "and your password please" ]);
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
load() {
|
|
||||||
# if USE_ICQ_GATEWAY
|
|
||||||
D(" " GATEWAY_PATH "icq");
|
|
||||||
load_object(GATEWAY_PATH "icq");
|
|
||||||
# endif
|
|
||||||
# if USE_AIM_GATEWAY
|
|
||||||
D(" " GATEWAY_PATH "aim2");
|
|
||||||
load_object(GATEWAY_PATH "aim2");
|
|
||||||
# endif
|
|
||||||
# ifdef RELAY_OBJECT
|
|
||||||
D(" " RELAY_OBJECT "\n");
|
|
||||||
call_out(load_object, 0, RELAY_OBJECT);
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,23 +0,0 @@
|
|||||||
// $Id: config.h,v 1.1 2007/04/26 13:34:02 lynx Exp $ // vim:syntax=lpc
|
|
||||||
//
|
|
||||||
// This file is not intended to be modified. Make your local changes
|
|
||||||
// in psyced.ini, and if that wasn't good enough, use local.h.
|
|
||||||
// If you are integrating psyced with other LPC applications, feel
|
|
||||||
// free to modify path.h. If you aren't, better leave it as it is.
|
|
||||||
|
|
||||||
#ifndef CONFIG_H
|
|
||||||
# define CONFIG_H
|
|
||||||
|
|
||||||
// load local modifications by the admin
|
|
||||||
# include "local.h"
|
|
||||||
|
|
||||||
// load port configuration as generated by psyconf
|
|
||||||
# include "ports.h"
|
|
||||||
|
|
||||||
// load layout of psyced software modules
|
|
||||||
# include "path.h"
|
|
||||||
|
|
||||||
// load psyced.ini settings converted by psyconf
|
|
||||||
# include "psyconf.h"
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,7 +0,0 @@
|
|||||||
// Examples of specially enabled or disabled hosts.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// #define ENABLED_HOSTS "192.168.0.", "10."
|
|
||||||
//
|
|
||||||
// #define DISABLED_HOSTS "207.46.197.", "207.46.19."
|
|
||||||
//
|
|
@ -1,3 +0,0 @@
|
|||||||
net/user
|
|
||||||
net/place/basic
|
|
||||||
local/config
|
|
@ -1,5 +0,0 @@
|
|||||||
// This is local.h for advanced tunings to the psyced runtime and
|
|
||||||
// LPC compilation process. The format looks just like a regular
|
|
||||||
// header file for the C language. Settings you can specify
|
|
||||||
// here are documented at http://about.psyc.eu/psyced#Tuning
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
|||||||
#ifndef _INCLUDE_PATH_H
|
|
||||||
#define _INCLUDE_PATH_H
|
|
||||||
|
|
||||||
#define NET_PATH "/net/"
|
|
||||||
#define PLACE_PATH "/place/"
|
|
||||||
#define SERVICE_PATH "/service/"
|
|
||||||
#define DATA_PATH "/data/"
|
|
||||||
#define CONFIG_PATH "/local/"
|
|
||||||
#define DAEMON_PATH NET_PATH "d/"
|
|
||||||
#define GATEWAY_PATH NET_PATH "gateway/"
|
|
||||||
|
|
||||||
// protocol for synchronous conferencing
|
|
||||||
#define PSYC_PATH "/net/psyc/"
|
|
||||||
|
|
||||||
// experimental PSYC 1.0 interface
|
|
||||||
#define SPYC_PATH "/net/spyc/"
|
|
||||||
|
|
||||||
// irc server emulation
|
|
||||||
#define IRC_PATH "/net/irc/"
|
|
||||||
|
|
||||||
// jabber server emulation
|
|
||||||
#define JABBER_PATH "/net/jabber/"
|
|
||||||
|
|
||||||
// telnet access
|
|
||||||
#define TELNET_PATH "/net/tn/"
|
|
||||||
|
|
||||||
// java applet server, uses a very simple protocol
|
|
||||||
#define APPLET_PATH "/net/applet/"
|
|
||||||
|
|
||||||
// accept messages and simple mails via smtp
|
|
||||||
#define SMTP_PATH "/net/smtp/"
|
|
||||||
|
|
||||||
// experimental: access message log via pop3
|
|
||||||
#define POP3_PATH "/net/pop/"
|
|
||||||
|
|
||||||
// experimental: serve as a sip "proxy"
|
|
||||||
#define SIP_PATH "/net/sip/"
|
|
||||||
|
|
||||||
// allow access to subscribed threaded discussion groups via nntp
|
|
||||||
#define NNTP_PATH "/net/nntp/"
|
|
||||||
|
|
||||||
// accept messages and allow lastlog access via wap
|
|
||||||
#define WAP_PATH "/net/wap/"
|
|
||||||
|
|
||||||
// simple http server
|
|
||||||
#ifndef HTTP_PATH
|
|
||||||
# define HTTP_PATH "/net/http/"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||||||
/* this file shall automatically be generated by psyconf.
|
|
||||||
*
|
|
||||||
* the values in here may be the same as in services.h
|
|
||||||
* or they may not. so always be conscious which ones you
|
|
||||||
* are using to which purpose. -lynX
|
|
||||||
*/
|
|
||||||
|
|
||||||
#echo This is just the demo ports.h. I shouldn't get loaded.
|
|
||||||
#echo If I do, then you didn't run psyconf successfully!!
|
|
||||||
|
|
||||||
#define PSYC_PORT 4404
|
|
||||||
|
|
||||||
#define HTTP_PORT 33333
|
|
||||||
#define HTTPS_PORT 34443
|
|
||||||
|
|
||||||
#define IRC_PORT 6667
|
|
||||||
#define IRCS_PORT 9999
|
|
||||||
|
|
||||||
#define JABBER_PORT 5222
|
|
||||||
#define JABBERS_PORT 5223
|
|
||||||
#define JABBER_S2S_PORT 5269
|
|
||||||
|
|
||||||
#define TELNET_PORT 2323
|
|
||||||
#define TELNETS_PORT
|
|
||||||
|
|
||||||
#define APPLET_PORT 2008
|
|
||||||
|
|
||||||
#define SMTP_PORT
|
|
||||||
#define SMTPS_PORT
|
|
||||||
|
|
||||||
#define NTTP_PORT
|
|
||||||
#define NNTPS_PORT
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
# $Header: /CVS/muveCVS/psycmuve/config/gentoo/psyced.ebuild,v 1.31 2007/09/24 22:16:19 lynx Exp $
|
# $Header: /CVS/muveCVS/psycmuve/config/gentoo/psyced.ebuild,v 1.32 2008/09/22 21:51:39 lynx Exp $
|
||||||
# Copyright 1999-2005 Gentoo Foundation
|
# Copyright 1999-2005 Gentoo Foundation
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
#
|
#
|
||||||
@ -76,8 +76,8 @@ src_install() {
|
|||||||
keepdir /var/${PN}/data/person
|
keepdir /var/${PN}/data/person
|
||||||
keepdir /var/${PN}/data/place
|
keepdir /var/${PN}/data/place
|
||||||
dodir /var/${PN}/config
|
dodir /var/${PN}/config
|
||||||
chmod -x config/default/*.*
|
chmod -x config/blueprint/*.*
|
||||||
cp -rp config/default/README config/default/*.* "${D}var/${PN}/config"
|
cp -rp config/blueprint/README config/blueprint/*.* "${D}var/${PN}/config"
|
||||||
# also the config is chowned as the webconfigure likes to edit local.h
|
# also the config is chowned as the webconfigure likes to edit local.h
|
||||||
chown -R ${PN}:psyc "${D}var/${PN}"
|
chown -R ${PN}:psyc "${D}var/${PN}"
|
||||||
einfo "Person, place and configuration data is kept in /var/${PN}"
|
einfo "Person, place and configuration data is kept in /var/${PN}"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile,v 1.16 2008/01/27 12:27:15 lynx Exp $
|
# $Id: Makefile,v 1.20 2008/11/20 13:45:58 lynx Exp $
|
||||||
#
|
#
|
||||||
# This Makefile serves the purpose to produce the files ebuild needs to be
|
# This Makefile serves the purpose to produce the files ebuild needs to be
|
||||||
# happy. So it is an ebuildbuilder. Targets are: ebuild, Manifest and clean.
|
# happy. So it is an ebuildbuilder. Targets are: ebuild, Manifest and clean.
|
||||||
@ -9,7 +9,7 @@
|
|||||||
# emerge. From nothing. fischerspooner rocks. -lynX
|
# emerge. From nothing. fischerspooner rocks. -lynX
|
||||||
|
|
||||||
P=psyced
|
P=psyced
|
||||||
V=20080116
|
V=20081120
|
||||||
|
|
||||||
# this part can be executed once the ebuild is in portage
|
# this part can be executed once the ebuild is in portage
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile,v 1.5 2008/01/27 12:27:15 lynx Exp $
|
# $Id: Makefile,v 1.7 2008/07/07 18:35:59 lynx Exp $
|
||||||
#
|
#
|
||||||
# This Makefile serves the purpose to produce the files ebuild needs to be
|
# This Makefile serves the purpose to produce the files ebuild needs to be
|
||||||
# happy. So it is an ebuildbuilder. Targets are: ebuild, Manifest and clean.
|
# happy. So it is an ebuildbuilder. Targets are: ebuild, Manifest and clean.
|
||||||
@ -9,7 +9,7 @@
|
|||||||
# emerge. From nothing. fischerspooner rocks. -lynX
|
# emerge. From nothing. fischerspooner rocks. -lynX
|
||||||
|
|
||||||
P=psyclpc
|
P=psyclpc
|
||||||
V=20080116
|
V=20080707
|
||||||
|
|
||||||
# this part can be executed once the ebuild is in portage
|
# this part can be executed once the ebuild is in portage
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; $Id: psyced.ini,v 1.22 2008/01/22 09:30:06 lynx Exp $
|
; $Id: psyced.ini,v 1.23 2008/04/28 16:35:29 lynx Exp $
|
||||||
;
|
;
|
||||||
; this is the sample psyced configuration file. in fact it is the one
|
; this is the sample psyced configuration file. in fact it is the one
|
||||||
; being used for the gentoo default installation. you can use this if
|
; being used for the gentoo default installation. you can use this if
|
||||||
@ -119,8 +119,15 @@ _console_debug = 0
|
|||||||
;_charset_console = ISO-8859-15
|
;_charset_console = ISO-8859-15
|
||||||
; '0' is tranquility unless something serious happens. best choice.
|
; '0' is tranquility unless something serious happens. best choice.
|
||||||
; '1' gives you slightly interesting output and LPC development debug.
|
; '1' gives you slightly interesting output and LPC development debug.
|
||||||
; '2' or '3' is too much and too detailed. we hardly ever use that ourselves.
|
; '2' or '3' is too much and too detailed. we only use this as shown below.
|
||||||
_level_debug = 0
|
_level_debug = 0
|
||||||
|
; Advanced extra debug flags for the psyclpc command line. You can debug
|
||||||
|
; specific parts of psyced like for example the textdb subsystem by adding
|
||||||
|
; -DDtext=2 here. You can figure out which other parts of psyced are debuggable
|
||||||
|
; by doing a "grep -r 'define DEBUG D' ." in the world directory, then assign
|
||||||
|
; a debug level in the same way as the global debug level above.
|
||||||
|
;_extra_debug =
|
||||||
|
|
||||||
|
|
||||||
; We create files that are editable by the psyc group
|
; We create files that are editable by the psyc group
|
||||||
_umask = 007
|
_umask = 007
|
||||||
|
113
install.sh
113
install.sh
@ -3,7 +3,7 @@
|
|||||||
# but if that's not true, try a bash or ksh here.
|
# but if that's not true, try a bash or ksh here.
|
||||||
#
|
#
|
||||||
# psyced installation script
|
# psyced installation script
|
||||||
# $Id: install.sh,v 1.159 2008/03/23 19:27:13 lynx Exp $
|
# $Id: install.sh,v 1.165 2008/10/16 13:07:13 lynx Exp $
|
||||||
#
|
#
|
||||||
# original version by oswald!osw@ld.pages.de on IRCnet, 22aug00
|
# original version by oswald!osw@ld.pages.de on IRCnet, 22aug00
|
||||||
# heavy improvements by heldensaga and psyc://psyced.org/~lynX
|
# heavy improvements by heldensaga and psyc://psyced.org/~lynX
|
||||||
@ -29,20 +29,25 @@ rm="rm"
|
|||||||
#exit="echo [debug] Not exiting."
|
#exit="echo [debug] Not exiting."
|
||||||
#rm="echo [debug] Not removing"
|
#rm="echo [debug] Not removing"
|
||||||
|
|
||||||
|
DATA_PERM="700"
|
||||||
|
BASE_PERM="700"
|
||||||
|
CONF_PERM="700"
|
||||||
|
UMASK="7"
|
||||||
|
|
||||||
hi="[1m"
|
hi="[1m"
|
||||||
lo="[m"
|
lo="[m"
|
||||||
|
|
||||||
# take a guess wether we are on a gentoo? like -x /etc/portage?
|
if test -d "/etc/portage"
|
||||||
#echo ""
|
then
|
||||||
#echo "${hi}!!INFO FOR GENTOO USERS!!${lo}"
|
cat <<EOT
|
||||||
cat <<EOT
|
${hi}!!INFO FOR GENTOO USERS!!${lo}
|
||||||
If you are running gentoo, you should try out our brand new ebuilds
|
If you are running gentoo/portage, you should try out our beautiful ebuilds
|
||||||
at http://www.psyced.org/files/gentoo.tar.bz2 --- They are also in the
|
at http://www.psyced.org/files/gentoo.tar.bz2 --- They are also in the
|
||||||
data.tar. Unpack it, then go into the config/gentoo directory and run make.
|
data.tar. Unpack it, then go into the config/gentoo directory and run make.
|
||||||
|
|
||||||
EOT
|
EOT
|
||||||
|
sleep 2
|
||||||
sleep 1
|
fi
|
||||||
|
|
||||||
if test -e .config
|
if test -e .config
|
||||||
then
|
then
|
||||||
@ -85,12 +90,26 @@ fi
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
yacc=`which yacc`
|
yacc=`which yacc`
|
||||||
if test "$yacc" = ""
|
bison=`which bison`
|
||||||
|
if test "$yacc" = "" -a "$bison" = ""
|
||||||
then
|
then
|
||||||
|
# tjgillies says: on fedora bison doen't symlink to yacc
|
||||||
echo "Please install 'yacc' or 'bison' on this system."
|
echo "Please install 'yacc' or 'bison' on this system."
|
||||||
$exit
|
$exit
|
||||||
fi
|
fi
|
||||||
echo "Using $yacc during the compilation process."
|
#echo "Using '$bison' or '$yacc' during the compilation process."
|
||||||
|
|
||||||
|
if test -f "/usr/include/openssl/ssl.h"
|
||||||
|
then
|
||||||
|
tls="y"
|
||||||
|
else
|
||||||
|
tls="n"
|
||||||
|
echo ""
|
||||||
|
echo "${hi}Warning: ${lo}You are apparently missing the OpenSSL header files!"
|
||||||
|
echo "If you're on debian/ubuntu you may have to 'apt-get install libssl-dev' now"
|
||||||
|
echo "or your psyclpc will compile without support for encryption."
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
|
||||||
ask() {
|
ask() {
|
||||||
echo ""
|
echo ""
|
||||||
@ -213,6 +232,7 @@ else
|
|||||||
BASE_DIR="/usr/local/psyced"
|
BASE_DIR="/usr/local/psyced"
|
||||||
fi
|
fi
|
||||||
CONFIG_DIR="/etc/psyc"
|
CONFIG_DIR="/etc/psyc"
|
||||||
|
CONF_PERM="750"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
get BASE_DIR
|
get BASE_DIR
|
||||||
@ -227,6 +247,11 @@ then
|
|||||||
$exit
|
$exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# one day we should seperate variable files from static files better
|
||||||
|
LOG_DIR="$BASE_DIR/log"
|
||||||
|
DATA_DIR="$BASE_DIR/data"
|
||||||
|
LIB_DIR="$BASE_DIR/world"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "psyconf will automatically search /etc/psyc for psyced.ini."
|
echo "psyconf will automatically search /etc/psyc for psyced.ini."
|
||||||
echo "If you plan to put this file anywhere else, you will have to"
|
echo "If you plan to put this file anywhere else, you will have to"
|
||||||
@ -235,15 +260,6 @@ echo "pass it as the argument to psyconf."
|
|||||||
get CONFIG_DIR
|
get CONFIG_DIR
|
||||||
ask "PSYCED configuration directory" CONFIG_DIR
|
ask "PSYCED configuration directory" CONFIG_DIR
|
||||||
echo "[config directory is set to $CONFIG_DIR]"
|
echo "[config directory is set to $CONFIG_DIR]"
|
||||||
|
|
||||||
# one day we should seperate variable files from static files better
|
|
||||||
LOG_DIR="$BASE_DIR/log"
|
|
||||||
DATA_DIR="$BASE_DIR/data"
|
|
||||||
LIB_DIR="$BASE_DIR/world"
|
|
||||||
DATA_PERM="700"
|
|
||||||
PERMISSIONS="700"
|
|
||||||
UMASK="7"
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
# setting up ARCH_DIR directly because there is no need to bother the
|
# setting up ARCH_DIR directly because there is no need to bother the
|
||||||
# user with such a detail. if you think we should, then fix all the
|
# user with such a detail. if you think we should, then fix all the
|
||||||
@ -580,11 +596,13 @@ echo ""
|
|||||||
echo "${hi}PSYCED ENCRYPTED PROTOCOL SERVICES${lo}"
|
echo "${hi}PSYCED ENCRYPTED PROTOCOL SERVICES${lo}"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "With either openssl or gnutls installed, your driver may provide TLS/SSL."
|
#echo "With either openssl or gnutls installed, your driver may provide TLS/SSL."
|
||||||
|
echo "With openssl libs installed, your driver should provide TLS/SSL."
|
||||||
|
echo "If you don't have it installed, you must say 'n' here."
|
||||||
echo "Would you like to configure any ports for TLS-enhanced protocols?"
|
echo "Would you like to configure any ports for TLS-enhanced protocols?"
|
||||||
|
|
||||||
get TLS_YN "y"
|
get TLS_YN $tls
|
||||||
ask "Do you love TLS cryptography" TLS_YN
|
ask "Let's use some TLS cryptography" TLS_YN
|
||||||
# das ganze tls-geviech macht nur sinn, wenn man cert und privkey hat
|
# das ganze tls-geviech macht nur sinn, wenn man cert und privkey hat
|
||||||
# ergo die pfade fuer die abfragen und dann entscheiden, ob...
|
# ergo die pfade fuer die abfragen und dann entscheiden, ob...
|
||||||
|
|
||||||
@ -835,6 +853,9 @@ fi
|
|||||||
# nen snapshot. dank pkggen kein großes problem.
|
# nen snapshot. dank pkggen kein großes problem.
|
||||||
get WANT_CVSUP "n"
|
get WANT_CVSUP "n"
|
||||||
|
|
||||||
|
# would be soooo smart if we'd ask for update before we even enter
|
||||||
|
# the install.sh interview because frequently there is a better
|
||||||
|
# install.sh in the repo worth running instead. TODO
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
echo "The version you are about to install is considered stable,"
|
echo "The version you are about to install is considered stable,"
|
||||||
@ -1012,15 +1033,22 @@ _config_HTTP = ${HTTPCONFIG_10}
|
|||||||
; For development, _console_debug is extremely useful,
|
; For development, _console_debug is extremely useful,
|
||||||
; for regular service it is better to have output in files.
|
; for regular service it is better to have output in files.
|
||||||
_console_debug = $CONSOLE_10
|
_console_debug = $CONSOLE_10
|
||||||
; '1' gives you interesting output. '2' or '3' is debug. '0' is tranquility.
|
; '0' is tranquility unless something serious happens. best choice.
|
||||||
|
; '1' gives you slightly interesting output and LPC development debug.
|
||||||
|
; '2' or '3' is too much and too detailed. we only use this as _extra_debug.
|
||||||
_level_debug = $DEBUG
|
_level_debug = $DEBUG
|
||||||
; Have errors logged to an extra psyced.debug file
|
; Advanced extra debug flags for the psyclpc command line. You can debug
|
||||||
_use_file_debug = $FILE_10
|
; specific parts of psyced like for example the textdb subsystem by adding
|
||||||
|
; -DDtext=2 here. You can figure out which other parts of psyced are debuggable
|
||||||
|
; by doing a "grep -r 'define DEBUG D' ." in the world directory.
|
||||||
|
;_extra_debug =
|
||||||
|
|
||||||
; We create files that are editable by the psyc group
|
; We create files that are editable by the psyc group
|
||||||
_umask = $UMASK
|
_umask = $UMASK
|
||||||
|
|
||||||
EOT
|
EOT
|
||||||
|
#; Have errors logged to an extra psyced.debug file
|
||||||
|
#_use_file_debug = $FILE_10
|
||||||
|
|
||||||
# this here is no longer an option.. as PSYC uses UTF-8 on the wire.
|
# this here is no longer an option.. as PSYC uses UTF-8 on the wire.
|
||||||
#
|
#
|
||||||
@ -1044,7 +1072,7 @@ fi
|
|||||||
if test ! -d $BASE_DIR
|
if test ! -d $BASE_DIR
|
||||||
then
|
then
|
||||||
echo "Creating $BASE_DIR..."
|
echo "Creating $BASE_DIR..."
|
||||||
if mkdir -m $PERMISSIONS -p $BASE_DIR 2> /dev/null
|
if mkdir -m $BASE_PERM -p $BASE_DIR 2> /dev/null
|
||||||
then
|
then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
@ -1062,7 +1090,7 @@ fi
|
|||||||
if test ! -d $CONFIG_DIR
|
if test ! -d $CONFIG_DIR
|
||||||
then
|
then
|
||||||
echo "Creating $CONFIG_DIR..."
|
echo "Creating $CONFIG_DIR..."
|
||||||
if mkdir -m $PERMISSIONS -p $CONFIG_DIR 2> /dev/null
|
if mkdir -m $CONF_PERM -p $CONFIG_DIR 2> /dev/null
|
||||||
then
|
then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
@ -1184,7 +1212,7 @@ EOF
|
|||||||
cp $i $ARCH_DIR/$i
|
cp $i $ARCH_DIR/$i
|
||||||
chown $USER $ARCH_DIR/$i
|
chown $USER $ARCH_DIR/$i
|
||||||
chgrp $GROUP $ARCH_DIR/$i
|
chgrp $GROUP $ARCH_DIR/$i
|
||||||
chmod $PERMISSIONS $ARCH_DIR/$i
|
chmod $BASE_PERM $ARCH_DIR/$i
|
||||||
chmod u+x $ARCH_DIR/$i
|
chmod u+x $ARCH_DIR/$i
|
||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
@ -1216,28 +1244,14 @@ cd "$BASE_DIR"
|
|||||||
cp -rp "$BASE_DIR/local" "/tmp/local$$" 2> /dev/null
|
cp -rp "$BASE_DIR/local" "/tmp/local$$" 2> /dev/null
|
||||||
rm -f $BASE_DIR/local 2> /dev/null
|
rm -f $BASE_DIR/local 2> /dev/null
|
||||||
|
|
||||||
# used to be a symlink, but cvs update could replace your local.h with
|
# we previously tried to use symlinks or even partial symlinks for
|
||||||
# the stupid example from the cvs, so let's better copy it.
|
# unmodified files only, but it can result in cvs collisions and
|
||||||
|
# headaches. so far the plain copy approach is best.
|
||||||
#
|
#
|
||||||
cp -rp "$BASE_DIR/config/default" "$BASE_DIR/local"
|
cp -rp "$BASE_DIR/config/blueprint" "$BASE_DIR/local"
|
||||||
#
|
#
|
||||||
# let's make sure it won't happen again ;)
|
# let's make sure it won't happen again ;)
|
||||||
rm -rf "$BASE_DIR/local/CVS"
|
rm -rf "$BASE_DIR/local/CVS"
|
||||||
#
|
|
||||||
# no no no let's better not copy it, so we can cvs update unmodified
|
|
||||||
# files like path.h although cvs up should NEVER replace the locally
|
|
||||||
# modified local.h.
|
|
||||||
#ln -s "config/default" "$BASE_DIR/local"
|
|
||||||
# that doesn't work either.. he tries to join changes between default
|
|
||||||
# local.h and current one, resulting in collisions.
|
|
||||||
#
|
|
||||||
# let's make symlinks of each file, then replace the ones we really
|
|
||||||
# need locally..
|
|
||||||
#
|
|
||||||
#mkdir "$BASE_DIR/local"
|
|
||||||
#ln -s config/default/README config/default/*.h "$BASE_DIR/local"
|
|
||||||
# this one gives us headaches
|
|
||||||
#rm "$BASE_DIR/local/CVS"
|
|
||||||
|
|
||||||
if test "$RUNTIME_OUTPUT" = "files"
|
if test "$RUNTIME_OUTPUT" = "files"
|
||||||
then
|
then
|
||||||
@ -1272,13 +1286,18 @@ echo "Setting permissions for program files..."
|
|||||||
|
|
||||||
chown -R $USER $BASE_DIR
|
chown -R $USER $BASE_DIR
|
||||||
chgrp -R $GROUP $BASE_DIR
|
chgrp -R $GROUP $BASE_DIR
|
||||||
chmod -R $PERMISSIONS $BASE_DIR
|
# does this mark all files executable, even .c?
|
||||||
|
chmod -R $BASE_PERM $BASE_DIR
|
||||||
chmod -R u+x $BASE_DIR/bin
|
chmod -R u+x $BASE_DIR/bin
|
||||||
|
|
||||||
echo "Setting permissions for data and log files..."
|
echo "Setting permissions for data and log files..."
|
||||||
|
|
||||||
chmod -R $DATA_PERM $BASE_DIR/data $BASE_DIR/log
|
chmod -R $DATA_PERM $BASE_DIR/data $BASE_DIR/log
|
||||||
|
|
||||||
|
echo "Setting $GROUP group on configuration files..."
|
||||||
|
|
||||||
|
chgrp -R $GROUP $CONFIG_DIR
|
||||||
|
|
||||||
# and now we'll see if perl is installed :)
|
# and now we'll see if perl is installed :)
|
||||||
bin/psyconf psyced.ini
|
bin/psyconf psyced.ini
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#define SILENCE
|
#define SILENCE
|
||||||
|
|
||||||
#ifdef BRAIN
|
#ifdef BRAIN
|
||||||
# define NEWSFEED_RSS "http://english.aljazeera.net/NR/exeres/4D6139CD-6BB5-438A-8F33-96A7F25F40AF.htm?ArticleGuid=55ABE840-AC30-41D2-BDC9-06BBE2A36665"
|
# define NEWSFEED_RSS "http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989"
|
||||||
#else
|
#else
|
||||||
# define CONNECT_DEFAULT
|
# define CONNECT_DEFAULT
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <net.h>
|
#include <net.h>
|
||||||
#define NAME "freeNode"
|
#define NAME "freenode"
|
||||||
|
|
||||||
//
|
//
|
||||||
// «freenode:TomSawyer» TomSawyer sagt Dir: you're able to talk to me, not because I'm an admin, but because I have /msg nickserv set unfiltered on
|
// «freenode:TomSawyer» TomSawyer sagt Dir: you're able to talk to me, not because I'm an admin, but because I have /msg nickserv set unfiltered on
|
||||||
@ -12,7 +12,8 @@
|
|||||||
|
|
||||||
#ifdef BRAIN
|
#ifdef BRAIN
|
||||||
# echo BRAIN: connecting to freenode IRC server
|
# echo BRAIN: connecting to freenode IRC server
|
||||||
# define CONNECT_IRC "irc." NAME ".net"
|
//# define CONNECT_IRC "irc." NAME ".net"
|
||||||
|
# define CONNECT_IRC "calvino.freenode.net"
|
||||||
//# define CHAT_CHANNEL "esp"
|
//# define CHAT_CHANNEL "esp"
|
||||||
//# define CHAT_CHANNEL "23c3"
|
//# define CHAT_CHANNEL "23c3"
|
||||||
# define PASS_IRC IRCGATE_FREENODE
|
# define PASS_IRC IRCGATE_FREENODE
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
//#define CONNECT_IRC "irc.freenet.de" // an ircnet server
|
//#define CONNECT_IRC "irc.freenet.de" // an ircnet server
|
||||||
//#define CONNECT_IRC "us.ircnet.org"
|
//#define CONNECT_IRC "us.ircnet.org"
|
||||||
#define CONNECT_IRC "irc1.us.ircnet.net"
|
#define CONNECT_IRC "irc.fu-berlin.de"
|
||||||
//
|
//
|
||||||
// other example configuration
|
// other example configuration
|
||||||
//
|
//
|
||||||
@ -25,6 +25,7 @@
|
|||||||
//#define ON_CONNECT call_out("emit", 9, "JOIN :#" CHAT_CHANNEL "\n");
|
//#define ON_CONNECT call_out("emit", 9, "JOIN :#" CHAT_CHANNEL "\n");
|
||||||
|
|
||||||
#include <place.gen>
|
#include <place.gen>
|
||||||
|
#echo IRCnet Gateway loaded. Connecting to IRCnet IRC.
|
||||||
|
|
||||||
// See also http://about.psyc.eu/gateway
|
// See also http://about.psyc.eu/gateway
|
||||||
//
|
//
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
//# define LOCAL // if you don't want to allow remote users here
|
//# define LOCAL // if you don't want to allow remote users here
|
||||||
|
|
||||||
// but this one can't harm ;)
|
// but this one can't harm ;)
|
||||||
# define PLACE_MASQUERADING
|
# define PLACE_MASQUERADE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <place.gen> // now generate the place according to the rules
|
#include <place.gen> // now generate the place according to the rules
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#if 0
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#define SILENCE
|
#define SILENCE
|
||||||
#define NAME "Spiegel-EN"
|
#define NAME "Spiegel-EN"
|
||||||
@ -5,13 +6,11 @@
|
|||||||
#define DESCRIPTION "Europe's Largest News Magazine in English Edition"
|
#define DESCRIPTION "Europe's Largest News Magazine in English Edition"
|
||||||
|
|
||||||
#ifdef BRAIN
|
#ifdef BRAIN
|
||||||
# define NEWSFEED_RSS "http://www.spiegel.de/schlagzeilen/rss/0,5291,676,00.xml"
|
# define NEWSFEED_RSS "http://www.spiegel.de/international/index.rss"
|
||||||
# define RESET_INTERVAL 10 // they suggest 5 minutes
|
# define RESET_INTERVAL 10 // they suggest 5 minutes
|
||||||
#else
|
#else
|
||||||
# define CONNECT_DEFAULT
|
# define CONNECT_DEFAULT
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* http://www.spiegel.de/dertag/0,1518,271804,00.html
|
|
||||||
*/
|
|
||||||
#include <place.gen>
|
#include <place.gen>
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
|
#if 0
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#define SILENCE
|
#define SILENCE
|
||||||
#define NAME "Spiegel"
|
#define NAME "Spiegel"
|
||||||
|
|
||||||
#ifdef BRAIN
|
#ifdef BRAIN
|
||||||
# define NEWSFEED_RSS "http://www.spiegel.de/schlagzeilen/rss/0,5291,,00.xml"
|
# define NEWSFEED_RSS "http://www.spiegel.de/schlagzeilen/index.rss"
|
||||||
# define RESET_INTERVAL 5 // they suggest 5 minutes
|
# define RESET_INTERVAL 5 // they suggest 5 minutes
|
||||||
#else
|
#else
|
||||||
# define CONNECT_DEFAULT
|
# define CONNECT_DEFAULT
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* http://www.spiegel.de/dertag/0,1518,271804,00.html
|
|
||||||
*/
|
|
||||||
#include <place.gen>
|
#include <place.gen>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: test.c,v 1.34 2008/01/26 12:02:07 lynx Exp $ // vim:syntax=lpc
|
// $Id: test.c,v 1.35 2008/08/03 14:22:43 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// room to test some library functions etc
|
// room to test some library functions etc
|
||||||
// originally started by heldensaga
|
// originally started by heldensaga
|
||||||
@ -27,8 +27,8 @@
|
|||||||
#ifdef HTMORE
|
#ifdef HTMORE
|
||||||
inherit NET_PATH "outputb";
|
inherit NET_PATH "outputb";
|
||||||
// order is relevant. outputb needs to be inherited BEFORE textc!
|
// order is relevant. outputb needs to be inherited BEFORE textc!
|
||||||
#include <text.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#include <text.h>
|
||||||
|
|
||||||
#include <place.gen>
|
#include <place.gen>
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@
|
|||||||
#define PLACE_HISTORY
|
#define PLACE_HISTORY
|
||||||
#define HISTORY_GLIMPSE 7
|
#define HISTORY_GLIMPSE 7
|
||||||
|
|
||||||
#ifdef BETA
|
#ifdef SYMLYNX
|
||||||
# define PLACE_OWNED ADMINISTRATORS
|
# define PLACE_OWNED ADMINISTRATORS
|
||||||
//# define MASTER
|
//# define MASTER
|
||||||
# echo tuXedo is a masterplace.
|
# echo tuXedo is a masterplace.
|
||||||
//# define ALLOW_EXTERNAL_FROM "psyc://andrack.tobij.de"
|
//# define ALLOW_EXTERNAL_FROM "psyc://andrack.tobij.de"
|
||||||
#else
|
#else
|
||||||
# define JUNCTION
|
# define JUNCTION
|
||||||
# define CONNECT "psyc://beta.ve.symlynX.com/@" NAME
|
# define CONNECT "psyc://ve.symlynX.com/@" NAME
|
||||||
# echo tuXedo is a junction for beta.ve.symlynX.com.
|
# echo tuXedo is a junction for ve.symlynX.com.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <place.gen>
|
#include <place.gen>
|
||||||
|
@ -15,7 +15,7 @@ usage: $0 <filematch> [<operation> [<directories>]]
|
|||||||
<operation> by default is to transform anonymous access to the psyced
|
<operation> by default is to transform anonymous access to the psyced
|
||||||
repository into your personal login access. in detail:
|
repository into your personal login access. in detail:
|
||||||
|
|
||||||
$op
|
"s#^:pserver:anonymous\\\@cvs\\\.psyced\\\.org:/CVS/anonCVS#:pserver:$ENV{USER}\\\@cvs\\\.psyced\\\.org:/CVS/muveCVS#m"
|
||||||
|
|
||||||
without <directories> the directory tree starting from the current directory
|
without <directories> the directory tree starting from the current directory
|
||||||
is recursively checked.
|
is recursively checked.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<PSYC:TEXTDB> ## vim:syntax=html
|
<PSYC:TEXTDB> ## vim:syntax=html
|
||||||
|
## Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_PAGES_help_survival
|
_PAGES_help_survival
|
||||||
|<h5>Erste Schritte für die Ungeduldigen</h5>
|
|<h5>Erste Schritte für die Ungeduldigen</h5>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<PSYC:TEXTDB> ## vim:syntax=mail
|
<PSYC:TEXTDB> ## vim:syntax=mail
|
||||||
|
## Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_message
|
_message
|
||||||
|[_nick] sendet Dir: [_data]
|
|[_nick] sendet Dir: [_data]
|
||||||
@ -108,6 +109,9 @@ _TEXT_time_age
|
|||||||
_TEXT_time_alive
|
_TEXT_time_alive
|
||||||
|Zuletzt aktiv
|
|Zuletzt aktiv
|
||||||
|
|
||||||
|
_TEXT_address_zone_time
|
||||||
|
|Zeitzone
|
||||||
|
|
||||||
_TEXT_contact_telephone
|
_TEXT_contact_telephone
|
||||||
|Telefon
|
|Telefon
|
||||||
|
|
||||||
@ -195,6 +199,12 @@ _TEXT_action_asks
|
|||||||
_TEXT_action_does
|
_TEXT_action_does
|
||||||
|tut
|
|tut
|
||||||
|
|
||||||
|
_TEXT_button_home
|
||||||
|
|START
|
||||||
|
|
||||||
|
_TEXT_button_call
|
||||||
|
|ANRUFEN
|
||||||
|
|
||||||
_TEXT_button_friend_new
|
_TEXT_button_friend_new
|
||||||
|ANFREUNDEN
|
|ANFREUNDEN
|
||||||
|
|
||||||
@ -438,6 +448,9 @@ _info_set_none
|
|||||||
_info_talk
|
_info_talk
|
||||||
|## no output
|
|## no output
|
||||||
|
|
||||||
|
_info_mail_subject
|
||||||
|
|Nachrichten an [_target]
|
||||||
|
|
||||||
_info_mail_signature
|
_info_mail_signature
|
||||||
|Antwort per E-Mail ist nicht möglich. Bitte Einloggen:
|
|Antwort per E-Mail ist nicht möglich. Bitte Einloggen:
|
||||||
|[_URL_login]
|
|[_URL_login]
|
||||||
@ -533,6 +546,30 @@ _request_open_page_edit
|
|||||||
|Zur Bearbeitung der Einstellungen bitte folgende Seite aufrufen:
|
|Zur Bearbeitung der Einstellungen bitte folgende Seite aufrufen:
|
||||||
|[_page_edit]
|
|[_page_edit]
|
||||||
|
|
||||||
|
_request_call_link
|
||||||
|
|Anruf von [_nick]: Annehmen durch Klick auf [_page_call].
|
||||||
|
|
||||||
|
_echo_call
|
||||||
|
|[_nick_target] wird angerufen.
|
||||||
|
|
||||||
|
_warning_usage_call
|
||||||
|
|Syntax: /call <Person>
|
||||||
|
|
||||||
|
_notice_answer_call
|
||||||
|
|Der Anruf wurde angenommen.
|
||||||
|
|
||||||
|
_notice_answer_call_link
|
||||||
|
|Der Anruf wurde angenommen. [_page_call] um das Gespräch zu beginnen.
|
||||||
|
|
||||||
|
_notice_answer_call_click
|
||||||
|
|Der Anruf wurde angeclickt.
|
||||||
|
|
||||||
|
_notice_reject_call_click
|
||||||
|
|Der Anruf wurde abgewiesen.
|
||||||
|
|
||||||
|
_notice_reject_call
|
||||||
|
|Der Anruf wurde abgewiesen.
|
||||||
|
|
||||||
_notice_requested_status_person
|
_notice_requested_status_person
|
||||||
|[_source] erkundigt sich nach Deiner Anwesenheit.
|
|[_source] erkundigt sich nach Deiner Anwesenheit.
|
||||||
|
|
||||||
@ -540,7 +577,7 @@ _notice_authentication
|
|||||||
|Ja klar, das bin dann wohl ich!
|
|Ja klar, das bin dann wohl ich!
|
||||||
|
|
||||||
_notice_processing_authentication
|
_notice_processing_authentication
|
||||||
|Momenterl, ich muss mal nachfragen..
|
|Bestätigung der Identität von [_source] verzögert.
|
||||||
|
|
||||||
_echo_place_nick_removed
|
_echo_place_nick_removed
|
||||||
|Du legst den Namen [_nick_local] wieder ab.
|
|Du legst den Namen [_nick_local] wieder ab.
|
||||||
@ -706,10 +743,8 @@ _error_necessary_registration_other
|
|||||||
|geschützt sein. Hierzu kann [_other] den "/reg" Befehl verwenden.
|
|geschützt sein. Hierzu kann [_other] den "/reg" Befehl verwenden.
|
||||||
|
|
||||||
_error_invalid_password
|
_error_invalid_password
|
||||||
|## Das war leider das flasche Passwort für [_nick].
|
|Das war leider das flasche Passwort für [_nick].
|
||||||
|Das Passwort passt nicht zu [_nick].
|
|## Das Passwort passt nicht zu [_nick].
|
||||||
|Passage nicht möglich.
|
|
||||||
|So kann's passieren.
|
|
||||||
|
|
||||||
_error_invalid_uniform
|
_error_invalid_uniform
|
||||||
|Diese Adresse ergibt mir keinen Sinn.
|
|Diese Adresse ergibt mir keinen Sinn.
|
||||||
@ -803,6 +838,9 @@ _failure_unavailable_service_talk
|
|||||||
_failure_unavailable_service_talk_text
|
_failure_unavailable_service_talk_text
|
||||||
|Gespräch mit [_nick_target] ist nicht möglich: [_text_XMPP]
|
|Gespräch mit [_nick_target] ist nicht möglich: [_text_XMPP]
|
||||||
|
|
||||||
|
_failure_invalid_route
|
||||||
|
|Ungültige Route nach [_target_relay] im [_context_relay] Context festgestellt.
|
||||||
|
|
||||||
_failure_unsupported_ping
|
_failure_unsupported_ping
|
||||||
|[_nick] kann man nicht anpingen.
|
|[_nick] kann man nicht anpingen.
|
||||||
|
|
||||||
@ -841,6 +879,9 @@ _message_public
|
|||||||
_message_echo_private
|
_message_echo_private
|
||||||
|Du sagst [_nick_target]: [_data]
|
|Du sagst [_nick_target]: [_data]
|
||||||
|
|
||||||
|
_message_echo_private_annotate
|
||||||
|
|Anmerkung an [_nick_target]: [_data]
|
||||||
|
|
||||||
_message_echo_public
|
_message_echo_public
|
||||||
|Du sagst: [_data]
|
|Du sagst: [_data]
|
||||||
|
|
||||||
@ -920,7 +961,7 @@ _request_attention_wake
|
|||||||
|Aufmerksamkeit ersucht durch [_nick]. WACH[_beep]AUF!
|
|Aufmerksamkeit ersucht durch [_nick]. WACH[_beep]AUF!
|
||||||
|
|
||||||
_notice_login
|
_notice_login
|
||||||
|Willkommen im [_name_network] Netzwerk, [_nick]. ([_page_network])
|
|Willkommen im [_name_network], [_source].
|
||||||
|
|
||||||
_notice_invitation
|
_notice_invitation
|
||||||
|[_nick] lädt Dich nach [_nick_place] ein.
|
|[_nick] lädt Dich nach [_nick_place] ein.
|
||||||
@ -1023,7 +1064,13 @@ _notice_place_topic_official
|
|||||||
|[_topic]
|
|[_topic]
|
||||||
|
|
||||||
_notice_place_topic_removed
|
_notice_place_topic_removed
|
||||||
|[_nick] entfernt [_nick_topic]'s Ankündigung: [_topic]
|
|[_nick] entfernt [_nick_topic]s Ankündigung: [_topic]
|
||||||
|
|
||||||
|
_notice_examine_web_person
|
||||||
|
|[_nick] wurde auf [_web_on] betrachtet, von [_web_from] kommend.
|
||||||
|
|
||||||
|
_notice_examine_web_place
|
||||||
|
|[_nick_place] wurde auf [_web_on] betrachtet, von [_web_from] kommend.
|
||||||
|
|
||||||
_notice_place_examine_web
|
_notice_place_examine_web
|
||||||
|[_nick_place] wurde auf [_web_on] betrachtet, von [_web_from] kommend.
|
|[_nick_place] wurde auf [_web_on] betrachtet, von [_web_from] kommend.
|
||||||
@ -1508,9 +1555,6 @@ _status_place_aides
|
|||||||
_status_place_members
|
_status_place_members
|
||||||
|In [_nick_place]: [_list_members_nicks].
|
|In [_nick_place]: [_list_members_nicks].
|
||||||
|
|
||||||
_status_place_topic
|
|
||||||
|Ankündigung von [_nick]: [_topic]
|
|
||||||
|
|
||||||
_status_place_masquerade
|
_status_place_masquerade
|
||||||
|Verkleidungen erlaubt. Ausprobieren mit "/nick".
|
|Verkleidungen erlaubt. Ausprobieren mit "/nick".
|
||||||
|
|
||||||
@ -1553,6 +1597,13 @@ _status_place_link_slave
|
|||||||
_status_place_aides_none
|
_status_place_aides_none
|
||||||
|In diesem Raum gibt es keine Schergen.
|
|In diesem Raum gibt es keine Schergen.
|
||||||
|
|
||||||
|
_status_place_topic
|
||||||
|
|Ankündigung von [_nick]: [_topic]
|
||||||
|
|
||||||
|
_status_place_topic_author
|
||||||
|
|## Only appears on IRC access
|
||||||
|
|Topic [_time_place] von [_nick] gesetzt.
|
||||||
|
|
||||||
_status_place_topic_none
|
_status_place_topic_none
|
||||||
|Es wurde in [_nick_place] kein Topic gesetzt.
|
|Es wurde in [_nick_place] kein Topic gesetzt.
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<PSYC:TEXTDB> ## vim:syntax=html
|
<PSYC:TEXTDB> ## vim:syntax=html
|
||||||
## as yet undocumented/unfinalized: detach attach offline online
|
## as yet undocumented/unfinalized: detach attach offline online
|
||||||
## and /set identities
|
## and /set identities
|
||||||
|
### Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_HTML_tail
|
_HTML_tail
|
||||||
|</td></tr></table>
|
|</span></td></tr></table>
|
||||||
|
|
||||||
_HTML_head
|
_HTML_head
|
||||||
|<script><!--
|
|<script><!--
|
||||||
@ -44,8 +45,7 @@ _HTML_head
|
|||||||
|--></style>
|
|--></style>
|
||||||
|
|
|
|
||||||
|<body bgcolor="#333333" text="#cccccc" link="#669966" vlink="#ccffcc">
|
|<body bgcolor="#333333" text="#cccccc" link="#669966" vlink="#ccffcc">
|
||||||
|<table width="80%" height="100%"><tr><td>
|
|<table width="80%" height="100%"><tr><td><span id="content">
|
||||||
|
|
|
||||||
|
|
||||||
_HTML_info_split
|
_HTML_info_split
|
||||||
|<hr noshade>
|
|<hr noshade>
|
||||||
@ -1004,6 +1004,15 @@ _PAGES_user_settings_changed
|
|||||||
|Settings changed.<br />
|
|Settings changed.<br />
|
||||||
|<a href="?username=[_username]&password=[_password]">continue</a>
|
|<a href="?username=[_username]&password=[_password]">continue</a>
|
||||||
|
|
||||||
|
_PAGES_error
|
||||||
|
|<title>error [_code]</title>
|
||||||
|
|{_HTML_head}
|
||||||
|
|
|
||||||
|
|<h1 id="code">[_code]</h1>
|
||||||
|
|<div id="comment">[_comment]</div>
|
||||||
|
|
|
||||||
|
|{_HTML_tail}
|
||||||
|
|
||||||
_PAGES_group_scratchpad
|
_PAGES_group_scratchpad
|
||||||
|<title>scratchpad for [_nick_place]@{_VAR_host}</title>
|
|<title>scratchpad for [_nick_place]@{_VAR_host}</title>
|
||||||
|
|
|
|
||||||
@ -1322,7 +1331,7 @@ _PAGES_login
|
|||||||
| setTimeout("Plf.submit()", 1234)
|
| setTimeout("Plf.submit()", 1234)
|
||||||
|</script>
|
|</script>
|
||||||
|<form name="Plf" action="examine">
|
|<form name="Plf" action="examine">
|
||||||
|## piccolo spazio pubblicità
|
|## piccolo spazio pubblicitÃ
|
||||||
|<input type="hidden" name="visit" value="psyced.org">
|
|<input type="hidden" name="visit" value="psyced.org">
|
||||||
|</form>
|
|</form>
|
||||||
|{_echo_login_web}
|
|{_echo_login_web}
|
||||||
@ -1330,6 +1339,15 @@ _PAGES_login
|
|||||||
_echo_login_web
|
_echo_login_web
|
||||||
|You are being logged in.
|
|You are being logged in.
|
||||||
|
|
||||||
|
_PAGES_start_description_anonymous
|
||||||
|
|<title>{_MISC_server_software}: examine profile for [_nick]</title>
|
||||||
|
|<body class="Pe">
|
||||||
|
|[_HTML_photo]
|
||||||
|
|[_FORM_start]
|
||||||
|
|
||||||
|
_PAGES_end_description_anonymous
|
||||||
|
|[_FORM_end]</body>
|
||||||
|
|
||||||
_PAGES_start_description
|
_PAGES_start_description
|
||||||
|<title>{_MISC_server_software}: examine profile on {_VAR_host}</title>
|
|<title>{_MISC_server_software}: examine profile on {_VAR_host}</title>
|
||||||
|<script>
|
|<script>
|
||||||
@ -1382,7 +1400,7 @@ _HTML_examine_display
|
|||||||
|
|
||||||
_HTML_examine_buttons_start
|
_HTML_examine_buttons_start
|
||||||
|## SELF? whatever.. text needs to be intlized
|
|## SELF? whatever.. text needs to be intlized
|
||||||
|<p class="Peb"><a id="Pebh" href="javascript:hom()">HOME</a>
|
|<p class="Peb"><a id="Pebh" href="javascript:hom()">{_TEXT_button_home}</a>
|
||||||
|
|
||||||
_HTML_examine_buttons_end
|
_HTML_examine_buttons_end
|
||||||
|</p>
|
|</p>
|
||||||
@ -1403,21 +1421,24 @@ _HTML_examine_friend_delete
|
|||||||
_HTML_examine_friend_new
|
_HTML_examine_friend_new
|
||||||
| <a id="Pebf" href="javascript:cmd('FRIEND [_nick]')">{_TEXT_button_friend_new}</a>
|
| <a id="Pebf" href="javascript:cmd('FRIEND [_nick]')">{_TEXT_button_friend_new}</a>
|
||||||
|
|
||||||
|
_HTML_examine_button_call
|
||||||
|
| <a id="Pebf" href="javascript:cmd('CALL [_nick]')">{_TEXT_button_call}</a>
|
||||||
|
|
||||||
_HTML_call
|
_HTML_call
|
||||||
|<object width="[_amount_width_object]" height="[_amount_height_object]">
|
|<object width="[_amount_width_object]" height="[_amount_height_object]">
|
||||||
|<param name="movie" value="[_path_object_local]"></param>
|
|<param name="movie" value="[_path_object_local]"></param>
|
||||||
|<param name="bgcolor" value="#cc9999" />
|
|<param name="bgcolor" value="{_MISC_color_bg_call}" />
|
||||||
|<embed src="[_path_object_local]?bgcolor=#ff6666" type="application/x-shockwave-flash" width="[_amount_width_object]" height="[_amount_height_object]"></embed>
|
|<embed src="[_path_object_local]?bgcolor={_MISC_color_bg_call}" type="application/x-shockwave-flash" width="[_amount_width_object]" height="[_amount_height_object]"></embed>
|
||||||
|</object><object width="[_amount_width_object]" height="[_amount_height_object]">
|
|</object><object width="[_amount_width_object]" height="[_amount_height_object]">
|
||||||
|<param name="movie" value="[_path_object]"></param>
|
|<param name="movie" value="[_path_object]"></param>
|
||||||
|## <param name="bgcolor" value="#9999cc"></param>
|
|## <param name="bgcolor" value="{_MISC_color_bg_call}"></param>
|
||||||
|## <param name="user" value="[_nick]"></param>
|
|## <param name="user" value="[_nick]"></param>
|
||||||
|## <param name="expiry" value="[_time_expire]"></param>
|
|## <param name="expiry" value="[_time_expire]"></param>
|
||||||
|## <param name="role" value="[_role]"></param>
|
|## <param name="role" value="[_role]"></param>
|
||||||
|## <param name="jack" value="[_check_call]"></param>
|
|## <param name="jack" value="[_check_call]"></param>
|
||||||
|## <param name="server" value="[_uniform_server_media]"></param>
|
|## <param name="server" value="[_uniform_server_media]"></param>
|
||||||
|<param name="flashVars" value="bgcolor=#9999cc&user=[_nick]&expiry=[_time_expire]&role=[_role]&jack=[_check_call]&server=[_uniform_server_media]"></param>
|
|<param name="flashVars" value="bgcolor={_MISC_color_bg_call}&user=[_nick]&expiry=[_time_expire]&role=[_role]&jack=[_check_call]&server=[_uniform_server_media]"></param>
|
||||||
|<embed src="[_path_object]" flashVars="bgcolor=#66ff66&user=[_nick]&expiry=[_time_expire]&role=[_role]&jack=[_check_call]&server=[_uniform_server_media]" type="application/x-shockwave-flash" width="[_amount_width_object]" height="[_amount_height_object]"></embed>
|
|<embed src="[_path_object]" flashVars="bgcolor={_MISC_color_bg_call}&user=[_nick]&expiry=[_time_expire]&role=[_role]&jack=[_check_call]&server=[_uniform_server_media]" type="application/x-shockwave-flash" width="[_amount_width_object]" height="[_amount_height_object]"></embed>
|
||||||
|</object>
|
|</object>
|
||||||
|
|
||||||
_HTML_call_OLD
|
_HTML_call_OLD
|
||||||
@ -1429,20 +1450,37 @@ _HTML_call_OLD
|
|||||||
|<embed src="[_path_object]?ns0Name=(0)&stream=([_nick])[_time_expire][_role][_check_call]&url=[_uniform_server_media]" type="application/x-shockwave-flash" width="[_amount_width_object]" height="[_amount_height_object]"></embed>
|
|<embed src="[_path_object]?ns0Name=(0)&stream=([_nick])[_time_expire][_role][_check_call]&url=[_uniform_server_media]" type="application/x-shockwave-flash" width="[_amount_width_object]" height="[_amount_height_object]"></embed>
|
||||||
|</object>
|
|</object>
|
||||||
|
|
||||||
|
_list_description_each_item_NOTES
|
||||||
|
|## this currently produces a <table>. alice suggests something like
|
||||||
|
|<div><p class='var' style='display:block;float:left;width:200px'>var</p><p class='value' style='display:block;float:left;width:400px;'>value</p><br class='cleaner' style='clear:both'></div>
|
||||||
|
|## maybe like this? (with css accordingly)
|
||||||
|
|<div id="[_key]"><span class="ldpek">[_name_key]</span><span class="ldpev">[_value]</span></div>
|
||||||
|
|## or stick to the old table..?
|
||||||
|
|<tr id="[_key]"><td>[_name_key]</td><td>[_value]</td></tr>
|
||||||
|
|## do we want to do ._meth #ldpek { ... } in the css?
|
||||||
|
|<tr id="[_key]"><td class="ldpek">[_name_key]</td><td class="ldpev">[_value]</td></tr>
|
||||||
|
|
||||||
|
_list_description_each_item
|
||||||
|
|<span id="[_key]"><span class="ldpek">[_name_key]</span> <span class="ldpev">[_value]</span><br></span>
|
||||||
|
|
||||||
_list_description_each
|
_list_description_each
|
||||||
|## would be nice to have <tr id='_meth'> so we can do
|
|
||||||
|## ._meth #ldpek { ... } in the css, but that requires a
|
|
||||||
|## switch to psyctext at least when rendering to html.. maybe someday..
|
|
||||||
|<tr><td class="ldpek">%s</td><td class="ldpev">%s</td></tr>
|
|<tr><td class="ldpek">%s</td><td class="ldpev">%s</td></tr>
|
||||||
|
|
||||||
_list_description_image
|
_list_description_image
|
||||||
|<img class="ldpi" src="data:[_type_image];base64,[_image_base64]">
|
|<img class="ldpi" src="data:[_type_image];base64,[_image_base64]">
|
||||||
|
|
||||||
_list_description_on
|
_list_description_on
|
||||||
|
|<div class="ldp">
|
||||||
|
|<div class="ldpc">{_TEXT_description_nick}</div>
|
||||||
|
|
||||||
|
_list_description_off
|
||||||
|
|</div>
|
||||||
|
|
||||||
|
_list_description_on_table
|
||||||
|<table class="ldp" border=0>
|
|<table class="ldp" border=0>
|
||||||
|<tr class="ldpc"><th colspan=2>{_TEXT_description_nick}:</th></tr>
|
|<tr class="ldpc"><th colspan=2>{_TEXT_description_nick}:</th></tr>
|
||||||
|
|
||||||
_list_description_off
|
_list_description_off_table
|
||||||
|</table>
|
|</table>
|
||||||
|
|
||||||
_echo_execute_web
|
_echo_execute_web
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<PSYC:TEXTDB> ## vim:syntax=mail
|
<PSYC:TEXTDB> ## vim:syntax=mail
|
||||||
|
## Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_status_AREYOUNUTS
|
_status_AREYOUNUTS
|
||||||
|:[_source_hack] NOTICE [_nick_me] :[_data]
|
|:[_source_hack] NOTICE [_nick_me] :[_data]
|
||||||
@ -122,6 +123,9 @@ _request_version
|
|||||||
_error_unknown_name_user
|
_error_unknown_name_user
|
||||||
|#401 [_nick_me] [_nick_target] :{_error_unknown_name_user}
|
|#401 [_nick_me] [_nick_target] :{_error_unknown_name_user}
|
||||||
|
|
||||||
|
_error_necessary_membership
|
||||||
|
|#403 [_nick_me] #[_nick_place] :{_error_necessary_membership}
|
||||||
|
|
||||||
_error_status_place_matches
|
_error_status_place_matches
|
||||||
|## das lassen wir weg, weil manche clients unbedingt den join nochmal
|
|## das lassen wir weg, weil manche clients unbedingt den join nochmal
|
||||||
|## abschicken wollen
|
|## abschicken wollen
|
||||||
@ -142,6 +146,19 @@ _message_private
|
|||||||
_message_public
|
_message_public
|
||||||
|:[_source_hack] PRIVMSG #[_nick_place] :[_data]
|
|:[_source_hack] PRIVMSG #[_nick_place] :[_data]
|
||||||
|
|
||||||
|
_message_echo_private
|
||||||
|
|## let's see how clients deal with messages to a remote target echoed back
|
||||||
|
|## it will probably not look good, but the clients need to fix that really
|
||||||
|
|:[_source_hack] PRIVMSG [_nick_target] :[_data]
|
||||||
|
|## oh, ircII is pretty cool about this. it shows:
|
||||||
|
|## -source:target- message
|
||||||
|
|
||||||
|
_message_echo_private_NOT
|
||||||
|
|## without this format, "You tell.. " is generated
|
||||||
|
|## this is how BNC sends it instead:
|
||||||
|
|:[_source_hack] PRIVMSG [_nick_me] :<- <[_nick_me]> [_data]
|
||||||
|
|## which is just like _message_private with an extra that isn't tamper-proof
|
||||||
|
|
||||||
_message_echo_public
|
_message_echo_public
|
||||||
|:[_source_hack] PRIVMSG #[_nick_place] :[_data]
|
|:[_source_hack] PRIVMSG #[_nick_place] :[_data]
|
||||||
|
|
||||||
@ -290,6 +307,9 @@ _failure_unsupported_ping
|
|||||||
|## yes, this is a pong also...
|
|## yes, this is a pong also...
|
||||||
|:[_source_hack] NOTICE [_nick_me] :%PING [_time_ping]%
|
|:[_source_hack] NOTICE [_nick_me] :%PING [_time_ping]%
|
||||||
|
|
||||||
|
_info_server_version
|
||||||
|
|:[_host_server] 351 [_nick_me] [_version].[_degree_debug] [_host_server] :[_version_server] using [_version_driver] available from [_page_server_software]
|
||||||
|
|
||||||
_status_version
|
_status_version
|
||||||
|:[_source_hack] NOTICE [_nick_me] :%VERSION [_version_description] ([_version])%
|
|:[_source_hack] NOTICE [_nick_me] :%VERSION [_version_description] ([_version])%
|
||||||
|
|
||||||
@ -312,9 +332,16 @@ _status_place_members
|
|||||||
|#353 [_nick_me] = #[_nick_place] :[_members]
|
|#353 [_nick_me] = #[_nick_place] :[_members]
|
||||||
|
|
||||||
_status_place_topic
|
_status_place_topic
|
||||||
|## #332 [_nick_me] #[_nick_place] :{_status_place_topic}
|
|
||||||
|## traditional IRC would be to leave out the _nick here
|
|## traditional IRC would be to leave out the _nick here
|
||||||
|#332 [_nick_me] #[_nick_place] :[_topic] ([_nick])
|
|#332 [_nick_me] #[_nick_place] :[_topic] ([_nick])
|
||||||
|
|## modern IRC is to send a semi-official 333 code
|
||||||
|
|## this entry is unused. the following two are used instead:
|
||||||
|
|
||||||
|
_status_place_topic_only
|
||||||
|
|#332 [_nick_me] #[_nick_place] :[_topic]
|
||||||
|
|
||||||
|
_status_place_topic_author
|
||||||
|
|#333 [_nick_me] #[_nick_place] [_nick] [_INTERNAL_time_topic] :{_status_place_topic_author}
|
||||||
|
|
||||||
_status_place_topic_none
|
_status_place_topic_none
|
||||||
|#331 [_nick_me] :{_status_place_topic_none}
|
|#331 [_nick_me] :{_status_place_topic_none}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<PSYC:TEXTDB> ## vim:syntax=mail
|
<PSYC:TEXTDB> ## vim:syntax=mail
|
||||||
|
## Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_message_public
|
_message_public
|
||||||
|## people out there just *hate* the actions
|
|## people out there just *hate* the actions
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<PSYC:TEXTDB> ## vim:syntax=mail
|
<PSYC:TEXTDB> ## vim:syntax=mail
|
||||||
|
## Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_MISC_character_command
|
_MISC_character_command
|
||||||
|## since several clients started catching / commands..
|
|## since several clients started catching / commands..
|
||||||
@ -59,7 +60,7 @@ _request_execute_topic
|
|||||||
_request_leave
|
_request_leave
|
||||||
|<presence from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber_bare]/[_nick]' type='unavailable' id='[_tag]'><x xmlns='http://jabber.org/protocol/muc'/></presence>
|
|<presence from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber_bare]/[_nick]' type='unavailable' id='[_tag]'><x xmlns='http://jabber.org/protocol/muc'/></presence>
|
||||||
|
|
||||||
_request_examine_vCard
|
_request_description_vCard
|
||||||
|<iq from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber_bare]' type='get' id='[_tag]'><vCard xmlns='vcard-temp'/></iq>
|
|<iq from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber_bare]' type='get' id='[_tag]'><vCard xmlns='vcard-temp'/></iq>
|
||||||
|
|
||||||
_request_status_person
|
_request_status_person
|
||||||
@ -188,7 +189,7 @@ _message_public_action
|
|||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me [_action]</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me [_action]</body></message>
|
||||||
|
|
||||||
_message_public_magnify
|
_message_public_magnify
|
||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>« [_data] »</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>« [_data] »</body></message>
|
||||||
|
|
||||||
_message_public_whisper
|
_message_public_whisper
|
||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me whispers to [_nick_target]: [_data]</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me whispers to [_nick_target]: [_data]</body></message>
|
||||||
@ -206,7 +207,7 @@ _message_public_text_action
|
|||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>[_data]</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>[_data]</body></message>
|
||||||
|
|
||||||
_message_public_action_magnify
|
_message_public_action_magnify
|
||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me [_action] «««</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me [_action] «««</body></message>
|
||||||
|
|
||||||
_message_public_action_possessive
|
_message_public_action_possessive
|
||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me 's [_action_possessive]</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me 's [_action_possessive]</body></message>
|
||||||
@ -215,7 +216,7 @@ _message_public_action_reduce
|
|||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_does} {_TEXT_something}.</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_does} {_TEXT_something}.</body></message>
|
||||||
|
|
||||||
_message_public_question_magnify
|
_message_public_question_magnify
|
||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_asks} « [_data] »</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_asks} « [_data] »</body></message>
|
||||||
|
|
||||||
_message_public_question_reduce
|
_message_public_question_reduce
|
||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_asks} {_TEXT_something}.</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_asks} {_TEXT_something}.</body></message>
|
||||||
@ -224,7 +225,7 @@ _message_private_action
|
|||||||
|<message from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber]' type='chat'><body>/me [_action]</body></message>
|
|<message from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber]' type='chat'><body>/me [_action]</body></message>
|
||||||
|
|
||||||
_message_private_magnify
|
_message_private_magnify
|
||||||
|<message from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber]' type='chat'><body>« [_data] »</body></message>
|
|<message from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber]' type='chat'><body>« [_data] »</body></message>
|
||||||
|
|
||||||
_message_private_reduce
|
_message_private_reduce
|
||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_tells} {_TEXT_dir} {_TEXT_something}.</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_tells} {_TEXT_dir} {_TEXT_something}.</body></message>
|
||||||
@ -247,7 +248,7 @@ _message_private_ask_reduce
|
|||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_asks} {_TEXT_dich} {_TEXT_something}.</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_asks} {_TEXT_dich} {_TEXT_something}.</body></message>
|
||||||
|
|
||||||
_message_private_action_magnify
|
_message_private_action_magnify
|
||||||
|<message from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber]' type='chat'><body>/me [_action] «««</body></message>
|
|<message from='[_INTERNAL_source_jabber]' to='[_INTERNAL_target_jabber]' type='chat'><body>/me [_action] «««</body></message>
|
||||||
|
|
||||||
_message_private_action_reduce
|
_message_private_action_reduce
|
||||||
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_does} {_TEXT_something}.</body></message>
|
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_does} {_TEXT_something}.</body></message>
|
||||||
@ -404,8 +405,14 @@ _notice_presence_absent
|
|||||||
_notice_person_absent_netburp
|
_notice_person_absent_netburp
|
||||||
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>xa</show><status>{_notice_person_absent_netburp}</status></presence>
|
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>xa</show><status>{_notice_person_absent_netburp}</status></presence>
|
||||||
|
|
||||||
|
_request_call
|
||||||
|
|<message from='[_INTERNAL_source_jabber_bare]' to='[_INTERNAL_target_jabber]' type='headline'><body>{_VAR_method}</body><x xmlns='jabber:iq:oob'><url>[_page_call]</url></x></message>
|
||||||
|
|
||||||
|
_notice_answer_call_link
|
||||||
|
|<message from='[_INTERNAL_source_jabber_bare]' to='[_INTERNAL_target_jabber]' type='headline'><body>{_VAR_method}</body><x xmlns='jabber:iq:oob'><url>[_page_call]</url></x></message>
|
||||||
|
|
||||||
_notice_headline_news
|
_notice_headline_news
|
||||||
|<message from='[_INTERNAL_source_jabber_bare]' to='[_INTERNAL_target_jabber]' type='headline'><body></body><x xmlns='jabber:iq:oob'><url>[_page_news]</url></x></message>
|
|<message from='[_INTERNAL_source_jabber_bare]' to='[_INTERNAL_target_jabber]' type='headline'><body>{_VAR_method}</body><x xmlns='jabber:iq:oob'><url>[_page_news]</url></x></message>
|
||||||
|
|
||||||
_echo_notice_friendship_established
|
_echo_notice_friendship_established
|
||||||
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber_bare]' type='subscribed'/><presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'/>
|
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber_bare]' type='subscribed'/><presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'/>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<PSYC:TEXTDB> ## vim:syntax=mail
|
<PSYC:TEXTDB> ## vim:syntax=mail
|
||||||
|
## Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_message
|
_message
|
||||||
|[_nick] sends you: [_data]
|
|[_nick] sends you: [_data]
|
||||||
@ -18,6 +19,9 @@ _prefix
|
|||||||
_URL_help
|
_URL_help
|
||||||
|http://help.pages.de
|
|http://help.pages.de
|
||||||
|
|
||||||
|
_URL_project
|
||||||
|
|http://www.psyced.org
|
||||||
|
|
||||||
_MISC_color
|
_MISC_color
|
||||||
|{_MISC_color_text}
|
|{_MISC_color_text}
|
||||||
|
|
||||||
@ -246,6 +250,9 @@ _TEXT_time_age
|
|||||||
_TEXT_time_alive
|
_TEXT_time_alive
|
||||||
|Last time alive
|
|Last time alive
|
||||||
|
|
||||||
|
_TEXT_address_zone_time
|
||||||
|
|Time zone
|
||||||
|
|
||||||
_TEXT_contact_telephone
|
_TEXT_contact_telephone
|
||||||
|Telephone
|
|Telephone
|
||||||
|
|
||||||
@ -335,6 +342,12 @@ _TEXT_action_away
|
|||||||
_TEXT_action_does
|
_TEXT_action_does
|
||||||
|does
|
|does
|
||||||
|
|
||||||
|
_TEXT_button_home
|
||||||
|
|HOME
|
||||||
|
|
||||||
|
_TEXT_button_call
|
||||||
|
|PHONE CALL
|
||||||
|
|
||||||
_TEXT_button_friend_new
|
_TEXT_button_friend_new
|
||||||
|MAKE FRIENDSHIP
|
|MAKE FRIENDSHIP
|
||||||
|
|
||||||
@ -519,6 +532,30 @@ _request_description_vCard
|
|||||||
_request_friendship_implied
|
_request_friendship_implied
|
||||||
|## no output
|
|## no output
|
||||||
|
|
||||||
|
_request_call_link
|
||||||
|
|[_nick] would like to speak to you. Use [_page_call] to answer the call.
|
||||||
|
|
||||||
|
_echo_call
|
||||||
|
|Phone conversation request issued to [_nick_target].
|
||||||
|
|
||||||
|
_warning_usage_call
|
||||||
|
|Usage: /call <person>
|
||||||
|
|
||||||
|
_notice_answer_call
|
||||||
|
|Your request has been accepted.
|
||||||
|
|
||||||
|
_notice_answer_call_link
|
||||||
|
|Your request has been accepted. Use [_page_call] to start the phone call.
|
||||||
|
|
||||||
|
_notice_answer_call_click
|
||||||
|
|Your phone call request has been clicked upon.
|
||||||
|
|
||||||
|
_notice_reject_call_click
|
||||||
|
|Your phone call request has been rejected.
|
||||||
|
|
||||||
|
_notice_reject_call
|
||||||
|
|Your phone call request has been rejected.
|
||||||
|
|
||||||
_notice_requested_status_person
|
_notice_requested_status_person
|
||||||
|[_source] is checking your presence.
|
|[_source] is checking your presence.
|
||||||
|
|
||||||
@ -531,6 +568,9 @@ _status_place_nick_local
|
|||||||
_status_place_nick_local_none
|
_status_place_nick_local_none
|
||||||
|You aren't masquerading yet. What are you waiting for?
|
|You aren't masquerading yet. What are you waiting for?
|
||||||
|
|
||||||
|
_error_necessary_membership
|
||||||
|
|You need to enter [_nick_place] first.
|
||||||
|
|
||||||
_error_place_silent_configuration_topic
|
_error_place_silent_configuration_topic
|
||||||
|This room is not for talking. [_topic]
|
|This room is not for talking. [_topic]
|
||||||
|
|
||||||
@ -606,9 +646,12 @@ _failure_unavailable_service_version
|
|||||||
_failure_unavailable_service_description
|
_failure_unavailable_service_description
|
||||||
|Requesting description of [_nick_target] is not possible.
|
|Requesting description of [_nick_target] is not possible.
|
||||||
|
|
||||||
|
_failure_invalid_route
|
||||||
|
|Invalid route to [_target_relay] detected in [_context_relay]'s context.
|
||||||
|
|
||||||
_failure_unsupported_function_root
|
_failure_unsupported_function_root
|
||||||
|[_nick] does not provide [_method_relay].
|
|[_nick] does not provide [_method_relay].
|
||||||
|Are you sure you want to talk to me?
|
|## Are you sure you want to talk to me?
|
||||||
|
|
||||||
_failure_unsupported_function_whisper
|
_failure_unsupported_function_whisper
|
||||||
|Routing private messages through groupchat managers is dangerous to your privacy and therefore disallowed. Please communicate with the person directly.
|
|Routing private messages through groupchat managers is dangerous to your privacy and therefore disallowed. Please communicate with the person directly.
|
||||||
@ -647,6 +690,9 @@ _message_friends
|
|||||||
_message_echo_private
|
_message_echo_private
|
||||||
|You tell [_nick_target]: [_data]
|
|You tell [_nick_target]: [_data]
|
||||||
|
|
||||||
|
_message_echo_private_annotate
|
||||||
|
|Notice to [_nick_target]: [_data]
|
||||||
|
|
||||||
_message_echo_public
|
_message_echo_public
|
||||||
|You say: [_data]
|
|You say: [_data]
|
||||||
|
|
||||||
@ -666,7 +712,7 @@ _message_echo_public_text_action
|
|||||||
|[_nick] [_action]: [_data]
|
|[_nick] [_action]: [_data]
|
||||||
|
|
||||||
_message_echo_public_text_action_magnify
|
_message_echo_public_text_action_magnify
|
||||||
|««« {_message_echo_private_text_action} »»»
|
|««« {_message_echo_private_text_action} »»»
|
||||||
|
|
||||||
_message_echo_public_text_action_reduce
|
_message_echo_public_text_action_reduce
|
||||||
|[_nick] [_action] {_TEXT_something}.
|
|[_nick] [_action] {_TEXT_something}.
|
||||||
@ -690,7 +736,7 @@ _message_public_action
|
|||||||
|[_nick] [_action].
|
|[_nick] [_action].
|
||||||
|
|
||||||
_message_public_magnify
|
_message_public_magnify
|
||||||
|««« {_message_public} »»»
|
|««« {_message_public} »»»
|
||||||
|
|
||||||
_message_public_important
|
_message_public_important
|
||||||
|===> {_message_public}
|
|===> {_message_public}
|
||||||
@ -726,7 +772,7 @@ _message_public_other_action_possessive
|
|||||||
|In [_nick_place]: [_nick]'s [_action_possessive].
|
|In [_nick_place]: [_nick]'s [_action_possessive].
|
||||||
|
|
||||||
_message_public_action_magnify
|
_message_public_action_magnify
|
||||||
|««« {_message_public_action} »»»
|
|««« {_message_public_action} »»»
|
||||||
|
|
||||||
_message_public_action_important
|
_message_public_action_important
|
||||||
|===> {_message_public_action}
|
|===> {_message_public_action}
|
||||||
@ -738,7 +784,7 @@ _message_public_action_reduce
|
|||||||
|[_nick] {_TEXT_action_does} {_TEXT_something}.
|
|[_nick] {_TEXT_action_does} {_TEXT_something}.
|
||||||
|
|
||||||
_message_public_question_magnify
|
_message_public_question_magnify
|
||||||
|««« {_message_public_question} »»»
|
|««« {_message_public_question} »»»
|
||||||
|
|
||||||
_message_public_question_pending
|
_message_public_question_pending
|
||||||
|{_TEXT_pending} [_nick] {_TEXT_action_asks}: [_data]
|
|{_TEXT_pending} [_nick] {_TEXT_action_asks}: [_data]
|
||||||
@ -768,7 +814,7 @@ _message_private_action
|
|||||||
|[_nick] [_action].
|
|[_nick] [_action].
|
||||||
|
|
||||||
_message_private_magnify
|
_message_private_magnify
|
||||||
|««« {_message_private} »»»
|
|««« {_message_private} »»»
|
||||||
|
|
||||||
_message_private_reduce
|
_message_private_reduce
|
||||||
|[_nick] {_TEXT_action_tells} you {_TEXT_something}.
|
|[_nick] {_TEXT_action_tells} you {_TEXT_something}.
|
||||||
@ -780,7 +826,7 @@ _message_private_ask
|
|||||||
|[_nick] {_TEXT_action_asks} you: [_data]
|
|[_nick] {_TEXT_action_asks} you: [_data]
|
||||||
|
|
||||||
_message_private_ask_magnify
|
_message_private_ask_magnify
|
||||||
|««« {_message_private_ask} »»»
|
|««« {_message_private_ask} »»»
|
||||||
|
|
||||||
_message_private_ask_reduce
|
_message_private_ask_reduce
|
||||||
|[_nick] {_TEXT_action_asks} you {_TEXT_something}.
|
|[_nick] {_TEXT_action_asks} you {_TEXT_something}.
|
||||||
@ -789,7 +835,7 @@ _message_private_text_action
|
|||||||
|[_nick] [_action]: [_data]
|
|[_nick] [_action]: [_data]
|
||||||
|
|
||||||
_message_private_action_magnify
|
_message_private_action_magnify
|
||||||
|««« {_message_private_action} »»»
|
|««« {_message_private_action} »»»
|
||||||
|
|
||||||
_message_private_action_reduce
|
_message_private_action_reduce
|
||||||
|[_nick] does {_TEXT_something} to you.
|
|[_nick] does {_TEXT_something} to you.
|
||||||
@ -798,7 +844,7 @@ _echo_wake
|
|||||||
|Trying to wake [_nick_target].
|
|Trying to wake [_nick_target].
|
||||||
|
|
||||||
_notice_login
|
_notice_login
|
||||||
|Welcome on the [_name_network] network, [_nick]. ([_page_network])
|
|Welcome on [_name_network], [_source].
|
||||||
|
|
||||||
_request_attention_wake
|
_request_attention_wake
|
||||||
|[_nick] seeks your attention. WAKE[_beep]UP!
|
|[_nick] seeks your attention. WAKE[_beep]UP!
|
||||||
@ -827,6 +873,12 @@ _notice_logon_last
|
|||||||
_notice_place_leave
|
_notice_place_leave
|
||||||
|[_nick] leaves [_nick_place].
|
|[_nick] leaves [_nick_place].
|
||||||
|
|
||||||
|
_notice_examine_web_person
|
||||||
|
|[_nick] inspected on [_web_on] coming from [_web_from].
|
||||||
|
|
||||||
|
_notice_examine_web_place
|
||||||
|
|[_nick_place] inspected on [_web_on] coming from [_web_from].
|
||||||
|
|
||||||
_notice_place_examine_web
|
_notice_place_examine_web
|
||||||
|[_nick_place] inspected on [_web_on] coming from [_web_from].
|
|[_nick_place] inspected on [_web_on] coming from [_web_from].
|
||||||
|
|
||||||
@ -1252,7 +1304,7 @@ _notice_authentication
|
|||||||
|Yes, that's me!
|
|Yes, that's me!
|
||||||
|
|
||||||
_notice_processing_authentication
|
_notice_processing_authentication
|
||||||
|Wait a minute, I have to ask somebody.
|
|Proof of [_source]'s identity is delayed.
|
||||||
|
|
||||||
_notice_unlink
|
_notice_unlink
|
||||||
|[_location] unlinked from [_identification].
|
|[_location] unlinked from [_identification].
|
||||||
@ -1375,6 +1427,9 @@ _notice_friendship_removed_implied
|
|||||||
_status_place_identification
|
_status_place_identification
|
||||||
|PSYC Identification of [_nick_place]: [_identification]
|
|PSYC Identification of [_nick_place]: [_identification]
|
||||||
|
|
||||||
|
_status_place_topic
|
||||||
|
|Topic by [_nick]: [_topic]
|
||||||
|
|
||||||
_status_place_topic_none
|
_status_place_topic_none
|
||||||
|No topic is set in [_nick_place].
|
|No topic is set in [_nick_place].
|
||||||
|
|
||||||
@ -1382,6 +1437,10 @@ _status_place_topic_official
|
|||||||
|## Announcement:
|
|## Announcement:
|
||||||
|[_topic]
|
|[_topic]
|
||||||
|
|
||||||
|
_status_place_topic_author
|
||||||
|
|## Only appears on IRC access
|
||||||
|
|Topic set by [_nick] at [_time_place].
|
||||||
|
|
||||||
_status_description_time
|
_status_description_time
|
||||||
|[_nick] has been alive about [_time_idle] ago.
|
|[_nick] has been alive about [_time_idle] ago.
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<PSYC:TEXTDB> ## vim:syntax=mail
|
<PSYC:TEXTDB> ## vim:syntax=mail
|
||||||
|
## Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_message
|
_message
|
||||||
|MESSAGE sip:[_nick_target]@[_host_target] SIP/2.0
|
|MESSAGE sip:[_nick_target]@[_host_target] SIP/2.0
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
##|
|
##|
|
||||||
##|vorsicht: die chat-dienste funktionieren mit WinWAP nicht,
|
##|vorsicht: die chat-dienste funktionieren mit WinWAP nicht,
|
||||||
##| da dieser HTTP nicht korrekt implementiert.
|
##| da dieser HTTP nicht korrekt implementiert.
|
||||||
|
### Check utf-8: Praise Atatürk!
|
||||||
|
|
||||||
_error_invalid_agent_HTML
|
_error_invalid_agent_HTML
|
||||||
|<title>wap2psyc gateway</title>
|
|<title>wap2psyc gateway</title>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: interface.h,v 1.51 2008/04/09 16:49:23 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: interface.h,v 1.54 2008/08/26 13:42:24 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
#define _INCLUDE_INTERFACE_H
|
#define _INCLUDE_INTERFACE_H
|
||||||
|
|
||||||
// let's stay compatible for a while
|
// let's stay compatible for a while
|
||||||
@ -8,10 +8,12 @@
|
|||||||
# define SAVE_FORMAT 0
|
# define SAVE_FORMAT 0
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
#ifdef __psyclpc__
|
#ifndef __psyclpc__
|
||||||
# define DRIVER_VERSION "psyclpc/" __VERSION__
|
|
||||||
#else
|
|
||||||
# define DRIVER_VERSION "ldmud/" __VERSION__
|
# define DRIVER_VERSION "ldmud/" __VERSION__
|
||||||
|
#else
|
||||||
|
# define DRIVER_VERSION "psyclpc/" __VERSION__
|
||||||
|
|
||||||
|
# define hex2int(HEX) to_int("0x"+ HEX)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// driver abstraction kit -- abstraction layer from driver details
|
// driver abstraction kit -- abstraction layer from driver details
|
||||||
@ -114,6 +116,14 @@
|
|||||||
#define vamixed mixed
|
#define vamixed mixed
|
||||||
#define vaint int
|
#define vaint int
|
||||||
|
|
||||||
|
// extracts hh:mm:ss format from ctime output
|
||||||
|
#define hhmmss(CTIME) CTIME[11..18]
|
||||||
|
// extracts hh:mm format from ctime output (for idle times)
|
||||||
|
#define hhmm(CTIME) CTIME[11..15]
|
||||||
|
// typical timestamp string: hhmm or iso-date if older than 24 hours
|
||||||
|
#define time_or_date(TS) \
|
||||||
|
(time() - TS > 24*60*60 ? isotime(TS, 0) : hhmm(ctime( TS )))
|
||||||
|
|
||||||
#if __EFUN_DEFINED__(convert_charset)
|
#if __EFUN_DEFINED__(convert_charset)
|
||||||
# ifdef TRANSLIT // TRANSLIT has no effect whatsoever. grrr!
|
# ifdef TRANSLIT // TRANSLIT has no effect whatsoever. grrr!
|
||||||
# define iconv(s, FROM, TO) (s = convert_charset(s, FROM, TO +"//TRANSLIT"))
|
# define iconv(s, FROM, TO) (s = convert_charset(s, FROM, TO +"//TRANSLIT"))
|
||||||
@ -140,3 +150,9 @@
|
|||||||
# define DEBUG_TRACE "(DEBUG_TRACE disabled: DEBUG level below 1)"
|
# define DEBUG_TRACE "(DEBUG_TRACE disabled: DEBUG level below 1)"
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// some ldmud versions previous to 610 have a problem with digest-md5
|
||||||
|
#if __VERSION_MAJOR__ < 4 && __VERSION_MICRO__ < 611
|
||||||
|
# echo Warning: Your driver is so old, it cannot do DIGEST-MD5
|
||||||
|
# define _flag_disable_authentication_digest_MD5
|
||||||
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: master.c,v 1.61 2008/03/11 16:15:15 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: master.c,v 1.66 2008/07/20 21:26:04 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
//
|
//
|
||||||
#ifdef INIT_FILE
|
#ifdef INIT_FILE
|
||||||
#undef INIT_FILE
|
#undef INIT_FILE
|
||||||
@ -11,6 +11,12 @@ mixed valid_write(string path, string eff_user, string call, object caller);
|
|||||||
|
|
||||||
// bei amylaar und ldmud braucht master.c den absoluten pfad..
|
// bei amylaar und ldmud braucht master.c den absoluten pfad..
|
||||||
#include "/local/config.h"
|
#include "/local/config.h"
|
||||||
|
|
||||||
|
#ifdef Dmaster
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dmaster
|
||||||
|
#endif
|
||||||
|
|
||||||
#include NET_PATH "include/net.h"
|
#include NET_PATH "include/net.h"
|
||||||
#include DRIVER_PATH "sys/driver_hook.h"
|
#include DRIVER_PATH "sys/driver_hook.h"
|
||||||
#include DRIVER_PATH "sys/debug_message.h"
|
#include DRIVER_PATH "sys/debug_message.h"
|
||||||
@ -19,7 +25,7 @@ mixed valid_write(string path, string eff_user, string call, object caller);
|
|||||||
#ifdef PRO_PATH
|
#ifdef PRO_PATH
|
||||||
inherit PRO_PATH "master";
|
inherit PRO_PATH "master";
|
||||||
#else
|
#else
|
||||||
# include DRIVER_PATH "master/psycmuve.i"
|
inherit DRIVER_PATH "master/accept";
|
||||||
#endif
|
#endif
|
||||||
#include DRIVER_PATH "master/classic.i"
|
#include DRIVER_PATH "master/classic.i"
|
||||||
|
|
||||||
@ -177,23 +183,26 @@ void disconnect(object ob, string remaining) {
|
|||||||
string host = query_ip_name(ob);
|
string host = query_ip_name(ob);
|
||||||
string name = object_name(ob);
|
string name = object_name(ob);
|
||||||
|
|
||||||
PT(("disconnected: %O from %O%s\n", ob, host,
|
// happens when first clone fails:
|
||||||
|
unless (ob && objectp(ob) && ob != ME) return;
|
||||||
|
// this disconnect was expected behaviour:
|
||||||
|
if (ob->disconnected(remaining)) return;
|
||||||
|
// unexpected disconnection.
|
||||||
|
//
|
||||||
|
// disconnected() must return true when the
|
||||||
|
// socket disconnection was expected and is no
|
||||||
|
// cause for concern. if we got here, it is.
|
||||||
|
//
|
||||||
|
// 'remaining' is empty in most cases, still
|
||||||
|
// we don't output 'remaining' on console
|
||||||
|
// as it occasionally triggers a utf8 conversion error
|
||||||
|
// instead we drop this into a logfile
|
||||||
|
SIMUL_EFUN_FILE -> log_file("DISC", "%O %O %O\n",
|
||||||
|
name, host, remaining);
|
||||||
|
|
||||||
|
P2(("Unexpected disconnect in %s from %O%s\n", name, host,
|
||||||
remaining && strlen(remaining) ?
|
remaining && strlen(remaining) ?
|
||||||
" with "+ strlen(remaining) +" bytes remaining" : ""))
|
" with "+ strlen(remaining) +" bytes remaining" : ""))
|
||||||
// happens when first clone fails
|
|
||||||
unless (ob && objectp(ob) && ob != ME) return;
|
|
||||||
unless (ob->disconnected(remaining)) {
|
|
||||||
// disconnected() must return true when the
|
|
||||||
// socket disconnection was expected and is no
|
|
||||||
// cause for concern. if we got here, it is.
|
|
||||||
//
|
|
||||||
// 'remaining' is empty in most cases, still
|
|
||||||
// we don't output 'remaining' on console
|
|
||||||
// as it occasionally triggers a utf8 conversion error
|
|
||||||
// instead we drop this into a logfile
|
|
||||||
SIMUL_EFUN_FILE -> log_file("DISC", "%O %O %O\n",
|
|
||||||
name, host, remaining);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// even though the name of the function is weird, this is the
|
// even though the name of the function is weird, this is the
|
||||||
@ -217,7 +226,7 @@ void receive_udp(string host, string msg, int port) {
|
|||||||
case '|':
|
case '|':
|
||||||
unless (spycd) {
|
unless (spycd) {
|
||||||
spycd = SPYC_PATH "udp" -> load();
|
spycd = SPYC_PATH "udp" -> load();
|
||||||
PT(("SPYC UDP daemon created.\n"))
|
P1(("SPYC UDP daemon created.\n"))
|
||||||
unless (spycd) return;
|
unless (spycd) return;
|
||||||
}
|
}
|
||||||
spycd -> parseUDP(host, port, msg);
|
spycd -> parseUDP(host, port, msg);
|
||||||
@ -226,7 +235,7 @@ void receive_udp(string host, string msg, int port) {
|
|||||||
case '.':
|
case '.':
|
||||||
unless (psycd) {
|
unless (psycd) {
|
||||||
psycd = PSYC_PATH "udp" -> load();
|
psycd = PSYC_PATH "udp" -> load();
|
||||||
PT(("PSYC UDP daemon created.\n"))
|
P1(("PSYC UDP daemon created.\n"))
|
||||||
unless (psycd) return;
|
unless (psycd) return;
|
||||||
}
|
}
|
||||||
psycd -> parseUDP (host,port,msg);
|
psycd -> parseUDP (host,port,msg);
|
||||||
|
@ -1,398 +0,0 @@
|
|||||||
// $Id: psycmuve.i,v 1.113 2008/01/30 17:22:41 lynx Exp $ // vim:syntax=lpc:ts=8
|
|
||||||
//
|
|
||||||
// this file contains the glue between LDMUD and psyced to
|
|
||||||
// connect the socket ports to appropriately named objects.
|
|
||||||
//
|
|
||||||
#include NET_PATH "include/services.h"
|
|
||||||
#include DRIVER_PATH "include/driver.h"
|
|
||||||
#include CONFIG_PATH "config.h"
|
|
||||||
|
|
||||||
volatile int shutdown_in_progress = 0;
|
|
||||||
|
|
||||||
// not part of the master/driver API.. this is called from the library
|
|
||||||
void notify_shutdown_first(int progress) {
|
|
||||||
P3(("%O notify_shutdown_first(%O)\n", ME, progress))
|
|
||||||
shutdown_in_progress = progress;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef UID2NICK
|
|
||||||
# ifdef _userid_nick_mapping
|
|
||||||
# define UID2NICK(uid) ([ _userid_nick_mapping ])[uid]
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This function is called every time a TCP connection is established.
|
|
||||||
* It dispatches the ports to the protocol implementations.
|
|
||||||
* input_to() can't be called from here.
|
|
||||||
*
|
|
||||||
* uid is only passed if USE_AUTHLOCAL is built into the driver.
|
|
||||||
*/
|
|
||||||
object connect(int uid) {
|
|
||||||
int peerport;
|
|
||||||
mixed arg, t;
|
|
||||||
|
|
||||||
D2(if (uid) D("connected on port "+query_mud_port()+" by uid "+uid+"\n");)
|
|
||||||
#ifndef H_DEFAULT_PROMPT
|
|
||||||
set_prompt("");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (shutdown_in_progress) {
|
|
||||||
PT(("shutdown_in_progress(%O): putting connection from %O on hold\n",
|
|
||||||
shutdown_in_progress, query_ip_name(ME)))
|
|
||||||
// put the connection on hold to avoid further reconnects
|
|
||||||
return clone_object(NET_PATH "utility/onhold");
|
|
||||||
}
|
|
||||||
|
|
||||||
// we dont want the telnet machine most of the time
|
|
||||||
// but disabling and re-enabling it for telnet doesn't work
|
|
||||||
switch(query_mud_port()) {
|
|
||||||
|
|
||||||
#if HAS_PORT(PSYCS_PORT, PSYC_PATH)
|
|
||||||
case PSYCS_PORT: // inofficial & temporary
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
if (t < 0) PP(( "TLS on %O: %O\n",
|
|
||||||
query_mud_port(), tls_error(t) ));
|
|
||||||
#endif // fall thru
|
|
||||||
#if HAS_PORT(PSYC_PORT, PSYC_PATH)
|
|
||||||
case PSYC_PORT:
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(PSYC_PORT, PSYC_PATH) || HAS_PORT(PSYCS_PORT, PSYC_PATH)
|
|
||||||
# ifdef DRIVER_HAS_CALL_BY_REFERENCE
|
|
||||||
arg = ME;
|
|
||||||
query_ip_number(&arg);
|
|
||||||
// this assumes network byte order provided by driver
|
|
||||||
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 == PSYC_SERVICE) peerport = 0;
|
|
||||||
# else
|
|
||||||
// as long as the object names don't collide, this is okay too
|
|
||||||
peerport = 65536 + random(9999999);
|
|
||||||
# endif
|
|
||||||
# ifdef DRIVER_HAS_RENAMED_CLONES
|
|
||||||
t = "S:psyc:"+query_ip_number();
|
|
||||||
// tcp peerports cannot be connected to, so we use minus
|
|
||||||
if (peerport) t += ":-"+peerport;
|
|
||||||
# else
|
|
||||||
t = clone_object(PSYC_PATH "server");
|
|
||||||
# endif
|
|
||||||
// the psyc backend distinguishes listen ports from peers using minus
|
|
||||||
D3(D(S("%O -> load(%O, %O)\n", t, query_ip_number(), -peerport));)
|
|
||||||
return t -> load(query_ip_number(), -peerport);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(SPYCS_PORT, SPYC_PATH)
|
|
||||||
case SPYCS_PORT: // inofficial & temporary
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
if (t < 0) PP(( "TLS on %O: %O\n",
|
|
||||||
query_mud_port(), tls_error(t) ));
|
|
||||||
#endif // fall thru
|
|
||||||
#if HAS_PORT(SPYC_PORT, SPYC_PATH)
|
|
||||||
case SPYC_PORT:
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(SPYC_PORT, SPYC_PATH) || HAS_PORT(SPYCS_PORT, SPYC_PATH)
|
|
||||||
# ifdef DRIVER_HAS_CALL_BY_REFERENCE
|
|
||||||
arg = ME;
|
|
||||||
query_ip_number(&arg);
|
|
||||||
// this assumes network byte order provided by driver
|
|
||||||
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;
|
|
||||||
# else
|
|
||||||
// as long as the object names don't collide, this is okay too
|
|
||||||
peerport = 65536 + random(9999999);
|
|
||||||
# endif
|
|
||||||
# ifdef DRIVER_HAS_RENAMED_CLONES
|
|
||||||
t = "S:psyc:"+query_ip_number();
|
|
||||||
// tcp peerports cannot be connected to, so we use minus
|
|
||||||
if (peerport) t += ":-"+peerport;
|
|
||||||
# else
|
|
||||||
t = clone_object(SPYC_PATH "server");
|
|
||||||
# endif
|
|
||||||
// the psyc backend distinguishes listen ports from peers using minus
|
|
||||||
D3(D(S("%O -> load(%O, %O)\n", t, query_ip_number(), -peerport));)
|
|
||||||
return t -> load(query_ip_number(), -peerport);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(POP3S_PORT, POP3_PATH)
|
|
||||||
case POP3S_PORT:
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
if (t < 0) PP(( "TLS on %O: %O\n",
|
|
||||||
query_mud_port(), tls_error(t) ));
|
|
||||||
return clone_object(POP3_PATH "server");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(POP3_PORT, POP3_PATH)
|
|
||||||
case POP3_PORT:
|
|
||||||
return clone_object(POP3_PATH "server");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(SMTPS_PORT, NNTP_PATH)
|
|
||||||
case SMTPS_PORT:
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
if (t < 0) PP(( "TLS on %O: %O\n",
|
|
||||||
query_mud_port(), tls_error(t) ));
|
|
||||||
return clone_object(SMTP_PATH "server");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(SMTP_PORT, SMTP_PATH)
|
|
||||||
case SMTP_PORT:
|
|
||||||
return clone_object(SMTP_PATH "server");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// heldensagas little http app
|
|
||||||
#if HAS_PORT(SHT_PORT, SHT_PATH)
|
|
||||||
case SHT_PORT:
|
|
||||||
return clone_object(SHT_PATH "server");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(NNTPS_PORT, NNTP_PATH)
|
|
||||||
case NNTPS_PORT:
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
if (t < 0) PP(( "TLS on %O: %O\n",
|
|
||||||
query_mud_port(), tls_error(t) ));
|
|
||||||
return clone_object(NNTP_PATH "server");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(NNTP_PORT, NNTP_PATH)
|
|
||||||
case NNTP_PORT:
|
|
||||||
return clone_object(NNTP_PATH "server");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(JABBERS_PORT, JABBER_PATH)
|
|
||||||
case JABBERS_PORT:
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
if (t < 0) PP(( "TLS on %O: %O\n",
|
|
||||||
query_mud_port(), tls_error(t) ));
|
|
||||||
return clone_object(JABBER_PATH "server");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(JABBER_PORT, JABBER_PATH)
|
|
||||||
case JABBER_PORT:
|
|
||||||
# if __EFUN_DEFINED__(enable_telnet)
|
|
||||||
enable_telnet(0); // are you sure!???
|
|
||||||
# endif
|
|
||||||
return clone_object(JABBER_PATH "server");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(JABBER_S2S_PORT, JABBER_PATH)
|
|
||||||
case JABBER_S2S_PORT:
|
|
||||||
# ifdef DRIVER_HAS_CALL_BY_REFERENCE
|
|
||||||
arg = ME;
|
|
||||||
query_ip_number(&arg);
|
|
||||||
// this assumes network byte order provided by driver
|
|
||||||
peerport = pointerp(arg) ? (arg[2]*256 + arg[3]) : 0;
|
|
||||||
if (peerport < 0) peerport = 65536 + peerport;
|
|
||||||
if (peerport == JABBER_S2S_SERVICE) peerport = 0;
|
|
||||||
# else
|
|
||||||
// as long as the object names don't collide, this is okay too
|
|
||||||
peerport = 65536 + random(9999999);
|
|
||||||
# endif
|
|
||||||
# if __EFUN_DEFINED__(enable_telnet)
|
|
||||||
enable_telnet(0);
|
|
||||||
# endif
|
|
||||||
t = "S:xmpp:"+query_ip_number();
|
|
||||||
// it's just an object name, but let's be consequent minus peerport
|
|
||||||
if (peerport) t += ":-"+peerport;
|
|
||||||
# ifdef _flag_log_sockets_XMPP
|
|
||||||
SIMUL_EFUN_FILE -> log_file("RAW_XMPP", "\n\n%O: %O -> load(%O, %O)",
|
|
||||||
ME, t,
|
|
||||||
# ifdef _flag_log_hosts
|
|
||||||
query_ip_number(),
|
|
||||||
# else
|
|
||||||
"?",
|
|
||||||
# endif
|
|
||||||
-peerport);
|
|
||||||
# endif
|
|
||||||
P3(("%O -> load(%O, %O)\n", t, query_ip_number(), -peerport))
|
|
||||||
return t -> load(query_ip_number(), -peerport);
|
|
||||||
#endif
|
|
||||||
#if 0 //__EFUN_DEFINED__(enable_binary)
|
|
||||||
// work in progress
|
|
||||||
case 8888:
|
|
||||||
enable_binary();
|
|
||||||
enable_telnet(0);
|
|
||||||
return clone_object(NET_PATH "socks/protocol");
|
|
||||||
case 1935:
|
|
||||||
enable_binary();
|
|
||||||
enable_telnet(0);
|
|
||||||
return clone_object(NET_PATH "rtmp/protocol");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(IRCS_PORT, IRC_PATH)
|
|
||||||
case IRCS_PORT:
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
if (t < 0) PP(( "TLS on %O: %O\n",
|
|
||||||
query_mud_port(), tls_error(t) ));
|
|
||||||
return clone_object(IRC_PATH "server");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(IRC_PORT, IRC_PATH)
|
|
||||||
case IRC_PORT:
|
|
||||||
# if 0 // __EFUN_DEFINED__(enable_telnet)
|
|
||||||
enable_telnet(0); // shouldn't harm.. but it does!!!
|
|
||||||
# endif
|
|
||||||
return clone_object(IRC_PATH "server");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(APPLET_PORT, APPLET_PATH)
|
|
||||||
case APPLET_PORT:
|
|
||||||
# if __EFUN_DEFINED__(enable_telnet)
|
|
||||||
// enable_telnet(0);
|
|
||||||
# endif
|
|
||||||
return clone_object(APPLET_PATH "server");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(TELNETS_PORT, TELNET_PATH)
|
|
||||||
case TELNETS_PORT:
|
|
||||||
return clone_object(TELNET_PATH "sslserver");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(TELNET_PORT, TELNET_PATH)
|
|
||||||
case TELNET_PORT:
|
|
||||||
// set_prompt("> ");
|
|
||||||
t = clone_object(TELNET_PATH "server");
|
|
||||||
# ifdef UID2NICK
|
|
||||||
if (uid && (arg = UID2NICK(uid))) {
|
|
||||||
t -> sName(arg);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
return t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(HTTPS_PORT, HTTP_PATH)
|
|
||||||
case HTTPS_PORT:
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
// should it return 0 in a tls_error case?
|
|
||||||
D1( if (t < 0) PP(( "TLS(%O) on %O: %O\n", t, query_mud_port(), tls_error(t) )); )
|
|
||||||
D2( else if (t > 0) PP(( "Setting up TLS connection in the background.\n" )); )
|
|
||||||
D2( else PP(( "Oh yeah, I'm initializing an https session!\n" )); )
|
|
||||||
return clone_object(HTTP_PATH "server");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(HTTP_PORT, HTTP_PATH)
|
|
||||||
case HTTP_PORT:
|
|
||||||
return clone_object(HTTP_PATH "server");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAS_PORT(MUDS_PORT, MUD_PATH)
|
|
||||||
case MUDS_PORT:
|
|
||||||
t = tls_init_connection(this_object());
|
|
||||||
if (t < 0) PP(( "TLS on %O: %O\n",
|
|
||||||
query_mud_port(), tls_error(t) ));
|
|
||||||
return clone_object(MUD_PATH "login");
|
|
||||||
#endif
|
|
||||||
#if HAS_PORT(MUD_PORT, MUD_PATH)
|
|
||||||
default:
|
|
||||||
// if you want to multiplex psyced with an LPMUD game
|
|
||||||
// set_prompt("> ");
|
|
||||||
return clone_object(MUD_PATH "login");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
PP(("Received connection on port %O which isn't configured.\n",
|
|
||||||
query_mud_port()));
|
|
||||||
return (object)0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DRIVER_HAS_RENAMED_CLONES
|
|
||||||
// named clones -lynx
|
|
||||||
object compile_object(string file) {
|
|
||||||
string path, name;
|
|
||||||
object rob;
|
|
||||||
|
|
||||||
# ifdef PSYC_PATH
|
|
||||||
if (abbrev("S:psyc:", file)) {
|
|
||||||
rob = clone_object(PSYC_PATH "server");
|
|
||||||
D2(if (rob) PP(("NAMED CLONE: %O => %s\n", rob, file));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
if (abbrev("psyc:", file)) {
|
|
||||||
rob = clone_object(PSYC_PATH "active");
|
|
||||||
D2(if (rob) PP(("NAMED CLONE: %O => %s\n", rob, file));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
# ifdef SPYC_PATH
|
|
||||||
if (abbrev("S:psyc:", file)) {
|
|
||||||
rob = clone_object(SPYC_PATH "server");
|
|
||||||
D2(if (rob) PP(("NAMED CLONE: %O => %s\n", rob, file));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
if (abbrev("psyc:", file)) {
|
|
||||||
rob = clone_object(SPYC_PATH "active");
|
|
||||||
D2(if (rob) PP(("NAMED CLONE: %O => %s\n", rob, file));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
# ifdef HTTP_PATH
|
|
||||||
// match both http:/ and https:/ objects ;D
|
|
||||||
if (abbrev("http", file)) {
|
|
||||||
rob = clone_object(HTTP_PATH "fetch");
|
|
||||||
if (rob) rob->fetch(file[..<3]);
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
if (abbrev("xmlrpc:", file)) {
|
|
||||||
rob = clone_object(HTTP_PATH "xmlrpc");
|
|
||||||
if (rob) rob->fetch("http://" + file[7..<3]);
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
if (sscanf(file, "%s#%s.c", path, name) && name != "") {
|
|
||||||
// my function in simul_efun
|
|
||||||
unless (name = SIMUL_EFUN_FILE->legal_name(name)) return (object)0;
|
|
||||||
|
|
||||||
rob = clone_object(path);
|
|
||||||
rob -> sName(name);
|
|
||||||
D2(if (rob) PP(("NAMED CLONE: %O becomes %s of %s\n",
|
|
||||||
rob, name, path));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
if (sscanf(file, "place/%s.c", name) && name != "") {
|
|
||||||
#ifdef SANDBOX
|
|
||||||
string t;
|
|
||||||
#endif
|
|
||||||
// my function in simul_efun
|
|
||||||
unless (name = SIMUL_EFUN_FILE->legal_name(name)) return (object)0;
|
|
||||||
|
|
||||||
#ifdef SANDBOX
|
|
||||||
if (file_size(t = USER_PATH + name + ".c") != -1) {
|
|
||||||
rob = t -> sName(name);
|
|
||||||
D2(if (rob) PP(("USER PLACE loaded: %O becomes %O\n", rob, file));)
|
|
||||||
} else {
|
|
||||||
#endif
|
|
||||||
#ifdef _flag_disable_places_arbitrary
|
|
||||||
P2(("WARN: cloned places disabled by #define %O\n", file))
|
|
||||||
return (object)0;
|
|
||||||
#else
|
|
||||||
#ifdef _path_archetype_place_default
|
|
||||||
rob = clone_object(_path_archetype_place_default);
|
|
||||||
#else
|
|
||||||
rob = clone_object(NET_PATH "place/default");
|
|
||||||
#endif
|
|
||||||
rob -> sName(name);
|
|
||||||
D2(if (rob) PP(("PLACE CLONED: %O becomes %O\n", rob, file));)
|
|
||||||
#endif
|
|
||||||
#ifdef SANDBOX
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
if (sscanf(file, "%s/text.c", path) && path != "") {
|
|
||||||
rob = clone_object(NET_PATH "text");
|
|
||||||
rob -> sPath(path);
|
|
||||||
D2(if (rob) PP(("DB CLONED: %O becomes %s/text\n", rob, path));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
# ifdef JABBER_PATH
|
|
||||||
if (abbrev("S:xmpp:", file)) {
|
|
||||||
rob = clone_object(JABBER_PATH "gateway");
|
|
||||||
D2(if (rob) PP(("NAMED CLONE: %O => %s\n", rob, file));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
if (abbrev("C:xmpp:", file)) {
|
|
||||||
rob = clone_object(JABBER_PATH "active");
|
|
||||||
D2(if (rob) PP(("NAMED CLONE: %O => %s\n", rob, file));)
|
|
||||||
return rob;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
P0(("WARN: could not create %O\n", file))
|
|
||||||
return (object)0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
@ -84,4 +84,7 @@
|
|||||||
#define TLS_HASH_MD5 (6)
|
#define TLS_HASH_MD5 (6)
|
||||||
#define TLS_HASH_RIPEMD160 (7)
|
#define TLS_HASH_RIPEMD160 (7)
|
||||||
|
|
||||||
|
/* autodetect feature: when no TLS is found on socket, this code is returned */
|
||||||
|
#define ERR_TLS_NOT_DETECTED -31337
|
||||||
|
|
||||||
#endif /* LPC_TLS_H */
|
#endif /* LPC_TLS_H */
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: interface.h,v 1.31 2008/04/09 16:49:23 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: interface.h,v 1.32 2008/04/18 13:34:38 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
// several things in here do not look like they were optimized for pike.. TODO
|
// several things in here do not look like they were optimized for pike.. TODO
|
||||||
|
|
||||||
#define _INCLUDE_INTERFACE_H
|
#define _INCLUDE_INTERFACE_H
|
||||||
@ -128,6 +128,15 @@
|
|||||||
#define to_string(XXX) ((string) XXX)
|
#define to_string(XXX) ((string) XXX)
|
||||||
#define to_int(XXX) ((int) XXX)
|
#define to_int(XXX) ((int) XXX)
|
||||||
|
|
||||||
|
// ... this stuff may want to be done in a more pikey way
|
||||||
|
// extracts hh:mm:ss format from ctime output
|
||||||
|
#define hhmmss(CTIME) CTIME[11..18]
|
||||||
|
// extracts hh:mm format from ctime output (for idle times)
|
||||||
|
#define hhmm(CTIME) CTIME[11..15]
|
||||||
|
// typical timestamp string: hhmm or iso-date if older than 24 hours
|
||||||
|
#define time_or_date(TS) \
|
||||||
|
(time() - TS > 24*60*60 ? isotime(TS, 0) : hhmm(ctime( TS )))
|
||||||
|
|
||||||
// TODO *** stuff that needs to be solved better *** //
|
// TODO *** stuff that needs to be solved better *** //
|
||||||
#define interactive(ME) ME
|
#define interactive(ME) ME
|
||||||
//#define find_service(NAME) 0
|
//#define find_service(NAME) 0
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||||
// $Id: circuit.c,v 1.104 2008/03/29 20:05:32 lynx Exp $
|
// $Id: circuit.c,v 1.107 2008/07/04 18:37:21 lynx Exp $
|
||||||
//
|
//
|
||||||
// net/circuit - generic circuit manager
|
// net/circuit - generic circuit manager
|
||||||
//
|
//
|
||||||
@ -16,6 +16,12 @@
|
|||||||
// also.. maybe one day this object will take care of _context
|
// also.. maybe one day this object will take care of _context
|
||||||
// optimizations.. just maybe.. maybe the places will do..
|
// optimizations.. just maybe.. maybe the places will do..
|
||||||
|
|
||||||
|
// local debug messages - turn them on by using psyclpc -DDcircuit=<level>
|
||||||
|
#ifdef Dcircuit
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dcircuit
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(DEBUG) && DEBUG > 1
|
#if defined(DEBUG) && DEBUG > 1
|
||||||
# define CONNECT_RETRY 2 // seconds for testing
|
# define CONNECT_RETRY 2 // seconds for testing
|
||||||
#else
|
#else
|
||||||
@ -77,7 +83,7 @@ void reconnect() {
|
|||||||
if (ISSYNC || retry++ < MAX_RETRY) {
|
if (ISSYNC || retry++ < MAX_RETRY) {
|
||||||
waitforme = waitforme * 2 + random(waitforme);
|
waitforme = waitforme * 2 + random(waitforme);
|
||||||
call_out(#'connect, waitforme);
|
call_out(#'connect, waitforme);
|
||||||
P1(("%O trying to reconnect in %d secs\n", ME, waitforme))
|
P2(("%O trying to reconnect in %d secs\n", ME, waitforme))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
connect_failure("_repeated",
|
connect_failure("_repeated",
|
||||||
@ -89,7 +95,7 @@ void pushback(string failmc) {
|
|||||||
mixed *t, o;
|
mixed *t, o;
|
||||||
mapping vars;
|
mapping vars;
|
||||||
|
|
||||||
P1(("%O pushback of queue(%O) (size %O).\n", failmc, me, qSize(me)))
|
P2(("%O pushback of queue(%O) (size %O).\n", failmc, me, qSize(me)))
|
||||||
while(qSize(me) && (t = shift(me))) {
|
while(qSize(me) && (t = shift(me))) {
|
||||||
// is it okay to append pushback mc?
|
// is it okay to append pushback mc?
|
||||||
// or should we even append the mc of the respective message!?
|
// or should we even append the mc of the respective message!?
|
||||||
@ -115,7 +121,7 @@ void pushback(string failmc) {
|
|||||||
if (t[1] == mc) {
|
if (t[1] == mc) {
|
||||||
// this happens when the place is stupid enough to
|
// this happens when the place is stupid enough to
|
||||||
// castmsg the failure.
|
// castmsg the failure.
|
||||||
P0(("%O caught attempt to resend %O to %O || %O\n",
|
P1(("%O caught attempt to resend %O to %O || %O\n",
|
||||||
ME, mc, o, t[0]))
|
ME, mc, o, t[0]))
|
||||||
} else sendmsg(o || t[0], mc, // ok, should this message really
|
} else sendmsg(o || t[0], mc, // ok, should this message really
|
||||||
// have its original target as
|
// have its original target as
|
||||||
@ -151,6 +157,8 @@ void pushback(string failmc) {
|
|||||||
// P2(("%O qDel(%O) and autodestruct\n", ME, me))
|
// P2(("%O qDel(%O) and autodestruct\n", ME, me))
|
||||||
qDel(me); // not sure if this is necessary but looks safer
|
qDel(me); // not sure if this is necessary but looks safer
|
||||||
destruct(ME);
|
destruct(ME);
|
||||||
|
// alright. so this is where we want to do something
|
||||||
|
// differently, like remember that this host didn't work. TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
// wouldn't it be nicer to also pass real vars here?
|
// wouldn't it be nicer to also pass real vars here?
|
||||||
@ -162,7 +170,7 @@ void connect_failure(string mc, string reason) {
|
|||||||
|
|
||||||
int msg(string source, string method, string data,
|
int msg(string source, string method, string data,
|
||||||
mapping vars, int showingLog, mixed target) {
|
mapping vars, int showingLog, mixed target) {
|
||||||
P0(("%O:msg() shouldn't get called. overload me!\n", ME))
|
P1(("%O:msg() shouldn't get called. overload me!\n", ME))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +180,7 @@ circuit(ho, po, transport, srv, whoami, sysQ, uniform) {
|
|||||||
// happens apparently when a racing condition occurs
|
// happens apparently when a racing condition occurs
|
||||||
// during upgrade from xmpp to psyc.. hm! queue fails
|
// during upgrade from xmpp to psyc.. hm! queue fails
|
||||||
// to deliver in that case and waits for next chance TODO
|
// to deliver in that case and waits for next chance TODO
|
||||||
P0(("%O loaded twice for %O and %O\n", ME, me, whoami))
|
P1(("%O loaded twice for %O and %O\n", ME, me, whoami))
|
||||||
return ME;
|
return ME;
|
||||||
}
|
}
|
||||||
q = mappingp(sysQ) ? sysQ : system_queue();
|
q = mappingp(sysQ) ? sysQ : system_queue();
|
||||||
@ -196,7 +204,7 @@ circuit(ho, po, transport, srv, whoami, sysQ, uniform) {
|
|||||||
// who needs this? who calls this? /rm and derivatives. shutdown() too.
|
// who needs this? who calls this? /rm and derivatives. shutdown() too.
|
||||||
// net/psyc/active because net/psyc/server has its own
|
// net/psyc/active because net/psyc/server has its own
|
||||||
quit() {
|
quit() {
|
||||||
P1(("%O quit.\n", ME))
|
P2(("%O quit.\n", ME))
|
||||||
remove_interactive(ME);
|
remove_interactive(ME);
|
||||||
//destruct(ME);
|
//destruct(ME);
|
||||||
}
|
}
|
||||||
@ -205,7 +213,7 @@ runQ() {
|
|||||||
mixed *t, source;
|
mixed *t, source;
|
||||||
|
|
||||||
D2(unless (me) raise_error("unitialized circuit\n");)
|
D2(unless (me) raise_error("unitialized circuit\n");)
|
||||||
P2(( "%O runQ of size %O\n", ME, qSize(me)))
|
P3(( "%O runQ of size %O\n", ME, qSize(me)))
|
||||||
// causes an exception when q is too big
|
// causes an exception when q is too big
|
||||||
P4(( "%O\n", q))
|
P4(( "%O\n", q))
|
||||||
while (qSize(me) && (t = shift(me))) {
|
while (qSize(me) && (t = shift(me))) {
|
||||||
@ -231,7 +239,7 @@ runQ() {
|
|||||||
|
|
||||||
connect(ho, po, transport, srv) {
|
connect(ho, po, transport, srv) {
|
||||||
if (interactive()) return -8;
|
if (interactive()) return -8;
|
||||||
P2(("connect: %O, %O, %O, %O for %O\n", ho, po, transport, srv, ME))
|
P3(("connect: %O, %O, %O, %O for %O\n", ho, po, transport, srv, ME))
|
||||||
if (time() < time_of_connect_attempt + waitforme) return -2;
|
if (time() < time_of_connect_attempt + waitforme) return -2;
|
||||||
if (ho) { // paranoid: stringp(ho) && strlen(ho)) {
|
if (ho) { // paranoid: stringp(ho) && strlen(ho)) {
|
||||||
if (po) port = po;
|
if (po) port = po;
|
||||||
@ -242,7 +250,7 @@ connect(ho, po, transport, srv) {
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
host = lower_case(ho);
|
host = lower_case(ho);
|
||||||
P1(("connect.%s:\t%O, %O, %O\t%O\n", srv || "to",
|
P2(("connect.%s:\t%O, %O, %O\t%O\n", srv || "to",
|
||||||
ho, po, transport, ME))
|
ho, po, transport, ME))
|
||||||
}
|
}
|
||||||
#ifndef ERQ_WITHOUT_SRV
|
#ifndef ERQ_WITHOUT_SRV
|
||||||
@ -287,13 +295,13 @@ varargs int enqueue(mixed source, string method, string data,
|
|||||||
// with a context *instead* of a source, so it's pointless to complain...
|
// with a context *instead* of a source, so it's pointless to complain...
|
||||||
//
|
//
|
||||||
// unless (vars["_source"]) {
|
// unless (vars["_source"]) {
|
||||||
// P0(("tell lynX: enqueue without _source for %O from %O in %O\n",
|
// P1(("tell lynX: enqueue without _source for %O from %O in %O\n",
|
||||||
// method, source, ME))
|
// method, source, ME))
|
||||||
// //vars["_source"] = psyc_name(source);
|
// //vars["_source"] = psyc_name(source);
|
||||||
// raise_error("tell lynX where it happened!!\n");
|
// raise_error("tell lynX where it happened!!\n");
|
||||||
// }
|
// }
|
||||||
#endif
|
#endif
|
||||||
P3(("enqueue for %O\n", source))
|
P4(("enqueue for %O\n", source))
|
||||||
connect(); // will only connect if we once had been connected before
|
connect(); // will only connect if we once had been connected before
|
||||||
return ::enqueue(me, ({ source, method, data, vars, target, mvars }) );
|
return ::enqueue(me, ({ source, method, data, vars, target, mvars }) );
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,15 @@
|
|||||||
// $Id: connect.c,v 1.49 2008/03/29 20:05:32 lynx Exp $ // vim:syntax=lpc
|
// $Id: connect.c,v 1.54 2008/12/10 22:53:33 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// net/connect: generic handler for active connections
|
// net/connect: generic handler for active connections
|
||||||
// most methods are intended for overloading except for the connect2()
|
// most methods are intended for overloading except for the connect2()
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// local debug messages - turn them on by using psyclpc -DDconnect=<level>
|
||||||
|
#ifdef Dconnect
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dconnect
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -24,9 +31,14 @@ protected connect_failure(mc, text) {
|
|||||||
protected int logon(int failure) {
|
protected int logon(int failure) {
|
||||||
if (is_connecting == "s") {
|
if (is_connecting == "s") {
|
||||||
is_connecting = 0;
|
is_connecting = 0;
|
||||||
P1(("%O connected to %O from %O. TLS requested.\n", ME,
|
#if __EFUN_DEFINED__(tls_init_connection)
|
||||||
|
P2(("%O connected to %O from %O. TLS requested.\n", ME,
|
||||||
query_ip_number(ME), query_mud_port(ME)))
|
query_ip_number(ME), query_mud_port(ME)))
|
||||||
tls_init_connection(ME, #'logon);
|
tls_init_connection(ME, #'logon);
|
||||||
|
#else
|
||||||
|
connect_failure("_unsafe", "security not available");
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
is_connecting = 0;
|
is_connecting = 0;
|
||||||
if (failure == -1 || !interactive(ME)) {
|
if (failure == -1 || !interactive(ME)) {
|
||||||
@ -54,6 +66,9 @@ protected int logon(int failure) {
|
|||||||
#endif
|
#endif
|
||||||
unless (hostCheck(query_ip_number(ME), query_mud_port(ME)))
|
unless (hostCheck(query_ip_number(ME), query_mud_port(ME)))
|
||||||
return block();
|
return block();
|
||||||
|
#if __EFUN_DEFINED__(enable_telnet)
|
||||||
|
enable_telnet(0, ME);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +92,7 @@ protected canonical_host(cane, ip, host) {
|
|||||||
private connect2(ip, port, host) {
|
private connect2(ip, port, host) {
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
P2(("%O connect2(%O, %O, %O) == %O\n", ME, ip, port, host, chost(ip)))
|
P3(("%O connect2(%O, %O, %O) == %O\n", ME, ip, port, host, chost(ip)))
|
||||||
unless (stringp(ip)) {
|
unless (stringp(ip)) {
|
||||||
connect_failure("_resolve", host+" does not resolve");
|
connect_failure("_resolve", host+" does not resolve");
|
||||||
return;
|
return;
|
||||||
@ -97,11 +112,11 @@ private connect2(ip, port, host) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if __EFUN_DEFINED__(net_connect)
|
#if __EFUN_DEFINED__(net_connect)
|
||||||
P2(("REALLY calling net_connect(%O, %O)\n", ip, port))
|
P3(("REALLY calling net_connect(%O, %O)\n", ip, port))
|
||||||
rc = net_connect(ip, port);
|
rc = net_connect(ip, port);
|
||||||
switch(rc) {
|
switch(rc) {
|
||||||
case 0:
|
case 0:
|
||||||
P2(("%O connecting(%O, %O, %O) == %O\n",
|
P3(("%O connecting(%O, %O, %O) == %O\n",
|
||||||
ME, ip, port, host, chost(ip)))
|
ME, ip, port, host, chost(ip)))
|
||||||
break;
|
break;
|
||||||
case EMFILE:
|
case EMFILE:
|
||||||
@ -151,6 +166,8 @@ connect(host, port, transport) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
disconnected(remaining) {
|
disconnected(remaining) {
|
||||||
|
P2(("%O got disconnected(%O). it was %s connected.\n", ME, remaining,
|
||||||
|
query_once_interactive(ME) ? "once" : "never"))
|
||||||
connect_failure("_disconnect", "lost connection");
|
connect_failure("_disconnect", "lost connection");
|
||||||
return 0; // unexpected
|
return 0; // unexpected
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// vim:foldmethod=marker:syntax=lpc
|
// vim:foldmethod=marker:syntax=lpc
|
||||||
// $Id: entity.c,v 1.123 2008/03/29 20:05:32 lynx Exp $
|
// $Id: entity.c,v 1.127 2008/08/05 12:24:16 lynx Exp $
|
||||||
//
|
//
|
||||||
// entity.c: anything that has a UNI (see http://about.psyc.eu/uniform)
|
// entity.c: anything that has a UNI (see http://about.psyc.eu/uniform)
|
||||||
// this file handles some low-level issues with being an entity:
|
// this file handles some low-level issues with being an entity:
|
||||||
@ -12,6 +12,12 @@
|
|||||||
// * trust network: figure out who we trust and who we can ask to find
|
// * trust network: figure out who we trust and who we can ask to find
|
||||||
// out if someone is trustworthy etc etc
|
// out if someone is trustworthy etc etc
|
||||||
|
|
||||||
|
// local debug messages - turn them on by using psyclpc -DDentity=<level>
|
||||||
|
#ifdef Dentity
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dentity
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <storage.h>
|
#include <storage.h>
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
@ -99,7 +105,7 @@ inherit NET_PATH "state";
|
|||||||
: _memory[target] = m_allocate(0, 2))
|
: _memory[target] = m_allocate(0, 2))
|
||||||
#endif //}}}
|
#endif //}}}
|
||||||
|
|
||||||
#ifdef TRUSTINESS
|
#ifndef _flag_disable_module_trust
|
||||||
// first try to implement trust for remote ( means.. not a direct peer
|
// first try to implement trust for remote ( means.. not a direct peer
|
||||||
// inside the friendsnet ) objects
|
// inside the friendsnet ) objects
|
||||||
volatile mapping _trust;
|
volatile mapping _trust;
|
||||||
@ -275,6 +281,7 @@ msg(source, mc, data, vars) {
|
|||||||
unless (member(vars, x)) vars[x] = y;
|
unless (member(vars, x)) vars[x] = y;
|
||||||
}
|
}
|
||||||
#else //FORK }}}
|
#else //FORK }}}
|
||||||
|
# ifndef _flag_disable_module_authentication
|
||||||
// person.c only calls this for stringp(source), so why check here again?
|
// person.c only calls this for stringp(source), so why check here again?
|
||||||
// because place/basic.c calls this for all sorts of sources. why this
|
// because place/basic.c calls this for all sorts of sources. why this
|
||||||
// inconsistency? and what about local string sources? TODO
|
// inconsistency? and what about local string sources? TODO
|
||||||
@ -351,7 +358,7 @@ msg(source, mc, data, vars) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (t) {
|
if (t) {
|
||||||
#if 1
|
# if 1
|
||||||
// we can either decide to see our own locations as source
|
// we can either decide to see our own locations as source
|
||||||
// since that's what the code in person.c already does, we'll
|
// since that's what the code in person.c already does, we'll
|
||||||
// try this option first
|
// try this option first
|
||||||
@ -368,7 +375,7 @@ msg(source, mc, data, vars) {
|
|||||||
// line a client can propose its own _nick and
|
// line a client can propose its own _nick and
|
||||||
// will be successful. hm!
|
// will be successful. hm!
|
||||||
}
|
}
|
||||||
#else
|
# else //{{{
|
||||||
// or copy them into a var, then compare everywhere
|
// or copy them into a var, then compare everywhere
|
||||||
// this requires a rewrite of all of the v("locations") code
|
// this requires a rewrite of all of the v("locations") code
|
||||||
vars["_location"] = source;
|
vars["_location"] = source;
|
||||||
@ -376,14 +383,15 @@ msg(source, mc, data, vars) {
|
|||||||
source = t;
|
source = t;
|
||||||
// don't trust what the client says
|
// don't trust what the client says
|
||||||
if (objectp(t)) vars["_nick"] = t->qName();
|
if (objectp(t)) vars["_nick"] = t->qName();
|
||||||
#endif
|
# endif //}}}
|
||||||
// do we really want to delete it also in the else case?
|
// do we really want to delete it also in the else case?
|
||||||
} else m_delete(vars, "_source_identification");
|
} else m_delete(vars, "_source_identification");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# endif // _flag_disable_module_authentication
|
||||||
#endif // !FORK
|
#endif // !FORK
|
||||||
|
|
||||||
#ifdef TRUSTINESS
|
#ifndef _flag_disable_module_trust
|
||||||
// this mechanism does not work for objectp(source) because uni::msg is not
|
// this mechanism does not work for objectp(source) because uni::msg is not
|
||||||
// called for objects. TODO
|
// called for objects. TODO
|
||||||
// this stuff works alot like _request_auth.. i still think there might be
|
// this stuff works alot like _request_auth.. i still think there might be
|
||||||
@ -491,7 +499,7 @@ msg(source, mc, data, vars) {
|
|||||||
"_trustiness" : trustiness ]));
|
"_trustiness" : trustiness ]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // _flag_disable_module_trust
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,7 +514,7 @@ create() {
|
|||||||
ASSERT("entity::create() !uni2unl", !uni2unl, uni2unl)
|
ASSERT("entity::create() !uni2unl", !uni2unl, uni2unl)
|
||||||
uni2unl = ([ ]);
|
uni2unl = ([ ]);
|
||||||
#endif //}}}
|
#endif //}}}
|
||||||
#ifdef TRUSTINESS
|
#ifndef _flag_disable_module_trust
|
||||||
_trust = ([ ]);
|
_trust = ([ ]);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENTITY_STATE //{{{
|
#ifdef ENTITY_STATE //{{{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: generic.c,v 1.36 2008/02/08 12:53:25 lynx Exp $ // vim:syntax=lpc
|
// $Id: generic.c,v 1.39 2008/07/12 19:48:39 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// this is a generic robot that provides a few commands to interface
|
// this is a generic robot that provides a few commands to interface
|
||||||
// a centralistic messaging system to the PSYC. since the commercial
|
// a centralistic messaging system to the PSYC. since the commercial
|
||||||
@ -24,7 +24,6 @@ volatile object psycer;
|
|||||||
volatile string joe, joe_nick;
|
volatile string joe, joe_nick;
|
||||||
volatile mixed joe_unl;
|
volatile mixed joe_unl;
|
||||||
volatile mapping talk = ([]);
|
volatile mapping talk = ([]);
|
||||||
volatile closure sort_by_name;
|
|
||||||
|
|
||||||
queryLastServed() { return joe; }
|
queryLastServed() { return joe; }
|
||||||
|
|
||||||
@ -84,6 +83,7 @@ static help() {
|
|||||||
reply("This gateway is operated by " WEBMASTER_EMAIL);
|
reply("This gateway is operated by " WEBMASTER_EMAIL);
|
||||||
// " on "+ SERVER_UNL);
|
// " on "+ SERVER_UNL);
|
||||||
#endif
|
#endif
|
||||||
|
reply("My PSYC Identification is "+ psyc_name(ME));
|
||||||
// reply("Can you imagine this is the new version of the first ever IRC bot written in LPC?");
|
// reply("Can you imagine this is the new version of the first ever IRC bot written in LPC?");
|
||||||
reply("Available commands: WHO, STATUS, TELL/MSG, TALK/QUERY, HELP");
|
reply("Available commands: WHO, STATUS, TELL/MSG, TALK/QUERY, HELP");
|
||||||
}
|
}
|
||||||
@ -140,21 +140,17 @@ static who() {
|
|||||||
mixed idle;
|
mixed idle;
|
||||||
string desc;
|
string desc;
|
||||||
|
|
||||||
unless (closurep(sort_by_name))
|
|
||||||
sort_by_name = lambda(({ 'a, 'b}),
|
|
||||||
({ (#',),
|
|
||||||
({ CL_NIF, ({ #'mappingp, 'a }), ({ #'return, 0 }) }),
|
|
||||||
({ CL_NIF, ({ #'mappingp, 'b }), ({ #'return, 1 }) }),
|
|
||||||
({ #'return, ({ (#'>),
|
|
||||||
({ CL_LOWER_CASE, ({ (#'||), ({ CL_INDEX, 'a, "name" }), "" }) }),
|
|
||||||
({ CL_LOWER_CASE, ({ (#'||), ({ CL_INDEX, 'b, "name" }), "" }) }),
|
|
||||||
}) })
|
|
||||||
}));
|
|
||||||
|
|
||||||
reply("--- /who of local users of "+ SERVER_UNL);
|
reply("--- /who of local users of "+ SERVER_UNL);
|
||||||
u = objects_people();
|
u = objects_people();
|
||||||
all = sizeof(u) < 23;
|
all = sizeof(u) < 23;
|
||||||
u = sort_array(u->qPublicInfo(all), sort_by_name);
|
// same code in usercmd.i
|
||||||
|
u = sort_array(u->qPublicInfo(all), (:
|
||||||
|
unless (mappingp($1)) return 0;
|
||||||
|
unless (mappingp($2)) return 1;
|
||||||
|
PT(("%O got %O vs %O\n", ME, $1, $2))
|
||||||
|
return lower_case($1["name"] || "") >
|
||||||
|
lower_case($2["name"] || "");
|
||||||
|
:) );
|
||||||
foreach (uv : u) if (mappingp(uv)) {
|
foreach (uv : u) if (mappingp(uv)) {
|
||||||
desc = uv["me"];
|
desc = uv["me"];
|
||||||
if (desc || all) {
|
if (desc || all) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||||
// $Id: master.c,v 1.142 2008/02/24 16:36:59 lynx Exp $
|
// $Id: master.c,v 1.143 2008/04/22 22:43:56 lynx Exp $
|
||||||
//
|
//
|
||||||
// this is a simpler version of group/master, and it is actually in use
|
// this is a simpler version of group/master, and it is actually in use
|
||||||
// [actual as in effectively, not current, which is the german meaning]
|
// [actual as in effectively, not current, which is the german meaning]
|
||||||
@ -19,6 +19,12 @@
|
|||||||
// context delivering presence subscriptions is a "group", but it certainly
|
// context delivering presence subscriptions is a "group", but it certainly
|
||||||
// is a "context."
|
// is a "context."
|
||||||
|
|
||||||
|
// local debug messages - turn them on by using psyclpc -DDcontext=<level>
|
||||||
|
#ifdef Dcontext
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dcontext
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <person.h>
|
#include <person.h>
|
||||||
#include <status.h>
|
#include <status.h>
|
||||||
|
@ -1,11 +1,18 @@
|
|||||||
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||||
// $Id: slave.c,v 1.58 2008/03/21 12:35:40 lynx Exp $
|
// $Id: slave.c,v 1.59 2008/04/22 22:43:56 lynx Exp $
|
||||||
//
|
//
|
||||||
// generic context slave as described in a posting to psyc-dev years ago.
|
// generic context slave as described in a posting to psyc-dev years ago.
|
||||||
// it receives the single copy of a message sent out by the group master
|
// it receives the single copy of a message sent out by the group master
|
||||||
// and fans it out to local recipients. that's why local recipients need
|
// and fans it out to local recipients. that's why local recipients need
|
||||||
// to create and join this manager when they enter a room.
|
// to create and join this manager when they enter a room.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// local debug messages - turn them on by using psyclpc -DDcontext=<level>
|
||||||
|
#ifdef Dcontext
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dcontext
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <presence.h>
|
#include <presence.h>
|
||||||
|
|
||||||
|
@ -1,47 +1,54 @@
|
|||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <ht/http.h>
|
|
||||||
|
|
||||||
protected mapping sessions = ([ ]);
|
protected mapping sessions = ([ ]);
|
||||||
|
|
||||||
string make_session(string nick, int expiry, string jack) {
|
string make_session(string nick, int expiry, string jack) {
|
||||||
string sid;
|
string sid;
|
||||||
#ifndef TELEPHONY_EXPIRY
|
#ifndef TELEPHONY_EXPIRY
|
||||||
# define TELEPHONY_EXPIRY expiry - time()
|
# define TELEPHONY_EXPIRY expiry - time()
|
||||||
#endif
|
#endif
|
||||||
while (sessions[sid = RANDHEXSTRING]);
|
while (sessions[sid = RANDHEXSTRING]);
|
||||||
sessions[sid] = ({ nick, expiry, jack });
|
sessions[sid] = ({ nick, expiry, jack });
|
||||||
call_out( (: return m_delete(sessions, sid); :), TELEPHONY_EXPIRY);
|
call_out( (: return m_delete(sessions, sid); :), TELEPHONY_EXPIRY);
|
||||||
return sid;
|
return sid;
|
||||||
|
}
|
||||||
|
|
||||||
|
mixed answer(string sid, int yesno, int thatsme, string variant) {
|
||||||
|
if (!(sid && sessions[sid])) {
|
||||||
|
return -1; // no session found
|
||||||
|
}
|
||||||
|
if (sessions[sid][1] < time()) {
|
||||||
|
return -2; // session expired
|
||||||
|
}
|
||||||
|
string ni = sessions[sid][0];
|
||||||
|
unless (thatsme) {
|
||||||
|
string mc;
|
||||||
|
object uo = find_person(ni);
|
||||||
|
|
||||||
|
if (!uo) return -3;
|
||||||
|
mc = yesno? "_notice_answer_call": "_notice_reject_call";
|
||||||
|
if (variant) mc += variant;
|
||||||
|
|
||||||
|
if (!sendmsg(uo, mc, 0, ([
|
||||||
|
"_time_expire" : to_string(sessions[sid][1]),
|
||||||
|
"_check_call" : sessions[sid][2],
|
||||||
|
"_token_call" : sid,
|
||||||
|
]))) return -4; // sendmsg failed;
|
||||||
|
}
|
||||||
|
return ni;
|
||||||
}
|
}
|
||||||
|
|
||||||
htget(prot, query, headers, qs) {
|
htget(prot, query, headers, qs) {
|
||||||
#ifdef TELEPHONY_SERVER
|
#ifdef TELEPHONY_SERVER
|
||||||
string sid = query["sid"];
|
string sid = query["sid"];
|
||||||
if (!(sid && sessions[sid])) {
|
|
||||||
// no session found
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (sessions[sid][1] < time()) {
|
|
||||||
// session expired
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
string ni = sessions[sid][0];
|
|
||||||
string t = query["thats"];
|
string t = query["thats"];
|
||||||
|
mixed ni = answer(sid, !query["reject"], t, "_click");
|
||||||
|
|
||||||
unless (t) {
|
if (intp(ni)) {
|
||||||
object uo = find_person(ni);
|
hterror(prot, R_GATEWTIMEOUT, "User cannot be reached.");
|
||||||
if (!uo || !sendmsg(uo, "_notice_answer_talk_click",
|
return 1;
|
||||||
"Your phone call request has been clicked upon.", ([
|
|
||||||
"_time_expire" : to_string(sessions[sid][1]),
|
|
||||||
"_check_call" : sessions[sid][2],
|
|
||||||
"_session" : sid,
|
|
||||||
]))) {
|
|
||||||
hterror(prot, R_GATEWTIMEOUT,
|
|
||||||
"User cannot be reached.");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
htok3(prot, 0, "Expires: 0\n");
|
htok3(prot, 0, "Expires: 0\n");
|
||||||
localize(query["lang"], "html");
|
localize(query["lang"], "html");
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
// $Id: configure.c,v 1.58 2007/06/17 21:07:54 lynx Exp $ // vim:syntax=lpc
|
// $Id: configure.c,v 1.59 2008/04/22 22:43:56 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// web configurator interface. does a lot of cool things for you,
|
// web configurator interface. does a lot of cool things for you,
|
||||||
// and it should always learn to do some more. if you don't need or
|
// and it should always learn to do some more. if you don't need or
|
||||||
// like it, simply don't load it (from init.ls, or by fetching the url).
|
// like it, simply don't load it (from init.ls, or by fetching the url).
|
||||||
//
|
//
|
||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <driver.h>
|
#include <driver.h>
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// this code contributed from symlynX webchat. currently not in use.
|
// this code contributed from symlynX webchat. currently not in use.
|
||||||
|
|
||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <person.h>
|
#include <person.h>
|
||||||
#include <ht/http.h>
|
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
|
|
||||||
#define NO_INHERIT
|
#define NO_INHERIT
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <person.h>
|
#include <person.h>
|
||||||
@ -16,11 +17,13 @@ htget(prot, query, headers, qs) {
|
|||||||
} else if ((t = query["cmd"]) && strlen(t)) {
|
} else if ((t = query["cmd"]) && strlen(t)) {
|
||||||
user->parsecmd(t); // htcmd?
|
user->parsecmd(t); // htcmd?
|
||||||
t = "_echo_execute_web";
|
t = "_echo_execute_web";
|
||||||
} else if (t = user->htDescription(prot, query, headers, qs, "")) {
|
} else if (t = user->htDescription(0, query, headers, qs, "")) {
|
||||||
P4(("result: %O\n", t))
|
P4(("result: %O\n", t))
|
||||||
|
// this is the thing!!
|
||||||
write(t);
|
write(t);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
// show error message
|
||||||
localize(query["lang"], "html");
|
localize(query["lang"], "html");
|
||||||
w("_HTML_head");
|
w("_HTML_head");
|
||||||
w(t || "_failure_unavailable_description");
|
w(t || "_failure_unavailable_description");
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// $Id: fetch.c,v 1.39 2008/04/09 08:29:37 lynx Exp $ // vim:syntax=lpc
|
// $Id: fetch.c,v 1.42 2008/12/10 22:53:33 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// generic HTTP GET client, mostly used for RSS -
|
// generic HTTP GET client, mostly used for RSS -
|
||||||
// but we could fetch any page or data with it, really
|
// but we could fetch any page or data with it, really
|
||||||
// tobij even made the object have the URL as its object name. fancy! ;)
|
// tobij even made the object have the URL as its object name. fancy! ;)
|
||||||
//
|
//
|
||||||
#include <net.h>
|
|
||||||
#include <ht/http.h>
|
#include <ht/http.h>
|
||||||
|
#include <net.h>
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
#include <services.h>
|
#include <services.h>
|
||||||
|
|
||||||
@ -104,6 +104,13 @@ varargs int real_logon(int arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
varargs int logon(int arg, int sub) {
|
varargs int logon(int arg, int sub) {
|
||||||
|
// net/connect disables telnet for all robots and circuits
|
||||||
|
#if 0 //__EFUN_DEFINED__(enable_telnet)
|
||||||
|
// when fetching the spiegel rss feed, telnet_neg() occasionally
|
||||||
|
// crashes. fixing that would be cool, but why have the telnet
|
||||||
|
// machine enabled at all?
|
||||||
|
enable_telnet(0);
|
||||||
|
#endif
|
||||||
// when called from xmlrpc.c we can't do TLS anyway
|
// when called from xmlrpc.c we can't do TLS anyway
|
||||||
if (sub) return ::logon(arg);
|
if (sub) return ::logon(arg);
|
||||||
if (ssl) tls_init_connection(ME, #'real_logon);
|
if (ssl) tls_init_connection(ME, #'real_logon);
|
||||||
@ -118,7 +125,11 @@ int parse_status(string all) {
|
|||||||
sscanf(all, "%s%t%s", prot, state);
|
sscanf(all, "%s%t%s", prot, state);
|
||||||
sscanf(state, "%d%t%s", http_status, http_message);
|
sscanf(state, "%d%t%s", http_status, http_message);
|
||||||
P3(("%O got %O %O from %O\n", ME, http_status, http_message, host));
|
P3(("%O got %O %O from %O\n", ME, http_status, http_message, host));
|
||||||
// P2(("http_status %O == %O?\n", http_status, R_OK))
|
if (http_status != R_OK) {
|
||||||
|
monitor_report("_failure_unsupported_code_HTTP",
|
||||||
|
S("http/fetch'ing %O returned %O %O", url || ME,
|
||||||
|
http_status, http_message));
|
||||||
|
}
|
||||||
next_input_to(#'parse_header);
|
next_input_to(#'parse_header);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -168,9 +179,7 @@ disconnected(remainder) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
monitor_report("_error_unknown_method_HTTP",
|
// doesn't seem to get here when HTTP returns 301 or 302. strange.
|
||||||
S("http/fetch'ing %O returned %O %O", url || ME,
|
|
||||||
http_status, http_message));
|
|
||||||
// fall thru
|
// fall thru
|
||||||
case R_NOTMODIFIED:
|
case R_NOTMODIFIED:
|
||||||
qDel(ME);
|
qDel(ME);
|
||||||
|
@ -1,24 +1,35 @@
|
|||||||
// vim:noexpandtab:syntax=lpc
|
// vim:noexpandtab:syntax=lpc
|
||||||
// $Id: header.i,v 1.5 2007/10/08 11:00:31 lynx Exp $
|
// $Id: header.i,v 1.10 2008/08/05 12:21:33 lynx Exp $
|
||||||
|
|
||||||
#include <ht/http.h>
|
#include <ht/http.h>
|
||||||
|
|
||||||
volatile int headerDone = 0;
|
volatile int headerDone = 0;
|
||||||
|
|
||||||
http_ok(string prot, string type, string extra) {
|
http_ok(string prot, string type, string extra) {
|
||||||
string h;
|
string out;
|
||||||
|
|
||||||
// yes, this is compatible to pre-HTTP/1.0 browsers. sick, i know.
|
// yes, this is compatible to pre-HTTP/1.0 browsers. sick, i know.
|
||||||
if (!prot || headerDone++) return;
|
if (!prot || headerDone++) return;
|
||||||
|
|
||||||
h = type || extra ? htheaders(type, extra) +"\n"
|
out = type || extra ? htheaders(type, extra) +"\n"
|
||||||
: "Content-type: " DEFAULT_CONTENT_TYPE "\n\n";
|
: "Content-type: " DEFAULT_CONTENT_TYPE "\n\n";
|
||||||
emit(HTTP_SVERS " 200 Sure\n"+ h);
|
emit(out = HTTP_SVERS " 200 Sure\n"+ out);
|
||||||
|
P3((out))
|
||||||
}
|
}
|
||||||
|
|
||||||
varargs http_error(string prot, int code, string comment, string html) {
|
varargs http_error(string prot, int code, string comment, string html) {
|
||||||
string out;
|
string out;
|
||||||
|
|
||||||
|
// apparently there isn't a single app that calls this with "html"
|
||||||
|
P2(("hterror(%O,%O,%O,%O) in %O\n", prot,code,comment,html, ME))
|
||||||
|
#if defined(GAMMA) && defined(T)
|
||||||
|
// use the textdb if available
|
||||||
|
out = psyctext( T("_PAGES_error",
|
||||||
|
"<html><title id='code'>[_code]</title>\n"
|
||||||
|
"<body><h1 id='comment'>[_comment]</h1></body></html>\n"),
|
||||||
|
([ "_comment": comment, "_code": code ]) );
|
||||||
|
#else
|
||||||
|
// use some hardcoded defaults
|
||||||
out = "<body text=white bgcolor=black link=green vlink=green>\n";
|
out = "<body text=white bgcolor=black link=green vlink=green>\n";
|
||||||
if (html) out = sprintf("<title>%s</title>\n%s%s", comment, out, html);
|
if (html) out = sprintf("<title>%s</title>\n%s%s", comment, out, html);
|
||||||
else out = sprintf("\
|
else out = sprintf("\
|
||||||
@ -32,11 +43,12 @@ varargs http_error(string prot, int code, string comment, string html) {
|
|||||||
);
|
);
|
||||||
// <a href=\"mailto:%s?subject=%s\">%s</a>\n
|
// <a href=\"mailto:%s?subject=%s\">%s</a>\n
|
||||||
//, WEBMASTER_EMAIL, comment, WEBMASTER_EMAIL
|
//, WEBMASTER_EMAIL, comment, WEBMASTER_EMAIL
|
||||||
|
#endif
|
||||||
// yes, this is compatible to pre-HTTP/1.0 browsers. sick, i know.
|
// yes, this is compatible to pre-HTTP/1.0 browsers. sick, i know.
|
||||||
if (!headerDone++ && prot) {
|
if (!headerDone++ && prot) {
|
||||||
// I used to output the comment, but Id have to cut out the
|
// I used to output the comment, but Id have to cut out the
|
||||||
// newline from the db
|
// newline from the db
|
||||||
emit(sprintf(HTTP_SVERS " 200 Actually %03d but MSIE steals my error page\n%s\n%s", code, htheaders(), out));
|
emit(out = sprintf(HTTP_SVERS " 200 Actually %03d but MSIE steals my error page\n%s\n%s", code, htheaders(), out));
|
||||||
|
P3((out))
|
||||||
} else emit(out);
|
} else emit(out);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// vim:noexpandtab:syntax=lpc
|
// vim:noexpandtab:syntax=lpc
|
||||||
// $Id: library.i,v 1.38 2008/04/08 23:12:16 lynx Exp $
|
// $Id: library.i,v 1.40 2008/04/27 08:20:47 lynx Exp $
|
||||||
//
|
//
|
||||||
// HTTP function library -lynx
|
// HTTP function library -lynx
|
||||||
//
|
//
|
||||||
@ -85,20 +85,21 @@ void htrequireauth(string prot, string type, string realm) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
varargs string htredirect(string prot, string target, string comment, int permanent) {
|
varargs string htredirect(string prot, string target, string comment, int permanent, string extra) {
|
||||||
if (!comment) comment = "Check this out";
|
if (!comment) comment = "Check this out";
|
||||||
if (!target) target = "/";
|
if (!target) target = "/";
|
||||||
|
if (!extra) extra = "";
|
||||||
|
|
||||||
if (prot) {
|
if (prot) {
|
||||||
printf("%s %d %s\n%s", HTTP_SVERS,
|
printf("%s %d %s\n%s", HTTP_SVERS,
|
||||||
permanent ? R_MOVED : R_FOUND, comment, htheaders());
|
permanent ? R_MOVED : R_FOUND, comment, htheaders());
|
||||||
}
|
}
|
||||||
printf("\
|
printf("\
|
||||||
Location: %s\n\
|
Location: %s\n%s\
|
||||||
\n\
|
\n\
|
||||||
<a href=\"%s\">%s</a>.\n\
|
<a href=\"%s\">%s</a>.\n\
|
||||||
",
|
",
|
||||||
target, target, comment);
|
target, extra, target, comment);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <person.h>
|
#include <person.h>
|
||||||
@ -15,7 +16,13 @@ htget(prot, query, headers, qs) {
|
|||||||
} else {
|
} else {
|
||||||
PT(("replacing cookie %O\n", headers["cookie"]))
|
PT(("replacing cookie %O\n", headers["cookie"]))
|
||||||
htok3(prot, 0, "Set-Cookie: psyced=\""+ qs +"\";\n");
|
htok3(prot, 0, "Set-Cookie: psyced=\""+ qs +"\";\n");
|
||||||
|
#ifdef GAMMA
|
||||||
|
// login was supposed to something more than just /surf
|
||||||
|
// but until this is the case, why lose time?
|
||||||
|
return NET_PATH "http/examine"->htget(0, query, headers, qs);
|
||||||
|
#else
|
||||||
t = "_PAGES_login";
|
t = "_PAGES_login";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
htok3(prot, 0, "Expires: 0\n");
|
htok3(prot, 0, "Expires: 0\n");
|
||||||
localize(query["lang"], "html");
|
localize(query["lang"], "html");
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
// this code contributed from symlynX webchat. currently not in use.
|
// this code contributed from symlynX webchat. currently not in use.
|
||||||
|
|
||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <ht/html.h>
|
|
||||||
#include <ht/http.h>
|
|
||||||
#include <person.h>
|
#include <person.h>
|
||||||
|
|
||||||
volatile string nick;
|
volatile string nick;
|
||||||
@ -18,22 +17,20 @@ htget(prot, query, headers, qs) {
|
|||||||
localize(query["lang"], "ht");
|
localize(query["lang"], "ht");
|
||||||
|
|
||||||
htok(prot);
|
htok(prot);
|
||||||
write (hthead("modifying "+nick+"'s settings") + htfs_on "<th>");
|
write (hthead("modifying "+nick+"'s settings"));
|
||||||
unless (nick) {
|
unless (nick) {
|
||||||
write( T("_PAGES_register_nickless", "Who are you?")
|
write( T("_PAGES_register_nickless", "Who are you?") );
|
||||||
+ htfs_off);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
unless (user = find_person(nick)) {
|
unless (user = find_person(nick)) {
|
||||||
write( T("_PAGES_register_offline",
|
write( T("_PAGES_register_offline",
|
||||||
"You're not in the chat?<br>Please enter it.")
|
"You're not in the chat?<br>Please enter it.")
|
||||||
+ T("_HTML_back", "") + htfs_off );
|
+ T("_HTML_back", "") );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
unless (user -> validToken(query["token"])) {
|
unless (user -> validToken(query["token"])) {
|
||||||
write( T("_error_invalid_authentication_token",
|
write( T("_error_invalid_authentication_token",
|
||||||
"Invalid token. Please log in anew.")
|
"Invalid token. Please log in anew."));
|
||||||
+ htfs_off);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
okay = 1;
|
okay = 1;
|
||||||
@ -103,9 +100,9 @@ htget(prot, query, headers, qs) {
|
|||||||
#endif
|
#endif
|
||||||
write( T("_PAGES_edit_stored",
|
write( T("_PAGES_edit_stored",
|
||||||
"Settings successfully stored.")
|
"Settings successfully stored.")
|
||||||
+ T("_HTML_back", "") + htfs_off );
|
+ T("_HTML_back", "") );
|
||||||
} else
|
} else
|
||||||
write( T("_HTML_back", "") + htfs_off );
|
write( T("_HTML_back", "") );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,212 +1,213 @@
|
|||||||
// $Id: profile.c,v 1.2 2007/04/11 13:48:57 lynx Exp $ vim:syntax=lpc
|
// $Id: profile.c,v 1.3 2008/04/22 22:43:14 lynx Exp $ vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// <kuchn> profile.c, a web based user settings/profile changer,
|
// <kuchn> profile.c, a web based user settings/profile changer,
|
||||||
// called from net/http/server.
|
// called from net/http/server.
|
||||||
//
|
//
|
||||||
// TODO: please make use of the new convert_profile(vars, 0, "set") and
|
// TODO: please make use of the new convert_profile(vars, 0, "set") and
|
||||||
// convert_profile(settings, "set", 0) to convert a mapping of settings
|
// convert_profile(settings, "set", 0) to convert a mapping of settings
|
||||||
// into a mapping of PSYC variables and back. this should make a lot of
|
// into a mapping of PSYC variables and back. this should make a lot of
|
||||||
// code in here unnecessary. avoiding replication is g00000d.
|
// code in here unnecessary. avoiding replication is g00000d.
|
||||||
//
|
//
|
||||||
// i'm unhappy with the way of authing.. first i thought this could be
|
// i'm unhappy with the way of authing.. first i thought this could be
|
||||||
// inherited somehow to be a part of the user object, but thats schmarn.
|
// inherited somehow to be a part of the user object, but thats schmarn.
|
||||||
// but i think psyc auth would be a nice way here..
|
// but i think psyc auth would be a nice way here..
|
||||||
// using checkPassword() the way you do is fine! we are not planning
|
// using checkPassword() the way you do is fine! we are not planning
|
||||||
// to use a web-based editor for remote PSYC items.. and the
|
// to use a web-based editor for remote PSYC items.. and the
|
||||||
// asynchronicity of it isn't something HTTP can easily handle.
|
// asynchronicity of it isn't something HTTP can easily handle.
|
||||||
// HTTP isn't as cool as PSYC you know? hahahahahahahahahahah
|
// HTTP isn't as cool as PSYC you know? hahahahahahahahahahah
|
||||||
|
|
||||||
// as long as this is in development it could cause security breaches
|
// as long as this is in development it could cause security breaches
|
||||||
// in production servers. so please only use this on experimental servers.
|
// in production servers. so please only use this on experimental servers.
|
||||||
#ifdef EXPERIMENTAL
|
#ifdef EXPERIMENTAL
|
||||||
|
|
||||||
#include <net.h>
|
#include <ht/http.h>
|
||||||
#include <text.h>
|
#include <net.h>
|
||||||
#include <person.h>
|
#include <text.h>
|
||||||
|
#include <person.h>
|
||||||
object user;
|
|
||||||
|
object user;
|
||||||
create() {
|
|
||||||
sTextPath(0, 0, "html");
|
create() {
|
||||||
}
|
sTextPath(0, 0, "html");
|
||||||
|
}
|
||||||
htget(prot, query, headers, qs) {
|
|
||||||
htok3(prot, "text/html", "Cache-Control: no-cache\n");
|
htget(prot, query, headers, qs) {
|
||||||
w("_PAGES_user_header");
|
htok3(prot, "text/html", "Cache-Control: no-cache\n");
|
||||||
|
w("_PAGES_user_header");
|
||||||
auth(prot, query, headers, qs);
|
|
||||||
}
|
auth(prot, query, headers, qs);
|
||||||
|
}
|
||||||
checkAuth(val, prot, query, headers, qs, user) {
|
|
||||||
if(! val)
|
checkAuth(val, prot, query, headers, qs, user) {
|
||||||
{
|
if(! val)
|
||||||
w("_PAGES_user_login_failed");
|
{
|
||||||
return;
|
w("_PAGES_user_login_failed");
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
w("_PAGES_user_header");
|
|
||||||
|
w("_PAGES_user_header");
|
||||||
switch(query["action"]) {
|
|
||||||
case "settings":
|
switch(query["action"]) {
|
||||||
if(query["set"] == "1")
|
case "settings":
|
||||||
settings(prot, query, headers, qs, user);
|
if(query["set"] == "1")
|
||||||
else
|
settings(prot, query, headers, qs, user);
|
||||||
w("_PAGES_user_settings_body", ([
|
else
|
||||||
"_username" : query["username"],
|
w("_PAGES_user_settings_body", ([
|
||||||
"_password" : query["password"],
|
"_username" : query["username"],
|
||||||
|
"_password" : query["password"],
|
||||||
"_speakaction" : user->v("speakaction") ? user->v("speakaction") : "",
|
|
||||||
"_commandcharacter" : user->v("commandcharacter") ? user->v("commandcharacter") : ""
|
"_speakaction" : user->v("speakaction") ? user->v("speakaction") : "",
|
||||||
]) );
|
"_commandcharacter" : user->v("commandcharacter") ? user->v("commandcharacter") : ""
|
||||||
break;
|
]) );
|
||||||
case "profile":
|
break;
|
||||||
if(query["set"] == "1")
|
case "profile":
|
||||||
profile(prot, query, headers, qs, user);
|
if(query["set"] == "1")
|
||||||
else
|
profile(prot, query, headers, qs, user);
|
||||||
w("_PAGES_user_profile_body", ([
|
else
|
||||||
"_username" : query["username"],
|
w("_PAGES_user_profile_body", ([
|
||||||
"_password" : query["password"],
|
"_username" : query["username"],
|
||||||
|
"_password" : query["password"],
|
||||||
"_me" : user->v("me") ? user->v("me") : "",
|
|
||||||
"_publicpage" : user->v("publicpage") ? user->v("publicpage") : "",
|
"_me" : user->v("me") ? user->v("me") : "",
|
||||||
"_publictext" : user->v("publictext") ? user->v("publictext") : "",
|
"_publicpage" : user->v("publicpage") ? user->v("publicpage") : "",
|
||||||
"_publicname" : user->v("publicname") ? user->v("publicname") : "",
|
"_publictext" : user->v("publictext") ? user->v("publictext") : "",
|
||||||
"_animalfave" : user->v("animalfave") ? user->v("animalfave") : "",
|
"_publicname" : user->v("publicname") ? user->v("publicname") : "",
|
||||||
"_popstarfave" : user->v("popstarfave") ? user->v("popstarfave") : "",
|
"_animalfave" : user->v("animalfave") ? user->v("animalfave") : "",
|
||||||
"_musicfave" : user->v("musicfave") ? user->v("musicfave") : "",
|
"_popstarfave" : user->v("popstarfave") ? user->v("popstarfave") : "",
|
||||||
"_privatetext" : user->v("privatetext") ? user->v("privatetext") : "",
|
"_musicfave" : user->v("musicfave") ? user->v("musicfave") : "",
|
||||||
"_likestext" : user->v("likestext") ? user->v("likestext") : "",
|
"_privatetext" : user->v("privatetext") ? user->v("privatetext") : "",
|
||||||
"_dislikestext" : user->v("dislikestext") ? user->v("dislikestext") : "",
|
"_likestext" : user->v("likestext") ? user->v("likestext") : "",
|
||||||
"_privatepage" : user->v("privatepage") ? user->v("privatepage") : "",
|
"_dislikestext" : user->v("dislikestext") ? user->v("dislikestext") : "",
|
||||||
"_email" : user->v("email") ? user->v("email") : "",
|
"_privatepage" : user->v("privatepage") ? user->v("privatepage") : "",
|
||||||
"_color" : user->v("color") ? user->v("color") : "",
|
"_email" : user->v("email") ? user->v("email") : "",
|
||||||
"_language" : user->v("language") ? user->v("language") : "",
|
"_color" : user->v("color") ? user->v("color") : "",
|
||||||
"_telephone" : user->v("telephone") ? user->v("telephone") : ""
|
"_language" : user->v("language") ? user->v("language") : "",
|
||||||
]) );
|
"_telephone" : user->v("telephone") ? user->v("telephone") : ""
|
||||||
break;
|
]) );
|
||||||
default:
|
break;
|
||||||
w("_PAGES_user_index", ([ "_username" : query["username"], "_password" : query["password"] ]));
|
default:
|
||||||
break;
|
w("_PAGES_user_index", ([ "_username" : query["username"], "_password" : query["password"] ]));
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
w("_PAGES_user_footer");
|
|
||||||
}
|
w("_PAGES_user_footer");
|
||||||
|
}
|
||||||
auth(prot, query, headers, qs) {
|
|
||||||
if(! stringp(query["username"]) || ! stringp(query["password"]))
|
auth(prot, query, headers, qs) {
|
||||||
{
|
if(! stringp(query["username"]) || ! stringp(query["password"]))
|
||||||
w("_PAGES_user_login_body");
|
{
|
||||||
return 0;
|
w("_PAGES_user_login_body");
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
if(query["username"] == "" || query["password"] == "")
|
|
||||||
{
|
if(query["username"] == "" || query["password"] == "")
|
||||||
w("_PAGES_user_login_empty");
|
{
|
||||||
return 0;
|
w("_PAGES_user_login_empty");
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
user = summon_person(query["username"]);
|
|
||||||
if(!user || user->isNewbie())
|
user = summon_person(query["username"]);
|
||||||
{
|
if(!user || user->isNewbie())
|
||||||
w("_PAGES_user_login_notregistered");
|
{
|
||||||
return 0;
|
w("_PAGES_user_login_notregistered");
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
int ok = 1;
|
|
||||||
user->checkPassword(query["password"], "plain", "", "", #'checkAuth, prot, query, headers, qs, user);
|
int ok = 1;
|
||||||
}
|
user->checkPassword(query["password"], "plain", "", "", #'checkAuth, prot, query, headers, qs, user);
|
||||||
|
}
|
||||||
settings(prot, query, headers, qs, user) {
|
|
||||||
foreach(string k, string v : query) {
|
settings(prot, query, headers, qs, user) {
|
||||||
int ok = 0;
|
foreach(string k, string v : query) {
|
||||||
|
int ok = 0;
|
||||||
switch(k) {
|
|
||||||
case "password":
|
switch(k) {
|
||||||
ok = 1;
|
case "password":
|
||||||
break;
|
ok = 1;
|
||||||
case "speakaction":
|
break;
|
||||||
ok = 1;
|
case "speakaction":
|
||||||
break;
|
ok = 1;
|
||||||
case "commandcharacter":
|
break;
|
||||||
ok = 1;
|
case "commandcharacter":
|
||||||
break;
|
ok = 1;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
if(! ok)
|
|
||||||
continue;
|
if(! ok)
|
||||||
|
continue;
|
||||||
if(v == "")
|
|
||||||
{
|
if(v == "")
|
||||||
//if(v != "password")
|
{
|
||||||
// user->vDel(k);
|
//if(v != "password")
|
||||||
// do nothing? maybe every setting is needed.. then this would be bad.
|
// user->vDel(k);
|
||||||
}
|
// do nothing? maybe every setting is needed.. then this would be bad.
|
||||||
else
|
}
|
||||||
user->vSet(k, v); // password won't be set? humm.
|
else
|
||||||
}
|
user->vSet(k, v); // password won't be set? humm.
|
||||||
|
}
|
||||||
w("_PAGES_user_settings_changed", ([ "_username" : query["username"], "_password" : query["password"] ]) );
|
|
||||||
}
|
w("_PAGES_user_settings_changed", ([ "_username" : query["username"], "_password" : query["password"] ]) );
|
||||||
|
}
|
||||||
profile(prot, query, headers, qs, user) {
|
|
||||||
foreach(string k, string v : query) {
|
profile(prot, query, headers, qs, user) {
|
||||||
int ok = 0;
|
foreach(string k, string v : query) {
|
||||||
|
int ok = 0;
|
||||||
switch(k)
|
|
||||||
{
|
switch(k)
|
||||||
case "me":
|
{
|
||||||
ok = 1;
|
case "me":
|
||||||
break;
|
ok = 1;
|
||||||
case "publicpage":
|
break;
|
||||||
ok = 1;
|
case "publicpage":
|
||||||
break;
|
ok = 1;
|
||||||
case "publictext":
|
break;
|
||||||
ok = 1;
|
case "publictext":
|
||||||
break;
|
ok = 1;
|
||||||
case "publicname":
|
break;
|
||||||
ok = 1;
|
case "publicname":
|
||||||
break;
|
ok = 1;
|
||||||
case "animalfave":
|
break;
|
||||||
ok = 1;
|
case "animalfave":
|
||||||
break;
|
ok = 1;
|
||||||
case "popstarfave":
|
break;
|
||||||
ok = 1;
|
case "popstarfave":
|
||||||
break;
|
ok = 1;
|
||||||
case "musicfave":
|
break;
|
||||||
ok = 1;
|
case "musicfave":
|
||||||
break;
|
ok = 1;
|
||||||
case "privatetext":
|
break;
|
||||||
ok = 1;
|
case "privatetext":
|
||||||
break;
|
ok = 1;
|
||||||
case "likestext":
|
break;
|
||||||
ok = 1;
|
case "likestext":
|
||||||
break;
|
ok = 1;
|
||||||
case "dislikestext":
|
break;
|
||||||
ok = 1;
|
case "dislikestext":
|
||||||
break;
|
ok = 1;
|
||||||
case "privatepage":
|
break;
|
||||||
ok = 1;
|
case "privatepage":
|
||||||
break;
|
ok = 1;
|
||||||
case "email":
|
break;
|
||||||
ok = 1;
|
case "email":
|
||||||
break;
|
ok = 1;
|
||||||
case "telephone":
|
break;
|
||||||
ok = 1;
|
case "telephone":
|
||||||
break;
|
ok = 1;
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
if(! ok)
|
|
||||||
continue;
|
if(! ok)
|
||||||
|
continue;
|
||||||
if(v == "")
|
|
||||||
user->vDel(k);
|
if(v == "")
|
||||||
else
|
user->vDel(k);
|
||||||
user->vSet(k, v);
|
else
|
||||||
}
|
user->vSet(k, v);
|
||||||
|
}
|
||||||
w("_PAGES_user_profile_changed", ([ "_username" : query["username"], "_password" : query["password"] ]) );
|
|
||||||
}
|
w("_PAGES_user_profile_changed", ([ "_username" : query["username"], "_password" : query["password"] ]) );
|
||||||
|
}
|
||||||
w(mc, vars) { write(psyctext(T(mc, ""), vars)); }
|
|
||||||
|
w(mc, vars) { write(psyctext(T(mc, ""), vars)); }
|
||||||
#endif
|
|
||||||
|
#endif
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// this code contributed from symlynX webchat. currently not in use.
|
// this code contributed from symlynX webchat. currently not in use.
|
||||||
|
|
||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <person.h>
|
#include <person.h>
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// $Id: server.c,v 1.58 2008/03/11 13:42:25 lynx Exp $ // vim:syntax=lpc
|
// $Id: server.c,v 1.64 2008/05/13 09:51:07 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// yes, psyced is also a web server, like every decent piece of code. ;)
|
// yes, psyced is also a web server, like every decent piece of code. ;)
|
||||||
//
|
//
|
||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <server.h>
|
#include <server.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
@ -20,7 +21,7 @@ parse_url(input);
|
|||||||
parse_header(input);
|
parse_header(input);
|
||||||
devNull();
|
devNull();
|
||||||
|
|
||||||
qScheme() { return "none"; }
|
qScheme() { return "html"; }
|
||||||
|
|
||||||
logon() {
|
logon() {
|
||||||
D2(D("»»» New SmallHTTP user\n");)
|
D2(D("»»» New SmallHTTP user\n");)
|
||||||
@ -122,6 +123,7 @@ process() {
|
|||||||
int done = 1;
|
int done = 1;
|
||||||
|
|
||||||
// take defaults from cookie, then override by query string
|
// take defaults from cookie, then override by query string
|
||||||
|
// lynXism cookie behaviour, normal one is below
|
||||||
t = headers["cookie"];
|
t = headers["cookie"];
|
||||||
P4(("found cookie: %O\n", t))
|
P4(("found cookie: %O\n", t))
|
||||||
if (t && sscanf(t, "psyced=\"%s\"", t)) {
|
if (t && sscanf(t, "psyced=\"%s\"", t)) {
|
||||||
@ -129,6 +131,24 @@ process() {
|
|||||||
query = parse_query(query, t);
|
query = parse_query(query, t);
|
||||||
P4(("parsed cookie: %O\n", query))
|
P4(("parsed cookie: %O\n", query))
|
||||||
}
|
}
|
||||||
|
#ifdef GENERIC_COOKIES // we might need them someday..?
|
||||||
|
// if within the same domain other cookies are being used, like
|
||||||
|
// by including google-analytics, then we might be receiving them
|
||||||
|
// here and have no friggin' idea what they are good for.
|
||||||
|
// thus: we *need* a way to ensure a cookie is our own.
|
||||||
|
// FIXME: this is not really compliant
|
||||||
|
else if (t) {
|
||||||
|
mapping cook = ([ ]);
|
||||||
|
string k, v;
|
||||||
|
while(t && sscanf(t, "%s=%s;%t%s", k, v, t) >= 2) {
|
||||||
|
cook[k] = v;
|
||||||
|
}
|
||||||
|
if (sscanf(t, "%s=%s", k, v))
|
||||||
|
cook[lower_case(k)] = v; // case insensitive
|
||||||
|
cook[0] = headers["cookie"]; // save cookie-string
|
||||||
|
headers["cookie"] = cook;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (sscanf(url, "%s?%s", file, qs)) {
|
if (sscanf(url, "%s?%s", file, qs)) {
|
||||||
P3(("got query: %O\n", qs))
|
P3(("got query: %O\n", qs))
|
||||||
query = parse_query(query, qs);
|
query = parse_query(query, qs);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// i'm unhappy with the way of authing.. first i thought this could be inheriated somehow to be a part of the user object, but thats schmarn.
|
// i'm unhappy with the way of authing.. first i thought this could be inheriated somehow to be a part of the user object, but thats schmarn.
|
||||||
// but i think psyc auth would be a nice way here..
|
// but i think psyc auth would be a nice way here..
|
||||||
//
|
//
|
||||||
|
#include <ht/http.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <person.h>
|
#include <person.h>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: xmlrpc.c,v 1.23 2008/03/11 13:42:26 lynx Exp $ // vim:syntax=lpc
|
// $Id: xmlrpc.c,v 1.24 2008/04/22 22:43:14 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// TODO: shares to much code with url fetcher
|
// TODO: shares to much code with url fetcher
|
||||||
// in the ideal world this would only contain marshal/unmarshal code
|
// in the ideal world this would only contain marshal/unmarshal code
|
||||||
@ -6,8 +6,8 @@
|
|||||||
// possibly we can come up with an marshal/unmarshal api and use
|
// possibly we can come up with an marshal/unmarshal api and use
|
||||||
// the same framework for xml-rpc, soap and other things
|
// the same framework for xml-rpc, soap and other things
|
||||||
//
|
//
|
||||||
#include <net.h>
|
|
||||||
#include <ht/http.h>
|
#include <ht/http.h>
|
||||||
|
#include <net.h>
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
#include <xml.h>
|
#include <xml.h>
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ void request(string method, mixed params, closure cb) { // TODO: errback API
|
|||||||
|
|
||||||
int logon(int arg) {
|
int logon(int arg) {
|
||||||
buffer = "";
|
buffer = "";
|
||||||
httpheaders = ([ ]);
|
headers = ([ ]);
|
||||||
http_status = 500;
|
http_status = 500;
|
||||||
|
|
||||||
// this is all not https: compatible..
|
// this is all not https: compatible..
|
||||||
@ -189,18 +189,18 @@ mixed unMarshal(XMLNode parsed) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void disconnected(remainder) {
|
int disconnected(string remainder) {
|
||||||
mixed *args;
|
mixed *args;
|
||||||
|
|
||||||
httpheaders["_fetchtime"] = isotime(ctime(time()), 1);
|
headers["_fetchtime"] = isotime(ctime(time()), 1);
|
||||||
if (httpheaders["last-modified"])
|
if (headers["last-modified"])
|
||||||
modificationtime = httpheaders["last-modified"];
|
modificationtime = headers["last-modified"];
|
||||||
if (httpheaders["etag"])
|
if (headers["etag"])
|
||||||
etag = httpheaders["etag"]; // heise does not work with etag
|
etag = headers["etag"]; // heise does not work with etag
|
||||||
|
|
||||||
fetched = buffer;
|
fetched = buffer;
|
||||||
fheaders = httpheaders;
|
fheaders = headers;
|
||||||
buffer = httpheaders = 0;
|
buffer = headers = 0;
|
||||||
fetching = 0;
|
fetching = 0;
|
||||||
if (pointerp(args)) // no fault
|
if (pointerp(args)) // no fault
|
||||||
funcall(callback, args...);
|
funcall(callback, args...);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: auto.h,v 1.14 2007/09/07 09:07:32 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: auto.h,v 1.15 2008/04/18 13:34:39 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
#define _INCLUDE_AUTO_H
|
#define _INCLUDE_AUTO_H
|
||||||
|
|
||||||
// first identify the driver
|
// first identify the driver
|
||||||
@ -47,8 +47,3 @@
|
|||||||
// more useful perlisms
|
// more useful perlisms
|
||||||
#define chop(STRING) slice_from_end(STRING, 0, 2)
|
#define chop(STRING) slice_from_end(STRING, 0, 2)
|
||||||
#define chomp(STRING) (char_from_end(STRING, 1) == '\n' ? chop(STRING) : STRING)
|
#define chomp(STRING) (char_from_end(STRING, 1) == '\n' ? chop(STRING) : STRING)
|
||||||
|
|
||||||
// extracts hh:mm:ss format from ctime output
|
|
||||||
#define hhmmss(CTIME) CTIME[11..18]
|
|
||||||
// extracts hh:mm format from ctime output (for idle times)
|
|
||||||
#define hhmm(CTIME) CTIME[11..15]
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: http.h,v 1.6 2008/04/09 08:29:37 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: http.h,v 1.7 2008/04/22 22:43:56 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
/*
|
/*
|
||||||
* NAME: http.h
|
* NAME: http.h
|
||||||
* DESCRIPTION: macros for HTTP
|
* DESCRIPTION: macros for HTTP
|
||||||
@ -38,4 +38,10 @@
|
|||||||
# define hthead(TITLE) "<title>" CHATNAME " - "+( TITLE )+"</title>"
|
# define hthead(TITLE) "<title>" CHATNAME " - "+( TITLE )+"</title>"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// local debug messages - turn them on by using psyclpc -DDhttp=<level>
|
||||||
|
#ifdef Dhttp
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dhttp
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: net.h,v 1.142 2008/04/11 18:48:26 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: net.h,v 1.148 2008/07/26 10:54:30 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
#ifndef _INCLUDE_NET_H
|
#ifndef _INCLUDE_NET_H
|
||||||
#define _INCLUDE_NET_H
|
#define _INCLUDE_NET_H
|
||||||
|
|
||||||
@ -36,6 +36,41 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// switching to UTF-8 should work now (if you keep .fmt files disabled!)
|
||||||
|
#ifndef SYSTEM_CHARSET
|
||||||
|
# define SYSTEM_CHARSET "UTF-8"
|
||||||
|
//define SYSTEM_CHARSET "ISO-8859-15"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(SYSTEM_CHARSET) && SYSTEM_CHARSET != "UTF-8"
|
||||||
|
# define TO_UTF8(s) convert_charset((s), SYSTEM_CHARSET, "UTF-8")
|
||||||
|
# define FROM_UTF8(s) convert_charset((s), "UTF-8", SYSTEM_CHARSET)
|
||||||
|
#else
|
||||||
|
# define TO_UTF8(s) (s)
|
||||||
|
# define FROM_UTF8(s) (s)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// this stuff is so popular.. can i really put it anywhere else?
|
||||||
|
#ifndef DEFAULT_CONTENT_TYPE
|
||||||
|
# define DEFAULT_CONTENT_TYPE "text/html; charset=" SYSTEM_CHARSET
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __EFUN_DEFINED__(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.
|
||||||
|
// so FROM_UTF8 and TO_UTF8 are normally nullmacros (see above)
|
||||||
|
# include <idn.h>
|
||||||
|
// beware, these macros dont have error handling...
|
||||||
|
# define NODEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_XMPP_NODEPREP))
|
||||||
|
# define NAMEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_NAMEPREP))
|
||||||
|
# define RESOURCEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_XMPP_RESOURCEPREP))
|
||||||
|
#else
|
||||||
|
# define NODEPREP(s) lower_case(s)
|
||||||
|
# define NAMEPREP(s) lower_case(s)
|
||||||
|
# define RESOURCEPREP(s) (s)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#ifdef PRO_PATH
|
#ifdef PRO_PATH
|
||||||
@ -88,44 +123,10 @@
|
|||||||
# else
|
# else
|
||||||
# define HTTPS_URL 0 // so that you can do
|
# define HTTPS_URL 0 // so that you can do
|
||||||
// ((tls_available() && HTTPS_URL) || HTTP_URL)
|
// ((tls_available() && HTTPS_URL) || HTTP_URL)
|
||||||
|
// ... what about ifdef __TLS__ ?
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// switching to UTF-8 should work now (if you keep .fmt files disabled!)
|
|
||||||
#ifndef SYSTEM_CHARSET
|
|
||||||
# define SYSTEM_CHARSET "UTF-8"
|
|
||||||
//define SYSTEM_CHARSET "ISO-8859-15"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SYSTEM_CHARSET) && SYSTEM_CHARSET != "UTF-8"
|
|
||||||
# define TO_UTF8(s) convert_charset((s), SYSTEM_CHARSET, "UTF-8")
|
|
||||||
# define FROM_UTF8(s) convert_charset((s), "UTF-8", SYSTEM_CHARSET)
|
|
||||||
#else
|
|
||||||
# define TO_UTF8(s) (s)
|
|
||||||
# define FROM_UTF8(s) (s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// this stuff is so popular.. can i really put it anywhere else?
|
|
||||||
#ifndef DEFAULT_CONTENT_TYPE
|
|
||||||
# define DEFAULT_CONTENT_TYPE "text/html; charset=" SYSTEM_CHARSET
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __EFUN_DEFINED__(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.
|
|
||||||
// so FROM_UTF8 and TO_UTF8 are normally nullmacros (see above)
|
|
||||||
# include <idn.h>
|
|
||||||
// beware, these macros dont have error handling...
|
|
||||||
# define NODEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_XMPP_NODEPREP))
|
|
||||||
# define NAMEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_NAMEPREP))
|
|
||||||
# define RESOURCEPREP(s) FROM_UTF8(stringprep(TO_UTF8(s), STRINGPREP_XMPP_RESOURCEPREP))
|
|
||||||
#else
|
|
||||||
# define NODEPREP(s) lower_case(s)
|
|
||||||
# define NAMEPREP(s) lower_case(s)
|
|
||||||
# define RESOURCEPREP(s) (s)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MUD
|
#ifdef MUD
|
||||||
# define NO_NEWBIES
|
# define NO_NEWBIES
|
||||||
#endif
|
#endif
|
||||||
@ -142,6 +143,10 @@
|
|||||||
# define DEFAULT_USER_OBJECT PSYC_PATH "user"
|
# define DEFAULT_USER_OBJECT PSYC_PATH "user"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef MAX_VISIBLE_USERS
|
||||||
|
# define MAX_VISIBLE_USERS 44
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef PRO_PATH
|
#ifndef PRO_PATH
|
||||||
// very specific to the way we do web applications
|
// very specific to the way we do web applications
|
||||||
# define htok this_interactive()->http_ok
|
# define htok this_interactive()->http_ok
|
||||||
@ -196,18 +201,18 @@
|
|||||||
// wir können viel herumphilosophieren was richtig wäre, aber tatsächlich
|
// wir können viel herumphilosophieren was richtig wäre, aber tatsächlich
|
||||||
// effizienter verteilen werden wir auf kurze sicht eh nicht, so lets use this:
|
// effizienter verteilen werden wir auf kurze sicht eh nicht, so lets use this:
|
||||||
# define SMART_UNICAST_FRIENDS
|
# define SMART_UNICAST_FRIENDS
|
||||||
# define NOT_EXPERIMENTAL // code that was experimental just until recently
|
|
||||||
# define SIGS
|
# define SIGS
|
||||||
# define SWITCH2PSYC
|
# define SWITCH2PSYC
|
||||||
# define WANT_S2S_TLS
|
# define WANT_S2S_TLS
|
||||||
# define WANT_S2S_SASL
|
# define WANT_S2S_SASL
|
||||||
# define TRUSTINESS
|
|
||||||
# define ENTER_MEMBERS
|
# define ENTER_MEMBERS
|
||||||
# define PERSISTENT_MASTERS
|
# define PERSISTENT_MASTERS
|
||||||
# define NEW_LINK
|
# define NEW_LINK
|
||||||
# define NEW_UNLINK
|
# define NEW_UNLINK
|
||||||
# define NEW_RENDER
|
# define NEW_RENDER
|
||||||
|
# define MUCSUC
|
||||||
#endif
|
#endif
|
||||||
|
#define GAMMA // code that has left BETA and is in production use
|
||||||
|
|
||||||
#ifndef _flag_disable_log_hosts
|
#ifndef _flag_disable_log_hosts
|
||||||
# define _flag_log_hosts
|
# define _flag_log_hosts
|
||||||
@ -217,7 +222,6 @@
|
|||||||
// fippo's brilliant single-user channel emulation for jabber MUCs
|
// fippo's brilliant single-user channel emulation for jabber MUCs
|
||||||
// unfortunately it provides no advantages over the old method, yet.
|
// unfortunately it provides no advantages over the old method, yet.
|
||||||
// would be cool to cache a member list at least! TODO
|
// would be cool to cache a member list at least! TODO
|
||||||
# define MUCSUC
|
|
||||||
# define PERSISTENT_SLAVES
|
# define PERSISTENT_SLAVES
|
||||||
// efine IRC_FRIENDCHANNEL // hopelessly needs more work
|
// efine IRC_FRIENDCHANNEL // hopelessly needs more work
|
||||||
# ifdef HTTP_PATH
|
# ifdef HTTP_PATH
|
||||||
@ -240,6 +244,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// still using rawp anywhere?
|
// still using rawp anywhere?
|
||||||
#define rawp(TEXT) { P1(("rawp? "+TEXT)) emit(TEXT); }
|
//#define rawp(TEXT) { P1(("rawp? "+TEXT)) emit(TEXT); }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: person.h,v 1.27 2007/09/18 09:49:17 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: person.h,v 1.29 2008/07/26 10:54:30 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
//
|
//
|
||||||
#ifndef _INCLUDE_PERSON_H
|
#ifndef _INCLUDE_PERSON_H
|
||||||
#define _INCLUDE_PERSON_H
|
#define _INCLUDE_PERSON_H
|
||||||
@ -15,7 +15,7 @@
|
|||||||
#define FRIEND_NICK 0
|
#define FRIEND_NICK 0
|
||||||
#define FRIEND_AVAILABILITY 1
|
#define FRIEND_AVAILABILITY 1
|
||||||
|
|
||||||
#if !defined(VOLATILE) && !defined(RELAY)
|
#if !defined(VOLATILE) && !defined(RELAY) && !defined(_flag_disable_module_nickspace)
|
||||||
# define ALIASES
|
# define ALIASES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -57,6 +57,15 @@
|
|||||||
t = time() - v("aliveTime");\
|
t = time() - v("aliveTime");\
|
||||||
t = t < 30 ? 0 : t < 300 ? 300 : (t + random(200) - 100);
|
t = t < 30 ? 0 : t < 300 ? 300 : (t + random(200) - 100);
|
||||||
|
|
||||||
|
|
||||||
|
// used by myLogAppend below:
|
||||||
|
#ifndef _limit_amount_log
|
||||||
|
# define _limit_amount_log 777
|
||||||
|
#endif
|
||||||
|
#ifndef _limit_amount_log_persistent
|
||||||
|
# define _limit_amount_log_persistent 100
|
||||||
|
#endif
|
||||||
|
|
||||||
// should "new" become part of the lastlog.c mechanism? how?
|
// should "new" become part of the lastlog.c mechanism? how?
|
||||||
// should we simply use timestamp of last logout? that works
|
// should we simply use timestamp of last logout? that works
|
||||||
// better with places for history-while-i-was-away too. TODO
|
// better with places for history-while-i-was-away too. TODO
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// vim:noexpandtab:syntax=lpc
|
// vim:noexpandtab:syntax=lpc
|
||||||
// $Id: place.gen,v 1.135 2008/04/16 16:59:41 lynx Exp $
|
// $Id: place.gen,v 1.137 2008/09/12 15:37:39 lynx Exp $
|
||||||
//
|
//
|
||||||
// documentation on http://about.psyc.eu/Create_Place
|
// documentation on http://about.psyc.eu/Create_Place
|
||||||
//
|
//
|
||||||
@ -56,8 +56,8 @@
|
|||||||
# ifdef NAME
|
# ifdef NAME
|
||||||
# define REDIRECT CONNECT
|
# define REDIRECT CONNECT
|
||||||
# ifndef CONNECT
|
# ifndef CONNECT
|
||||||
# ifdef SERVER_URL
|
# ifdef _uniform_node
|
||||||
# define CONNECT SERVER_URL "@" NAME
|
# define CONNECT _uniform_node "@" NAME
|
||||||
# else
|
# else
|
||||||
# define CONNECT "psyc://" SERVER_HOST "/@" NAME
|
# define CONNECT "psyc://" SERVER_HOST "/@" NAME
|
||||||
# endif
|
# endif
|
||||||
@ -72,8 +72,8 @@
|
|||||||
#ifdef SLAVE
|
#ifdef SLAVE
|
||||||
# ifndef CONNECT
|
# ifndef CONNECT
|
||||||
# ifdef NAME
|
# ifdef NAME
|
||||||
# ifdef SERVER_URL
|
# ifdef _uniform_node
|
||||||
# define CONNECT SERVER_URL "@" NAME
|
# define CONNECT _uniform_node "@" NAME
|
||||||
# else
|
# else
|
||||||
# define CONNECT "psyc://" SERVER_HOST "/@" NAME
|
# define CONNECT "psyc://" SERVER_HOST "/@" NAME
|
||||||
# endif
|
# endif
|
||||||
@ -311,11 +311,11 @@ void create() {
|
|||||||
P1(("PLACE %O MASTER\n", ME))
|
P1(("PLACE %O MASTER\n", ME))
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# ifdef SERVER_URL
|
# ifdef _uniform_node
|
||||||
# if CONNECT == SERVER_URL
|
# if CONNECT == _uniform_node
|
||||||
D1(D("link [" CONNECT "] == host ["+ SERVER_URL +"]\n");)
|
D1(D("link [" CONNECT "] == host ["+ _uniform_node +"]\n");)
|
||||||
# else
|
# else
|
||||||
D1(D("link [" CONNECT "] != host ["+ SERVER_URL +"]\n");)
|
D1(D("link [" CONNECT "] != host ["+ _uniform_node +"]\n");)
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@ -559,6 +559,11 @@ msg(source, mc, data, vars) {
|
|||||||
# ifdef ON_ANY
|
# ifdef ON_ANY
|
||||||
ON_ANY
|
ON_ANY
|
||||||
# endif
|
# endif
|
||||||
|
# ifdef ON_CONVERSE
|
||||||
|
if (abbrev("_message", mc)) {
|
||||||
|
ON_CONVERSE
|
||||||
|
}
|
||||||
|
# endif
|
||||||
# ifdef REDIRECT
|
# ifdef REDIRECT
|
||||||
sendmsg(source, "_failure_redirect_temporary",
|
sendmsg(source, "_failure_redirect_temporary",
|
||||||
"[_nick_place] is currently unable to fulfil this operation. Please direct your request to [_source_redirect]",
|
"[_nick_place] is currently unable to fulfil this operation. Please direct your request to [_source_redirect]",
|
||||||
@ -574,11 +579,6 @@ msg(source, mc, data, vars) {
|
|||||||
return 0;
|
return 0;
|
||||||
# else
|
# else
|
||||||
::msg(source, mc, data, vars);
|
::msg(source, mc, data, vars);
|
||||||
# ifdef ON_CONVERSE
|
|
||||||
if (abbrev("_message", mc)) {
|
|
||||||
ON_CONVERSE
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// $Id: presence.h,v 1.9 2007/07/25 09:57:32 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: presence.h,v 1.11 2008/07/26 10:54:30 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
//
|
//
|
||||||
#ifndef _INCLUDE_PRESENCE_H
|
#ifndef _INCLUDE_PRESENCE_H
|
||||||
#define _INCLUDE_PRESENCE_H
|
#define _INCLUDE_PRESENCE_H
|
||||||
|
#ifndef _flag_disable_module_presence
|
||||||
|
|
||||||
// similar to what is defined as "availability"
|
// similar to what is defined as "availability"
|
||||||
// in http://www.psyc.eu/presence
|
// in http://www.psyc.eu/presence
|
||||||
@ -22,10 +23,12 @@
|
|||||||
#define AVAILABILITY_REALTIME 9 // as yet unused, name?
|
#define AVAILABILITY_REALTIME 9 // as yet unused, name?
|
||||||
|
|
||||||
// more unused stuff from http://www.psyc.eu/presence
|
// more unused stuff from http://www.psyc.eu/presence
|
||||||
|
// see also english wording currently in net/library/share.c
|
||||||
#define MOOD_JUCHEI 8
|
#define MOOD_JUCHEI 8
|
||||||
#define MOOD_BASSTSCHO 6
|
#define MOOD_BASSTSCHO 6
|
||||||
#define MOOD_NAJA 4
|
#define MOOD_NAJA 4
|
||||||
#define MOOD_LEXTSMIAMOARSCHI 2
|
#define MOOD_LEXTSMIAMOARSCHI 2
|
||||||
// see also english wording currently in net/library/share.c
|
#define MOOD_UNSPECIFIED 0
|
||||||
|
|
||||||
|
#endif // _flag_disable_module_presence
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: proto.h,v 1.20 2007/09/30 17:06:11 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: proto.h,v 1.22 2008/05/07 10:50:29 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
//
|
//
|
||||||
// sometimes prototypes are needed. i keep them here and include
|
// sometimes prototypes are needed. i keep them here and include
|
||||||
// them also in the files that *define* the function so that the
|
// them also in the files that *define* the function so that the
|
||||||
@ -14,7 +14,9 @@
|
|||||||
void dns_resolve(string hostname, closure callback, varargs array(mixed) extra);
|
void dns_resolve(string hostname, closure callback, varargs array(mixed) extra);
|
||||||
void dns_rresolve(string ip, closure callback, varargs array(mixed) extra);
|
void dns_rresolve(string ip, closure callback, varargs array(mixed) extra);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef hex2int
|
||||||
int hex2int(string hex);
|
int hex2int(string hex);
|
||||||
|
#endif
|
||||||
varargs string isotime(mixed ctim, int long);
|
varargs string isotime(mixed ctim, int long);
|
||||||
int legal_host(string ip, int port, string scheme, int udpflag);
|
int legal_host(string ip, int port, string scheme, int udpflag);
|
||||||
#ifdef varargs
|
#ifdef varargs
|
||||||
@ -37,9 +39,11 @@ string timedelta(int secs);
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// danny, do you really need this?
|
|
||||||
void _psyc_dns_resolve(string hostname, closure callback, varargs array(mixed) extra);
|
void _psyc_dns_resolve(string hostname, closure callback, varargs array(mixed) extra);
|
||||||
void _psyc_dns_rresolve(string ip, closure callback, varargs array(mixed) extra);
|
void _psyc_dns_rresolve(string ip, closure callback, varargs array(mixed) extra);
|
||||||
|
#ifndef hex2int
|
||||||
|
int _psyc_hex2int(string hex);
|
||||||
|
#endif
|
||||||
int _psyc_legal_host(string ip, int port, string scheme, int udpflag);
|
int _psyc_legal_host(string ip, int port, string scheme, int udpflag);
|
||||||
#ifdef varargs
|
#ifdef varargs
|
||||||
void _psyc_log_file(string file,string str,
|
void _psyc_log_file(string file,string str,
|
||||||
@ -47,11 +51,16 @@ void _psyc_log_file(string file,string str,
|
|||||||
#else
|
#else
|
||||||
void _psyc_log_file(string file, string str, varargs array(mixed) args);
|
void _psyc_log_file(string file, string str, varargs array(mixed) args);
|
||||||
#endif
|
#endif
|
||||||
|
string _psyc_make_json(mixed d);
|
||||||
void _psyc_monitor_report(string mc, string text);
|
void _psyc_monitor_report(string mc, string text);
|
||||||
object* _psyc_objects_people();
|
object* _psyc_objects_people();
|
||||||
|
varargs string _psyc_psyc_name(mixed source, vastring localpart);
|
||||||
string _psyc_query_server_unl();
|
string _psyc_query_server_unl();
|
||||||
varargs mixed _psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
|
varargs mixed _psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
|
||||||
mixed source, int showingLog, closure callback, varargs array(mixed) extra);
|
mixed source, int showingLog, closure callback, varargs array(mixed) extra);
|
||||||
|
varargs void _psyc_shout(mixed who, string what, string text, mapping vars);
|
||||||
|
varargs int _psyc_server_shutdown(string reason, int restart, int pass);
|
||||||
|
string _psyc_timedelta(int secs);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -48,7 +48,18 @@
|
|||||||
// here are the macros to implement method inheritance in a loop around
|
// here are the macros to implement method inheritance in a loop around
|
||||||
// a switch (see http://about.psyc.eu/Inheritance and "try and slice")
|
// a switch (see http://about.psyc.eu/Inheritance and "try and slice")
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL
|
// changes for try/slice are so profound in some parts, that running with it
|
||||||
|
// disabled is actually more "experimental" and flaky. PSYC_TRY() is also
|
||||||
|
// used for varnames in spyc/dispatch.i, so it's not just the methods here.
|
||||||
|
#ifndef _flag_disable_inheritance_method
|
||||||
|
# if DEBUG > 1
|
||||||
|
# define PSYC_SLICE_DEBUG \
|
||||||
|
log_file("SLICE", "%s:%O slicing %O in %O\n", \
|
||||||
|
__FILE__, __LINE__, family, ME);
|
||||||
|
# else
|
||||||
|
# define PSYC_SLICE_DEBUG
|
||||||
|
# endif
|
||||||
|
|
||||||
# define PSYC_TRY(mc) \
|
# define PSYC_TRY(mc) \
|
||||||
family = mc; \
|
family = mc; \
|
||||||
while (family) { \
|
while (family) { \
|
||||||
@ -57,8 +68,7 @@
|
|||||||
|
|
||||||
# define PSYC_SLICE_AND_REPEAT \
|
# define PSYC_SLICE_AND_REPEAT \
|
||||||
default: \
|
default: \
|
||||||
log_file("SLICE", "%s:%O slicing %O in %O\n", \
|
PSYC_SLICE_DEBUG \
|
||||||
__FILE__, __LINE__, family, ME); \
|
|
||||||
glyph = rmember(family, C_GLYPH_SEPARATOR_KEYWORD); \
|
glyph = rmember(family, C_GLYPH_SEPARATOR_KEYWORD); \
|
||||||
if (glyph > 1) family = family[.. glyph-1]; \
|
if (glyph > 1) family = family[.. glyph-1]; \
|
||||||
else family = 0; \
|
else family = 0; \
|
||||||
@ -66,7 +76,6 @@
|
|||||||
if (glyph == -4) family = 0; // got here by break;
|
if (glyph == -4) family = 0; // got here by break;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// this disables method inheritance
|
|
||||||
# define PSYC_TRY(mc) switch(mc)
|
# define PSYC_TRY(mc) switch(mc)
|
||||||
# define PSYC_SLICE_AND_REPEAT
|
# define PSYC_SLICE_AND_REPEAT
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#define HTTPS_SERVICE 443 // http over TLS/SSL
|
#define HTTPS_SERVICE 443 // http over TLS/SSL
|
||||||
#define SMTPS_SERVICE 465
|
#define SMTPS_SERVICE 465
|
||||||
#define NNTPS_SERVICE 563 // nntp over TLS/SSL
|
#define NNTPS_SERVICE 563 // nntp over TLS/SSL
|
||||||
|
#define FLASHPOL_SERVICE 843 // flash crossdomain policy server
|
||||||
#define TELNETS_SERVICE 992
|
#define TELNETS_SERVICE 992
|
||||||
#define IRCS_SERVICE 994 // irc protocol over TLS/SSL
|
#define IRCS_SERVICE 994 // irc protocol over TLS/SSL
|
||||||
#define POP3S_SERVICE 995
|
#define POP3S_SERVICE 995
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
virtual inherit NET_PATH "textc";
|
virtual inherit NET_PATH "textc";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// #ifndef DEBUG
|
// #ifndef DEBUG
|
||||||
#if 1
|
#if 1
|
||||||
# define T(mc, fmt) \
|
# define T(mc, fmt) \
|
||||||
|
@ -23,4 +23,5 @@
|
|||||||
// (not provided by parse_uniform)
|
// (not provided by parse_uniform)
|
||||||
#define USize 15
|
#define USize 15
|
||||||
|
|
||||||
|
#define UName(uniform) (uniform[UUser] || uniform[UResource][1 ..])
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// $Id: common.c,v 1.107 2008/04/16 14:21:17 lynx Exp $ // vim:syntax=lpc
|
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||||
|
// $Id: common.c,v 1.120 2008/12/16 11:58:52 lynx Exp $
|
||||||
//
|
//
|
||||||
// common functions for IRC servers and clients (gateways)
|
// common functions for IRC servers and clients (gateways)
|
||||||
//
|
//
|
||||||
@ -33,12 +34,13 @@ parse(a) {
|
|||||||
//if (a[<1] == ' ' || a[0] == ' ')
|
//if (a[<1] == ' ' || a[0] == ' ')
|
||||||
a = trim(a, TRIM_BOTH);
|
a = trim(a, TRIM_BOTH);
|
||||||
// efun probably faster than doing all those checks anyway
|
// efun probably faster than doing all those checks anyway
|
||||||
#else
|
#else //{{{
|
||||||
// not as efficient as it could be, but we have trim() anyway
|
// not as efficient as it could be, but we have trim() anyway
|
||||||
|
// move this into a pike macro for trim() emulation?
|
||||||
if (a == "") return; // first make sure there's something at all
|
if (a == "") return; // first make sure there's something at all
|
||||||
while (a[0] == ' ') a = a[1..];
|
while (a[0] == ' ') a = a[1..];
|
||||||
while (a[<1] == ' ') a = a[0..<2];
|
while (a[<1] == ' ') a = a[0..<2];
|
||||||
#endif
|
#endif //}}}
|
||||||
if (a == "") return; // don't let " \n" execute "/s"
|
if (a == "") return; // don't let " \n" execute "/s"
|
||||||
unless (sscanf(a, ":%s %s", from, t)) t = a;
|
unless (sscanf(a, ":%s %s", from, t)) t = a;
|
||||||
sscanf(t, "%s :%s", t, text);
|
sscanf(t, "%s :%s", t, text);
|
||||||
@ -53,9 +55,11 @@ ircMsg(from, cmd, args, text, all) {
|
|||||||
case "motd":
|
case "motd":
|
||||||
motd();
|
motd();
|
||||||
return 1;
|
return 1;
|
||||||
|
#ifndef BETA
|
||||||
case "lusers":
|
case "lusers":
|
||||||
lusers();
|
lusers();
|
||||||
return 1;
|
return 1;
|
||||||
|
#endif
|
||||||
case "time":
|
case "time":
|
||||||
t = time();
|
t = time();
|
||||||
t1 = ctime(t);
|
t1 = ctime(t);
|
||||||
@ -111,6 +115,7 @@ motd() {
|
|||||||
// dummerweise fiel hier im Zuge des neuen emit das '- ' flach - fippo
|
// dummerweise fiel hier im Zuge des neuen emit das '- ' flach - fippo
|
||||||
P3(("MOTD_FILE (%O) found\n", MOTD_FILE))
|
P3(("MOTD_FILE (%O) found\n", MOTD_FILE))
|
||||||
motd_file = read_file(MOTD_FILE);
|
motd_file = read_file(MOTD_FILE);
|
||||||
|
P4(("MOTD = %O\n", motd_file))
|
||||||
emit(sreply(RPL_MOTD, ":" + motd_file));
|
emit(sreply(RPL_MOTD, ":" + motd_file));
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@ -132,10 +137,14 @@ motd() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef BETA
|
||||||
lusers() {
|
lusers() {
|
||||||
|
# ifndef _flag_disable_query_server
|
||||||
reply(RPL_LUSERCLIENT, ":There are " + amount_people()
|
reply(RPL_LUSERCLIENT, ":There are " + amount_people()
|
||||||
+ " users on this server\n");
|
+ " users on this server");
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
qCharset() {}
|
qCharset() {}
|
||||||
|
|
||||||
@ -143,56 +152,47 @@ render(string mc, string data, mapping vars, mixed source) {
|
|||||||
string template, output;
|
string template, output;
|
||||||
mixed t;
|
mixed t;
|
||||||
|
|
||||||
P0(("common:render %O %O\n", ME, data));
|
P3(("common:render %O %O\n", ME, data));
|
||||||
#if 1 // def IRCEXPERIMENTAL
|
#if 1 // def IRCEXPERIMENTAL
|
||||||
template = T(mc, 0); // enable textdb inheritance
|
template = T(mc, 0); // enable textdb inheritance
|
||||||
#else
|
#else
|
||||||
template = T(mc, "");
|
template = T(mc, "");
|
||||||
#endif
|
#endif
|
||||||
<<<<<<< common.c
|
|
||||||
=======
|
|
||||||
#ifndef _flag_disable_stamp_time_IRC
|
#ifndef _flag_disable_stamp_time_IRC
|
||||||
t = vars["_time_place"] || vars["_time_log"];
|
t = vars["_time_place"] || vars["_time_log"];
|
||||||
|
// this goes thru ->v()
|
||||||
if (t && v("timestamp") != "off" // && abbrev("_message", mc)
|
if (t && v("timestamp") != "off" // && abbrev("_message", mc)
|
||||||
&& stringp(data)) {
|
&& stringp(data)) {
|
||||||
|
# ifndef GAMMA
|
||||||
if (stringp(t)) t = to_int(t); // we need types ;)
|
if (stringp(t)) t = to_int(t); // we need types ;)
|
||||||
|
# endif
|
||||||
if (v("timestamp") == "on") {
|
if (v("timestamp") == "on") {
|
||||||
string msa = " ";
|
string msa = " ";
|
||||||
msa[0] = 0x01; // msa's CTCP character
|
msa[0] = 0x01; // msa's CTCP character
|
||||||
// should use psyctime instead of unixtime
|
// should use psyctime instead of unixtime
|
||||||
data = msa +"TS "+ (t - PSYC_EPOCH) +msa+ data;
|
data = msa +"TS "+ (t - PSYC_EPOCH) +msa+ data;
|
||||||
} else
|
} else
|
||||||
data = "["+ hhmm(ctime(t)) +"] "+ data; // use T() ?
|
data = "["+ time_or_date(t) +"] "+ data; // use T() ?
|
||||||
P3(("%O data is %O\n", ME, data))
|
P3(("%O data is %O\n", ME, data))
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
>>>>>>> 1.107
|
|
||||||
P3(("c:r pre ptext: %O %O %O %O\n", template, vars, data, source ));
|
P3(("c:r pre ptext: %O %O %O %O\n", template, vars, data, source ));
|
||||||
output = psyctext( template, vars, data, source);
|
output = psyctext( template, vars, data, source);
|
||||||
P3(("c:r 1st ptext: %O\n", output));
|
P3(("c:r 1st ptext: %O\n", output));
|
||||||
if (!output || output=="") return D2(D("irc/user: empty output\n"));
|
if (!output || output=="") return D2(D("irc/user: empty output\n"));
|
||||||
|
|
||||||
#ifndef _flag_disable_stamp_time_IRC
|
#ifdef NEW_LINE
|
||||||
if (t = vars["_time_place"] || vars["_time_log"]) {
|
output += "\n";
|
||||||
PT(("%O got timestamp %O\n", ME, t))
|
#else
|
||||||
}
|
|
||||||
if (t && v("timestamp") != "off" && abbrev("_message", mc)
|
|
||||||
&& stringp(output)) {
|
|
||||||
output = v("timestamp")
|
|
||||||
? output +" ["+ hhmm(ctime(t)) +"]" // use T() ?
|
|
||||||
: output + "%TS "+ hhmm(ctime(t)) +"%";
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (template == "") {
|
if (template == "") {
|
||||||
#ifdef PREFIXES
|
# ifdef PREFIXES //{{{
|
||||||
// der ganze prefix kram is im irc protokoll in der
|
|
||||||
// tat blödsinn.. muss ma anders machen..
|
|
||||||
if (abbrev("_prefix", mc)) return prefix = output+" ";
|
if (abbrev("_prefix", mc)) return prefix = output+" ";
|
||||||
else
|
else
|
||||||
#endif
|
# endif //}}}
|
||||||
output += "\n";
|
output += "\n";
|
||||||
}
|
}
|
||||||
if (output[0] == '#') output = SERVER_SOURCE + output[1..];
|
#endif
|
||||||
|
if (output[0] == '#') output = SERVER_SOURCE + output[1 ..];
|
||||||
else if (output[0] != ':') {
|
else if (output[0] != ':') {
|
||||||
string t2;
|
string t2;
|
||||||
|
|
||||||
@ -228,12 +228,11 @@ render(string mc, string data, mapping vars, mixed source) {
|
|||||||
log_file("IRC_TEXTDB", "%O\n", mc);
|
log_file("IRC_TEXTDB", "%O\n", mc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _silent: when casts from a conversation-filtered place
|
// _silent: when casts from a conversation-filtered place
|
||||||
// arrive, which isnt known to the client as a channel, we
|
// arrive, which isnt known to the client as a channel, we
|
||||||
// revert to personal notices to not irritate it.
|
// revert to personal notices to not irritate it.
|
||||||
if (
|
if (
|
||||||
#ifdef NOT_EXPERIMENTAL
|
#if 1
|
||||||
// would be nicer to check if source is a place but
|
// would be nicer to check if source is a place but
|
||||||
// isn't trivial right here.. looks like joining remote
|
// isn't trivial right here.. looks like joining remote
|
||||||
// xmpp: mucs is affected by this change - you may not
|
// xmpp: mucs is affected by this change - you may not
|
||||||
@ -275,13 +274,16 @@ render(string mc, string data, mapping vars, mixed source) {
|
|||||||
"_members" : vars["_nick_me"] ]));
|
"_members" : vars["_nick_me"] ]));
|
||||||
w(mc[..<8] + "_end", 0, vars);
|
w(mc[..<8] + "_end", 0, vars);
|
||||||
}
|
}
|
||||||
|
P4(("calling emit(%O)\n", output));
|
||||||
emit(output);
|
emit(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
// server:w() doesnt call this anyway, so we dont need last_prefix
|
// server:w() doesnt call this anyway, so we dont need last_prefix
|
||||||
//volatile private string last_prefix;
|
//volatile private string last_prefix;
|
||||||
emit(string output) {
|
emit(string output) {
|
||||||
//PT(("common:emit %O %O\n", ME, output));
|
string* outlines;
|
||||||
|
|
||||||
|
P3(("common:emit %O %O\n", ME, output));
|
||||||
// misteries of virtual inheritance.. why doesnt this get called
|
// misteries of virtual inheritance.. why doesnt this get called
|
||||||
// from gatebot? we need to get this working for 512-split!!
|
// from gatebot? we need to get this working for 512-split!!
|
||||||
#ifdef _flag_log_sockets_IRC
|
#ifdef _flag_log_sockets_IRC
|
||||||
@ -296,25 +298,37 @@ emit(string output) {
|
|||||||
P4(("output in %O = %O\n", cs, output))
|
P4(("output in %O = %O\n", cs, output))
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (output[<1] != '\n')
|
if (output[<1] != '\n') {
|
||||||
return EMIT(output);
|
// this is used when prompting for password
|
||||||
if (strlen(output) < MAX_IRC_BYTES)
|
P4(("irc:emit optimized for prefix on %O\n", output))
|
||||||
return EMIT(chomp(output) + "\r\n");
|
return EMIT(output);
|
||||||
else {
|
}
|
||||||
|
outlines = explode(slice_from_end(output, 0, 2), "\n");
|
||||||
|
if (sizeof(outlines) == 1 && strlen(output) < MAX_IRC_BYTES) {
|
||||||
|
// optimized for single line
|
||||||
|
P4(("irc:emit single %O\n", outlines[0]))
|
||||||
|
return EMIT(outlines[0] + "\r\n");
|
||||||
|
} else {
|
||||||
string split_prefix, line;
|
string split_prefix, line;
|
||||||
int cut, t;
|
int cut, t;
|
||||||
|
|
||||||
cut = strstr(output, " :");
|
cut = strstr(output, " :");
|
||||||
P3(("IRC:emit splitting large line at %O\n%O\n", cut, output))
|
P4(("IRC:emit splitting large line at %O\n%O\n", cut, outlines))
|
||||||
if (cut >= 0) {
|
if (cut >= 0) {
|
||||||
split_prefix = output[..++cut];
|
split_prefix = outlines[0][.. ++cut];
|
||||||
output = output[++cut..<2];
|
#if 0 // annoying rendering bug we had here.. but is <2 always wrong?
|
||||||
if (output[0] == output[<1] && output[0] == 0x01) {
|
outlines[0] = outlines[0][++cut .. <2];
|
||||||
output = chop(output);
|
#else
|
||||||
|
outlines[0] = outlines[0][++cut .. <1];
|
||||||
|
#endif
|
||||||
|
if (strlen(outlines[0])
|
||||||
|
&& outlines[0][0] == outlines[0][<1]
|
||||||
|
&& outlines[0][0] == 0x01) {
|
||||||
|
outlines[0] = chop(outlines[0]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
split_prefix = ""; //last_prefix;
|
split_prefix = ""; //last_prefix;
|
||||||
output = chop(output);
|
outlines[0] = chop(outlines[0]);
|
||||||
}
|
}
|
||||||
// because of additional \\\r\n we have to subtract 3
|
// because of additional \\\r\n we have to subtract 3
|
||||||
cut = MAX_IRC_BYTES-3 - strlen(split_prefix);
|
cut = MAX_IRC_BYTES-3 - strlen(split_prefix);
|
||||||
@ -324,10 +338,9 @@ emit(string output) {
|
|||||||
"to be able to do 512 splitting\n%O\n", ME, line))
|
"to be able to do 512 splitting\n%O\n", ME, line))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach(line : explode(output, "\n")) if (strlen(line)) {
|
foreach(line : outlines) if (strlen(line)) {
|
||||||
// maybe we should just throw away everything beyond
|
|
||||||
while (strlen(line) > cut) {
|
while (strlen(line) > cut) {
|
||||||
#ifdef NOT_EXPERIMENTAL
|
#if 1
|
||||||
// we shall look for last whitespace instead
|
// we shall look for last whitespace instead
|
||||||
t = rindex(line, ' ', cut);
|
t = rindex(line, ' ', cut);
|
||||||
if (t > 9) {
|
if (t > 9) {
|
||||||
@ -337,12 +350,14 @@ emit(string output) {
|
|||||||
// any realistic ideas
|
// any realistic ideas
|
||||||
// how to do do this
|
// how to do do this
|
||||||
// just once?
|
// just once?
|
||||||
|
P4(("splitting an msa line %O\n", line[.. t]))
|
||||||
EMIT(split_prefix + line[..t]
|
EMIT(split_prefix + line[..t]
|
||||||
+ line[0..0] + "\r\n");
|
+ line[0..0] + "\r\n");
|
||||||
line = line[t+1..];
|
line = line[t+1 ..];
|
||||||
} else {
|
} else {
|
||||||
EMIT(split_prefix + line[..t]+ "\r\n");
|
P4(("time for %O\n", line[.. t]))
|
||||||
line = line[t+1..];
|
EMIT(split_prefix + line[.. t]+ "\r\n");
|
||||||
|
line = line[t+1 ..];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
P1(("%O encountered data w/out ' ' to "
|
P1(("%O encountered data w/out ' ' to "
|
||||||
@ -353,7 +368,7 @@ emit(string output) {
|
|||||||
// we might aswell use the old
|
// we might aswell use the old
|
||||||
// backslash splitting code below here
|
// backslash splitting code below here
|
||||||
}
|
}
|
||||||
#else
|
#else //{{{
|
||||||
t = line[cut] == '\r' ? cut-1 : cut;
|
t = line[cut] == '\r' ? cut-1 : cut;
|
||||||
|
|
||||||
// msa's CTCP character
|
// msa's CTCP character
|
||||||
@ -371,8 +386,9 @@ emit(string output) {
|
|||||||
+ "\\\r\n");
|
+ "\\\r\n");
|
||||||
line = line[cut+1..];
|
line = line[cut+1..];
|
||||||
}
|
}
|
||||||
#endif
|
#endif //}}}
|
||||||
}
|
}
|
||||||
|
P4(("irc:emit each %O\n", line))
|
||||||
EMIT(split_prefix + line +"\r\n");
|
EMIT(split_prefix + line +"\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
// $Id: decode.c,v 1.28 2008/01/21 10:25:12 lynx Exp $ // vim:syntax=lpc
|
// $Id: decode.c,v 1.30 2008/07/28 20:30:48 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// generic CTCP implementation, also includes color code filter.
|
// generic CTCP implementation, also includes color code filter.
|
||||||
// msa (Markku Savela, if i remember the spelling right) came up
|
// msa (Markku Savela, if i remember the spelling right) came up
|
||||||
// with the crazy idea of using binary code 1 as the escape code
|
// with the crazy idea of using binary code 1 as the escape code
|
||||||
// for CTCP, so we put that code into the variable msa.
|
// for CTCP, so we put that code into the variable msa.
|
||||||
//
|
//
|
||||||
|
#include "irc.h"
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
|
||||||
volatile string msa, msare, cc, bc, uc;
|
volatile string msa, msare, cc, bc, uc;
|
||||||
@ -45,7 +46,7 @@ version(text, target, req, srcnick, source) {
|
|||||||
sendmsg(target, "_request_version",
|
sendmsg(target, "_request_version",
|
||||||
"[_nick] requests your version.",
|
"[_nick] requests your version.",
|
||||||
([ "_nick" : srcnick ]), source );
|
([ "_nick" : srcnick ]), source );
|
||||||
#ifndef NO_IRC_AUTO_REQUEST_VERSION
|
#ifndef _flag_disable_request_version_IRC
|
||||||
} else if (target == query_server_unl()) {
|
} else if (target == query_server_unl()) {
|
||||||
if (text) vSet("agent", text);
|
if (text) vSet("agent", text);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: gatebot.c,v 1.146 2008/03/11 13:42:26 lynx Exp $ // vim:syntax=lpc
|
// $Id: gatebot.c,v 1.151 2008/09/12 15:37:39 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// the PSYC-IRC gateway robot.
|
// the PSYC-IRC gateway robot.
|
||||||
// based on the ircbot.c in Nemesis that i wrote in 1992. -lynX
|
// based on the ircbot.c in Nemesis that i wrote in 1992. -lynX
|
||||||
@ -33,12 +33,11 @@
|
|||||||
// deal with when something needs to be fixed. Having two implementations
|
// deal with when something needs to be fixed. Having two implementations
|
||||||
// of the same thing wouldn't be what we want, anyway.
|
// of the same thing wouldn't be what we want, anyway.
|
||||||
|
|
||||||
#include <net.h>
|
#include "gatebot.h"
|
||||||
#include <status.h>
|
#include <status.h>
|
||||||
#include <services.h>
|
#include <services.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
#include "gatebot.h"
|
|
||||||
#include "error.h" // gets numeric codes
|
#include "error.h" // gets numeric codes
|
||||||
#include "reply.h" // gets numeric codes
|
#include "reply.h" // gets numeric codes
|
||||||
|
|
||||||
@ -49,12 +48,12 @@ inherit IRC_PATH "decode";
|
|||||||
// message queueing and automatic reconnect mgmt
|
// message queueing and automatic reconnect mgmt
|
||||||
inherit NET_PATH "circuit";
|
inherit NET_PATH "circuit";
|
||||||
|
|
||||||
#ifndef SERVER_URL
|
#ifndef _uniform_node
|
||||||
# define SERVER_URL query_server_unl()
|
# define _uniform_node query_server_unl()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RELAY
|
#ifdef RELAY
|
||||||
# define IRCER_UNIFORM(NICK) (SERVER_URL +"~"+ NICK)
|
# define IRCER_UNIFORM(NICK) (_uniform_node +"~"+ NICK)
|
||||||
#else
|
#else
|
||||||
// will upgrade to irc: syntax..
|
// will upgrade to irc: syntax..
|
||||||
# define IRCER_UNIFORM(NICK) (MYLOWERNICK +":"+ NICK)
|
# define IRCER_UNIFORM(NICK) (MYLOWERNICK +":"+ NICK)
|
||||||
@ -231,7 +230,7 @@ render(mc, data, vars, source) {
|
|||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// string ircsrc = (u[UScheme] || "xmpp") +";"+
|
// string ircsrc = (u[UScheme] || "xmpp") +";"+
|
||||||
// (u[UUser] || u[UResource][1..]) +"|"+
|
// (UName(u) +"|"+
|
||||||
// replace(u[UHost], ".", "_");
|
// replace(u[UHost], ".", "_");
|
||||||
if (source) {
|
if (source) {
|
||||||
advertise(source);
|
advertise(source);
|
||||||
@ -398,7 +397,7 @@ case RPL_LUSERCLIENT:
|
|||||||
from+": "+text);
|
from+": "+text);
|
||||||
break;
|
break;
|
||||||
case RPL_NAMREPLY:
|
case RPL_NAMREPLY:
|
||||||
names = text; namesfrom = from; namesto = a[3];
|
names = text; namesfrom = from; namesto = a[3][1 ..];
|
||||||
#ifdef CHAT_CHANNEL
|
#ifdef CHAT_CHANNEL
|
||||||
castmsg(ME, "_notice_place_members_IRC",
|
castmsg(ME, "_notice_place_members_IRC",
|
||||||
"On [_nick_place_IRC]: [_members_IRC]",
|
"On [_nick_place_IRC]: [_members_IRC]",
|
||||||
@ -662,10 +661,10 @@ logon(failure) {
|
|||||||
# endif
|
# endif
|
||||||
// leave login procedure to place.gen
|
// leave login procedure to place.gen
|
||||||
#else
|
#else
|
||||||
emit("NICK "+ IRCGATE_NICK +"\nUSER "+ IRCGATE_USERID
|
emit("NICK "+ IRCGATE_NICK +"\r\nUSER "+ IRCGATE_USERID
|
||||||
+" . . :"+ IRCGATE_NAME +"\n"
|
+" . . :"+ IRCGATE_NAME +"\r\n"
|
||||||
#ifdef IRCGATE_HIDE
|
#ifdef IRCGATE_HIDE
|
||||||
+"MODE "+ IRCGATE_NICK +" +i\n"
|
+"MODE "+ IRCGATE_NICK +" +i\r\n"
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: ghost.c,v 1.8 2007/08/27 16:54:13 lynx Exp $
|
// $Id: ghost.c,v 1.9 2008/04/24 15:19:36 lynx Exp $
|
||||||
//
|
//
|
||||||
// <lynX> ghost users serve the purpose of implementing all the features of
|
// <lynX> ghost users serve the purpose of implementing all the features of
|
||||||
// a PSYC/Jabber identity for users of an IRC network whose identities are
|
// a PSYC/Jabber identity for users of an IRC network whose identities are
|
||||||
@ -15,7 +15,7 @@ volatile object relay;
|
|||||||
|
|
||||||
#include "user.c"
|
#include "user.c"
|
||||||
|
|
||||||
emit(string output) {
|
protected int emit(string output) {
|
||||||
unless (relay) {
|
unless (relay) {
|
||||||
//relay = RELAY_OBJECT -> load();
|
//relay = RELAY_OBJECT -> load();
|
||||||
relay = find_object(RELAY_OBJECT);
|
relay = find_object(RELAY_OBJECT);
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
// $Id: irc.h,v 1.17 2008/01/16 10:59:30 lynx Exp $ // vim:syntax=lpc
|
// $Id: irc.h,v 1.19 2008/08/11 09:13:12 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
|
||||||
|
// local debug messages - turn them on by using psyclpc -DDirc=<level>
|
||||||
|
#ifdef Dirc
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dirc
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
|
||||||
#ifndef NO_INHERIT
|
#ifndef NO_INHERIT
|
||||||
@ -31,3 +37,4 @@ inherit IRC_PATH "common";
|
|||||||
#ifndef IRCD
|
#ifndef IRCD
|
||||||
# define IRCD D3
|
# define IRCD D3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// vim:noexpandtab:syntax=lpc
|
// vim:noexpandtab:syntax=lpc
|
||||||
// $Id: library.i,v 1.22 2007/10/08 11:00:31 lynx Exp $
|
// $Id: library.i,v 1.25 2008/08/23 19:07:27 lynx Exp $
|
||||||
//
|
//
|
||||||
// this gets included into the system function library
|
// this gets included into the system function library
|
||||||
// also known as "simul_efun" in mud-speak.
|
// also known as "simul_efun" in mud-speak.
|
||||||
@ -14,25 +14,13 @@ volatile mapping p2i;
|
|||||||
|
|
||||||
string psyc2irc(string mc, mixed source) {
|
string psyc2irc(string mc, mixed source) {
|
||||||
mixed c;
|
mixed c;
|
||||||
#if 0
|
// looks like this should entirely evaporate into textdb...
|
||||||
// the code below will no longer generate server notices for remote
|
|
||||||
// sources - fippo likes it better that way
|
|
||||||
if (!source || objectp(source)) source = SERVER_SOURCE;
|
|
||||||
// i bet irssi wont like the !*@* (the weird problem we had with it
|
|
||||||
// about artifical nickname changes for same ident...)
|
|
||||||
//else source = ":" + source + "!*@* ";
|
|
||||||
else source = ":" + source + " ";
|
|
||||||
#else
|
|
||||||
// unfortunately, "pidgin" displays the non-server notices in an
|
|
||||||
// very annoying manner - one new window for each friend...
|
|
||||||
// will have to postpone this change until pidgin is fixed
|
|
||||||
source = SERVER_SOURCE;
|
|
||||||
#endif
|
|
||||||
unless (p2i) p2i = ([ // sorted by psyc method
|
unless (p2i) p2i = ([ // sorted by psyc method
|
||||||
"_list_places_members" : RPL_NAMREPLY,
|
"_list_places_members" : RPL_NAMREPLY,
|
||||||
// asking for a prompt is an error in irc protocol
|
// asking for a prompt is an error in irc protocol
|
||||||
"_query_password" : ERR_PASSWDMISMATCH,
|
"_query_password" : ERR_PASSWDMISMATCH,
|
||||||
"_status_place_topic" : RPL_TOPIC,
|
"_status_place_topic" : RPL_TOPIC,
|
||||||
|
//"_error_necessary_membership" : ERR_NOSUCHCHANNEL,
|
||||||
"_error_unavailable_nick_place" : ERR_BANNEDFROMCHAN, // pretty close
|
"_error_unavailable_nick_place" : ERR_BANNEDFROMCHAN, // pretty close
|
||||||
//"_status_place_members" : RPL_NAMREPLY,
|
//"_status_place_members" : RPL_NAMREPLY,
|
||||||
|
|
||||||
@ -50,6 +38,23 @@ string psyc2irc(string mc, mixed source) {
|
|||||||
if (c = p2i[mc]) return SERVER_SOURCE + c;
|
if (c = p2i[mc]) return SERVER_SOURCE + c;
|
||||||
// if (abbrev("_notice_place_enter", mc)) c = "JOIN";
|
// if (abbrev("_notice_place_enter", mc)) c = "JOIN";
|
||||||
// else if (abbrev("_notice_place_leave", mc)) c = "PART";
|
// else if (abbrev("_notice_place_leave", mc)) c = "PART";
|
||||||
|
#ifdef _flag_enable_notice_from_source_IRC
|
||||||
|
// the code below will no longer generate server notices for remote
|
||||||
|
// sources - fippo likes it better that way
|
||||||
|
// if (!source) source = SERVER_SOURCE;
|
||||||
|
if (!source || objectp(source)) source = SERVER_SOURCE;
|
||||||
|
// why aren't we trying to display something useful for an object here?
|
||||||
|
//
|
||||||
|
// i bet irssi wont like the !*@* (the weird problem we had with it
|
||||||
|
// about artifical nickname changes for same ident...)
|
||||||
|
//else source = ":" + source + "!*@* ";
|
||||||
|
else source = ":" + source + " ";
|
||||||
return source +"NOTICE";
|
return source +"NOTICE";
|
||||||
|
#else
|
||||||
|
// unfortunately, "pidgin" displays the non-server notices in an
|
||||||
|
// very annoying manner - one new window for each friend...
|
||||||
|
// will have to postpone this change until pidgin is fixed
|
||||||
|
return SERVER_SOURCE +"NOTICE";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: reply.h,v 1.9 2006/01/13 20:28:57 lynx Exp $ // vim:syntax=lpc
|
// $Id: reply.h,v 1.10 2008/07/27 21:27:07 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
|
|
||||||
// many useful and broken numerics have been added since the IRC RFCs
|
// many useful and broken numerics have been added since the IRC RFCs
|
||||||
@ -86,6 +86,7 @@
|
|||||||
#define RPL_NOTOPIC "331" // determine the channel topic, one of two
|
#define RPL_NOTOPIC "331" // determine the channel topic, one of two
|
||||||
#define RPL_TOPIC "332" // replies is sent. If the topic is set,
|
#define RPL_TOPIC "332" // replies is sent. If the topic is set,
|
||||||
// RPL_TOPIC is sent back else RPL_NOTOPIC.
|
// RPL_TOPIC is sent back else RPL_NOTOPIC.
|
||||||
|
// ... we also employ "333" for delivering author and timestamp
|
||||||
|
|
||||||
#define RPL_INVITING "341" // Returned by the server to indicate that
|
#define RPL_INVITING "341" // Returned by the server to indicate that
|
||||||
// the attempted INVITE message was
|
// the attempted INVITE message was
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: server.c,v 1.85 2007/11/27 16:13:41 lynx Exp $ // vim:syntax=lpc
|
// $Id: server.c,v 1.86 2008/10/16 13:07:13 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// IRC protocol receptionist
|
// IRC protocol receptionist
|
||||||
//
|
//
|
||||||
@ -41,6 +41,7 @@ parse(a) {
|
|||||||
if (ME) next_input_to(#'parse);
|
if (ME) next_input_to(#'parse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// allow for nickserv syntax somehow?
|
||||||
promptForPassword() {
|
promptForPassword() {
|
||||||
// string me;
|
// string me;
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// $Id: user.c,v 1.552 2008/04/11 10:37:25 lynx Exp $ // vim:syntax=lpc
|
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||||
|
// $Id: user.c,v 1.565 2008/10/01 10:59:47 lynx Exp $
|
||||||
//
|
//
|
||||||
// server-side handler for a logged in IRC client
|
// server-side handler for a logged in IRC client
|
||||||
//
|
//
|
||||||
@ -36,14 +37,14 @@ msg(source, mc, data, mapping vars, showingLog) {
|
|||||||
int special;
|
int special;
|
||||||
mixed a, res;
|
mixed a, res;
|
||||||
|
|
||||||
#ifdef PREFIXES
|
#ifdef PREFIXES //{{{
|
||||||
//ob das folgende so klug ist müssen wir (ich?) noch ergründen.
|
//ob das folgende so klug ist müssen wir (ich?) noch ergründen.
|
||||||
//aber da es temporär eh nicht genutzt wird...
|
//aber da es temporär eh nicht genutzt wird...
|
||||||
//bis dahin erstmal jedesmal löschen.
|
//bis dahin erstmal jedesmal löschen.
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
prefix = 0;
|
prefix = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif //}}}
|
||||||
P4(("irc:msg (%O,%s,%O,%O)\n", source, mc, data, vars))
|
P4(("irc:msg (%O,%s,%O,%O)\n", source, mc, data, vars))
|
||||||
P2(("irc:msg (%O,%s,%O..)\n", source, mc, data))
|
P2(("irc:msg (%O,%s,%O..)\n", source, mc, data))
|
||||||
|
|
||||||
@ -88,11 +89,11 @@ msg(source, mc, data, mapping vars, showingLog) {
|
|||||||
// this is partly a hack for a more generic 512-byte-length problem
|
// this is partly a hack for a more generic 512-byte-length problem
|
||||||
// but we need a #366 end of names...
|
// but we need a #366 end of names...
|
||||||
// maybe call ::msg and then return writing the 366
|
// maybe call ::msg and then return writing the 366
|
||||||
#ifdef ENTER_MEMBERS
|
#ifdef ENTER_MEMBERS //{{{
|
||||||
if (mc == "_status_place_members")
|
if (mc == "_status_place_members")
|
||||||
return _status_place_members(source, mc, data, vars);
|
return _status_place_members(source, mc, data, vars);
|
||||||
else
|
else
|
||||||
#endif
|
#endif //}}}
|
||||||
if (mc == "_message_announcement") {
|
if (mc == "_message_announcement") {
|
||||||
// what about not checking for _context and using ::msg() or even
|
// what about not checking for _context and using ::msg() or even
|
||||||
// w()?
|
// w()?
|
||||||
@ -113,7 +114,6 @@ msg(source, mc, data, mapping vars, showingLog) {
|
|||||||
static int namreply(mapping vars) {
|
static int namreply(mapping vars) {
|
||||||
mixed u;
|
mixed u;
|
||||||
|
|
||||||
#ifdef NOT_EXPERIMENTAL
|
|
||||||
// TODO: control == silent ist eigentlich nicht richtig,
|
// TODO: control == silent ist eigentlich nicht richtig,
|
||||||
// control == keine join/part waere richtiger
|
// control == keine join/part waere richtiger
|
||||||
// && vars["_control"] != "silent"
|
// && vars["_control"] != "silent"
|
||||||
@ -137,7 +137,7 @@ static int namreply(mapping vars) {
|
|||||||
// normal behaviour, when _amount is sent instead of _list
|
// normal behaviour, when _amount is sent instead of _list
|
||||||
// w/o is american for without ;)
|
// w/o is american for without ;)
|
||||||
P3(("Empty or anonymous channel: %O w/o _list_members\n",
|
P3(("Empty or anonymous channel: %O w/o _list_members\n",
|
||||||
mc))
|
vars["_nick_place"]))
|
||||||
}
|
}
|
||||||
// this code is all weirdly redundant with net/user.c
|
// this code is all weirdly redundant with net/user.c
|
||||||
// doing renderMembers itself in some cases, in some not -
|
// doing renderMembers itself in some cases, in some not -
|
||||||
@ -148,18 +148,6 @@ static int namreply(mapping vars) {
|
|||||||
"_members" : u,
|
"_members" : u,
|
||||||
"_nick_me" : MYNICK ]) );
|
"_nick_me" : MYNICK ]) );
|
||||||
render("_status_place_members_end", 0, vars);
|
render("_status_place_members_end", 0, vars);
|
||||||
#else
|
|
||||||
if (pointerp(vars["_list_members_nicks"])) {
|
|
||||||
u = implode(vars["_list_members_nicks"], " "); // _tab
|
|
||||||
# ifdef _flag_encode_uniforms_IRC
|
|
||||||
u = uniform2irc(u);
|
|
||||||
# endif
|
|
||||||
w("_status_place_members", 0, ([
|
|
||||||
"_nick_place" : vars["_nick_place"],
|
|
||||||
"_members" : u ]) );
|
|
||||||
}
|
|
||||||
w("_status_place_members_end", 0, vars);
|
|
||||||
#endif
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,17 +238,17 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
|
|
||||||
P3(("%O: irc:w(%O, %O, %O, %O) %O\n", ME, mc, data, 0, source, vars))
|
P3(("%O: irc:w(%O, %O, %O, %O) %O\n", ME, mc, data, 0, source, vars))
|
||||||
|
|
||||||
#ifdef PREFIXES
|
#ifdef PREFIXES //{{{
|
||||||
// completely skip these methods.. sagt fippo.. na ob das richtig ist!?
|
// completely skip these methods.. sagt fippo.. na ob das richtig ist!?
|
||||||
if (abbrev("_prefix", mc)) return 1;
|
if (abbrev("_prefix", mc)) return 1;
|
||||||
#endif
|
#endif //}}}
|
||||||
|
|
||||||
#ifndef GHOST
|
#ifndef GHOST
|
||||||
// should it be..?
|
// should it be..?
|
||||||
//unless (ONLINE) return;
|
//unless (ONLINE) return;
|
||||||
unless (interactive(ME)) return;
|
unless (interactive(ME)) return;
|
||||||
#endif
|
#endif
|
||||||
#ifdef VARS_IS_SACRED
|
#ifdef VARS_IS_SACRED //{{{
|
||||||
// "VARS_IS_SACRED" bedeutet dass *kein* copy gemacht wurde und
|
// "VARS_IS_SACRED" bedeutet dass *kein* copy gemacht wurde und
|
||||||
// man deshalb hier paranoid sein muss. der normalfall ist, dass
|
// man deshalb hier paranoid sein muss. der normalfall ist, dass
|
||||||
// der raum uns ne kopie gibt.. ist auch gut so, denn der irc code
|
// der raum uns ne kopie gibt.. ist auch gut so, denn der irc code
|
||||||
@ -273,7 +261,7 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
// konnten ist mir ein rätsel.. aber ich habs mit eigenen augen
|
// konnten ist mir ein rätsel.. aber ich habs mit eigenen augen
|
||||||
// gesehen.. ich kopiers sogar nach /ve/data/damaged-rendezvous.o
|
// gesehen.. ich kopiers sogar nach /ve/data/damaged-rendezvous.o
|
||||||
// ah.. der neue foreach code im place ist schuld
|
// ah.. der neue foreach code im place ist schuld
|
||||||
#else
|
#else //}}}
|
||||||
unless (mappingp(vars)) vars = ([]);
|
unless (mappingp(vars)) vars = ([]);
|
||||||
#endif
|
#endif
|
||||||
if (trail("_important", mc)) {
|
if (trail("_important", mc)) {
|
||||||
@ -327,7 +315,7 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
return ::wAction(mc, data, vars
|
return ::wAction(mc, data, vars
|
||||||
+ ([ "_action" : T("_TEXT_action_says", 0) ]),
|
+ ([ "_action" : T("_TEXT_action_says", 0) ]),
|
||||||
source, "", vars["_nick"]);
|
source, "", vars["_nick"]);
|
||||||
#ifdef OLD_LOCAL_NICK_PLAIN_TEXTDB_HACK
|
#ifdef OLD_LOCAL_NICK_PLAIN_TEXTDB_HACK //{{{
|
||||||
else if (vars["_nick_local"]) { // less work
|
else if (vars["_nick_local"]) { // less work
|
||||||
if (mc == "_message_echo_public_action"
|
if (mc == "_message_echo_public_action"
|
||||||
&& (t = vars["_INTERNAL_nick_plain"])) {
|
&& (t = vars["_INTERNAL_nick_plain"])) {
|
||||||
@ -343,7 +331,7 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
sTextPath(0, v("language"), v("scheme"));
|
sTextPath(0, v("language"), v("scheme"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else //}}}
|
||||||
else if (vars["_nick_local"] &&
|
else if (vars["_nick_local"] &&
|
||||||
vars["_nick_local"] == vars["_nick"])
|
vars["_nick_local"] == vars["_nick"])
|
||||||
vars["_nick"] = vars["_INTERNAL_nick_plain"] || vars["_nick_verbatim"];
|
vars["_nick"] = vars["_INTERNAL_nick_plain"] || vars["_nick_verbatim"];
|
||||||
@ -394,11 +382,12 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
|| abbrev(query_server_unl() +"~", source)
|
|| abbrev(query_server_unl() +"~", source)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
#ifdef GHOST
|
#ifdef GHOST //{{{
|
||||||
// in S2S mode we are not supposed to deliver nick!user@host
|
// in S2S mode we are not supposed to deliver nick!user@host
|
||||||
// thus we use plain nicks or plain uniforms
|
// thus we use plain nicks or plain uniforms
|
||||||
vars["_source_hack"] = vars["_INTERNAL_nick_plain"] || vars["_nick"];
|
vars["_source_hack"] = vars["_INTERNAL_nick_plain"] || vars["_nick"];
|
||||||
#else
|
#else //}}}
|
||||||
|
# if 0 // OLD // according to elmex "should never happen" happened...
|
||||||
if (vars["_nick"]) {
|
if (vars["_nick"]) {
|
||||||
vars["_source_hack"] =
|
vars["_source_hack"] =
|
||||||
(vars["_INTERNAL_nick_plain"] || vars["_nick"])
|
(vars["_INTERNAL_nick_plain"] || vars["_nick"])
|
||||||
@ -407,15 +396,22 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
+"@" SERVER_HOST;
|
+"@" SERVER_HOST;
|
||||||
} else // should never happen
|
} else // should never happen
|
||||||
vars["_source_hack"] = to_string(source);
|
vars["_source_hack"] = to_string(source);
|
||||||
|
# else // EXPERIMENTAL
|
||||||
|
nick2 = vars["_INTERNAL_nick_plain"] || vars["_nick"];
|
||||||
|
vars["_source_hack"] = nick2 ? nick2
|
||||||
|
+"!"+ (vars["_nick_long"] || vars["_INTERNAL_nick_plain"]
|
||||||
|
|| vars["_nick"]) +"@" SERVER_HOST
|
||||||
|
: to_string(source); // should never happen
|
||||||
|
# endif
|
||||||
} else if (abbrev("_echo_place_enter", mc)) {
|
} else if (abbrev("_echo_place_enter", mc)) {
|
||||||
vars["_source_hack"] = MYNICK + "!" + MYNICK + "@" SERVER_HOST;
|
vars["_source_hack"] = MYNICK + "!" + MYNICK + "@" SERVER_HOST;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#ifdef GHOST
|
#ifdef GHOST //{{{
|
||||||
// in S2S mode we are not supposed to deliver nick!user@host
|
// in S2S mode we are not supposed to deliver nick!user@host
|
||||||
// thus we use plain nicks or plain uniforms
|
// thus we use plain nicks or plain uniforms
|
||||||
vars["_source_hack"] = source;
|
vars["_source_hack"] = source;
|
||||||
#else
|
#else //}}}
|
||||||
u = parse_uniform(source);
|
u = parse_uniform(source);
|
||||||
unless (u) {
|
unless (u) {
|
||||||
// this happens when a user@host notation gets here..
|
// this happens when a user@host notation gets here..
|
||||||
@ -431,8 +427,7 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
nick2 = raliases[source];
|
nick2 = raliases[source];
|
||||||
vars["_source_hack"] = nick2 + ((u[UUser] ||
|
vars["_source_hack"] = nick2 + ((u[UUser] ||
|
||||||
(u[UResource] && u[UResource][0]))
|
(u[UResource] && u[UResource][0]))
|
||||||
? "!" + (u[UUser] || u[UResource][1..])
|
? "!"+ UName(u) +"@"+ u[UHost]
|
||||||
+ "@" + u[UHost]
|
|
||||||
: "!"+ (vars["_nick_long"] || vars["_INTERNAL_nick_plain"]
|
: "!"+ (vars["_nick_long"] || vars["_INTERNAL_nick_plain"]
|
||||||
|| vars["_nick"])
|
|| vars["_nick"])
|
||||||
+"@alias.undefined");
|
+"@alias.undefined");
|
||||||
@ -444,10 +439,10 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
case "psyc":
|
case "psyc":
|
||||||
if (u[UUser] || (u[UResource] && strlen(u[UResource])
|
if (u[UUser] || (u[UResource] && strlen(u[UResource])
|
||||||
&& u[UResource][0] == '~')) {
|
&& u[UResource][0] == '~')) {
|
||||||
|
string tmp = UName(u);
|
||||||
vars["_source_hack"] = u[UScheme] + "://"
|
vars["_source_hack"] = u[UScheme] + "://"
|
||||||
+ u[UHostPort] + "/~" + (u[UUser] || u[UResource][1..])
|
+ u[UHostPort] +"/~"+ tmp +"!"+ tmp +"@"
|
||||||
+ "!" + (u[UUser] || u [UResource][1..]) + "@"
|
+ u[UHostPort];
|
||||||
+ u[UHostPort];
|
|
||||||
P4(("w:psyc _source_hack %O\n", vars["_source_hack"]))
|
P4(("w:psyc _source_hack %O\n", vars["_source_hack"]))
|
||||||
} else {
|
} else {
|
||||||
vars["_source_hack"] = uniform2irc(source)
|
vars["_source_hack"] = uniform2irc(source)
|
||||||
@ -508,7 +503,7 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
output[<2] = 0x01;
|
output[<2] = 0x01;
|
||||||
emit(output);
|
emit(output);
|
||||||
return 1;
|
return 1;
|
||||||
# ifdef IRC_FRIENDCHANNEL
|
# ifdef IRC_FRIENDCHANNEL //{{{
|
||||||
} else {
|
} else {
|
||||||
# ifdef IRC_FRIENDCHANNEL_HEREAWAY
|
# ifdef IRC_FRIENDCHANNEL_HEREAWAY
|
||||||
string old = vars["_degree_availability_old"];
|
string old = vars["_degree_availability_old"];
|
||||||
@ -539,14 +534,14 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
else
|
else
|
||||||
emit(":"+ SERVER_HOST +" MODE & -v-o "+ vars["_nick"] +"\n");
|
emit(":"+ SERVER_HOST +" MODE & -v-o "+ vars["_nick"] +"\n");
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif //}}}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
# endif
|
# endif
|
||||||
P2(("irc/user:w(%O,%O,..,%O)\n", mc, data, source))
|
P2(("irc/user:w(%O,%O,..,%O)\n", mc, data, source))
|
||||||
t = 0;
|
t = 0;
|
||||||
PSYC_TRY(mc) {
|
PSYC_TRY(mc) {
|
||||||
#ifdef IRC_FRIENDCHANNEL
|
#ifdef IRC_FRIENDCHANNEL //{{{
|
||||||
case "_list_friends_offline": // _tab
|
case "_list_friends_offline": // _tab
|
||||||
t = " "; // fall thru
|
t = " "; // fall thru
|
||||||
case "_list_friends_away": // _tab
|
case "_list_friends_away": // _tab
|
||||||
@ -587,7 +582,13 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
reply(RPL_ENDOFNAMES, "& :End of Buddylist.");
|
reply(RPL_ENDOFNAMES, "& :End of Buddylist.");
|
||||||
# endif
|
# endif
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif //}}}
|
||||||
|
case "_status_place_topic":
|
||||||
|
// traditional IRC topic message without author
|
||||||
|
render(mc +"_only", 0, vars);
|
||||||
|
// extra semi-official '333' code containing author and time
|
||||||
|
render(mc +"_author", 0, vars);
|
||||||
|
return 1;
|
||||||
case "_status_place_members_automatic":
|
case "_status_place_members_automatic":
|
||||||
mc = "_status_place_members"; // fall thru
|
mc = "_status_place_members"; // fall thru
|
||||||
case "_status_place_members":
|
case "_status_place_members":
|
||||||
@ -684,13 +685,13 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
"_nick_new" : vars["_alias"] ])) + "\n");
|
"_nick_new" : vars["_alias"] ])) + "\n");
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef ENTER_MEMBERS //{{{
|
||||||
// now obsolete since net/user does the rendering of _list_members
|
// now obsolete since net/user does the rendering of _list_members
|
||||||
// and converts it to _status_members* w()
|
// and converts it to _status_members* w()
|
||||||
#ifdef ENTER_MEMBERS
|
|
||||||
case "_echo_place_enter":
|
case "_echo_place_enter":
|
||||||
namreply(vars);
|
namreply(vars);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif //}}}
|
||||||
case "_message_public":
|
case "_message_public":
|
||||||
case "_message":
|
case "_message":
|
||||||
case "_notice_place_leave":
|
case "_notice_place_leave":
|
||||||
@ -741,29 +742,25 @@ wAction(mc, data, vars, source, variant, nick) {
|
|||||||
return ::wAction(mc, data, vars, source, variant, nick);
|
return ::wAction(mc, data, vars, source, variant, nick);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HISTORY_AMOUNT
|
#ifndef _limit_amount_history_place_default
|
||||||
# define HISTORY_AMOUNT 5
|
# define _limit_amount_history_place_default 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// irc has it's own autojoin, which is a little different from others
|
// irc has it's own autojoin, which is a little different from others
|
||||||
autojoin() {
|
autojoin() {
|
||||||
#ifndef GHOST // too tricky for now
|
#if !defined(_flag_disable_place_enter_automatic) && !defined(GHOST) // too tricky for now
|
||||||
mixed t, t2;
|
mixed t, t2;
|
||||||
#if 0 //def DRIVER_HAS_SMALL_BUFFER
|
|
||||||
int delay;
|
|
||||||
#endif
|
|
||||||
string s;
|
string s;
|
||||||
|
|
||||||
if (isService) return -1;
|
if (isService) return -1;
|
||||||
|
# ifndef GAMMA
|
||||||
unless (v("place"))
|
unless (v("place"))
|
||||||
vSet("place", T("_MISC_defplace", DEFPLACE));
|
vSet("place", T("_MISC_defplace", DEFPLACE));
|
||||||
|
# endif
|
||||||
// subscriptions are stored in lowercase, warum auch immer
|
// subscriptions are stored in lowercase, warum auch immer
|
||||||
if (sizeof(v("subscriptions")))
|
if (sizeof(v("subscriptions")))
|
||||||
foreach (s in v("subscriptions")) {
|
foreach (s in v("subscriptions")) {
|
||||||
#if 0 //def DRIVER_HAS_SMALL_BUFFER
|
// call_out(#'placeRequest, delay++, s, "_request_enter", //_automatic_subscription
|
||||||
call_out(#'placeRequest, delay++, s, "_request_enter", //_automatic_subscription
|
|
||||||
0, 0, ([ "_amount_history" : HISTORY_AMOUNT ]));
|
|
||||||
#else
|
|
||||||
placeRequest(s,
|
placeRequest(s,
|
||||||
# ifdef SPEC
|
# ifdef SPEC
|
||||||
"_request_context_enter"
|
"_request_context_enter"
|
||||||
@ -771,32 +768,33 @@ autojoin() {
|
|||||||
"_request_enter"
|
"_request_enter"
|
||||||
# endif
|
# endif
|
||||||
, // _automatic_subscription
|
, // _automatic_subscription
|
||||||
0, 0, ([ "_amount_history" : HISTORY_AMOUNT ]));
|
0, 0, ([ "_amount_history" : _limit_amount_history_place_default ]));
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
#if 0 //def DRIVER_HAS_SMALL_BUFFER
|
# ifdef GAMMA
|
||||||
call_out(#'placeRequest, delay++, v("place"), "_request_enter_login",
|
unless (v("place"))
|
||||||
0, 0, ([ "_amount_history" : HISTORY_AMOUNT ]));
|
vSet("place", T("_MISC_defplace", DEFPLACE));
|
||||||
#else
|
|
||||||
placeRequest(v("place"),
|
|
||||||
# ifdef SPEC
|
|
||||||
"_request_context_enter"
|
|
||||||
# else
|
|
||||||
"_request_enter"
|
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef _flag_disable_place_default
|
||||||
|
// call_out(#'placeRequest, delay++, v("place"), ...
|
||||||
|
placeRequest(v("place"),
|
||||||
|
# ifdef SPEC
|
||||||
|
"_request_context_enter"
|
||||||
|
# else
|
||||||
|
"_request_enter"
|
||||||
|
# endif
|
||||||
"_login", 0, 0,
|
"_login", 0, 0,
|
||||||
([ "_amount_history" : HISTORY_AMOUNT ]));
|
([ "_amount_history" : _limit_amount_history_place_default ]));
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
#ifdef IRC_FRIENDCHANNEL
|
# ifdef IRC_FRIENDCHANNEL //{{{
|
||||||
# ifdef IRC_FRIENDCHANNEL_HEREAWAY
|
# ifdef IRC_FRIENDCHANNEL_HEREAWAY
|
||||||
emit(":"+ MYNICK +" JOIN :&HERE\n");
|
emit(":"+ MYNICK +" JOIN :&HERE\n");
|
||||||
emit(":"+ MYNICK +" JOIN :&AWAY\n");
|
emit(":"+ MYNICK +" JOIN :&AWAY\n");
|
||||||
# else
|
# else
|
||||||
emit(":"+ MYNICK +" JOIN :&\n");
|
emit(":"+ MYNICK +" JOIN :&\n");
|
||||||
# endif
|
# endif
|
||||||
#endif
|
# endif //}}}
|
||||||
#endif
|
#endif // GHOST || _flag_disable_place_enter_automatic
|
||||||
}
|
}
|
||||||
|
|
||||||
logon() {
|
logon() {
|
||||||
@ -812,6 +810,13 @@ logon() {
|
|||||||
// vDel("agent"); -- either you start a ctcp to find it out
|
// vDel("agent"); -- either you start a ctcp to find it out
|
||||||
// or we prefer to have the old info
|
// or we prefer to have the old info
|
||||||
vDel("query"); // server-side query would drive most ircers crazy
|
vDel("query"); // server-side query would drive most ircers crazy
|
||||||
|
#if 0
|
||||||
|
// what's wrong with doing this.. here?
|
||||||
|
// it's redundant, as it happens again in ::logon
|
||||||
|
sTextPath(0, v("language"), v("scheme"));
|
||||||
|
// it's necessary for _request_user_amount to work
|
||||||
|
// let's see if we can simply postpone that to after ::logon
|
||||||
|
#endif
|
||||||
//
|
//
|
||||||
// this helps handle the /set visiblespeakaction setting if this
|
// this helps handle the /set visiblespeakaction setting if this
|
||||||
// define has changed
|
// define has changed
|
||||||
@ -863,11 +868,22 @@ logon() {
|
|||||||
// SILENCE: ach und ich weiss nicht ob /quote silence bzw /silence den psyced befehl silence aufruft, aber imo sollte er das aus verwirrungs-vermeidungs-gruenden nicht tun. silence im irc ist serverseitiges ignore.
|
// SILENCE: ach und ich weiss nicht ob /quote silence bzw /silence den psyced befehl silence aufruft, aber imo sollte er das aus verwirrungs-vermeidungs-gruenden nicht tun. silence im irc ist serverseitiges ignore.
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef BETA
|
||||||
lusers();
|
lusers();
|
||||||
|
# endif
|
||||||
motd();
|
motd();
|
||||||
rc = ::logon();
|
rc = ::logon();
|
||||||
// we have to do this after logon, or the textdb will fail
|
// the following things happen after logon, because the textdb isn't
|
||||||
# ifndef NO_IRC_AUTO_REQUEST_VERSION
|
// available earlier. if this order of things is not acceptable, then
|
||||||
|
// we have to run sTextPath twice (see above)
|
||||||
|
# ifdef BETA
|
||||||
|
# ifndef _flag_disable_query_server
|
||||||
|
sendmsg("/", "_request_user_amount", 0, ([]));
|
||||||
|
// reply.h says RPL_LUSERME is mandatory.. huh.. FIXME?
|
||||||
|
// #255 [_nick_me] :I have 4404 clients and 4404 servers
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# ifndef _flag_disable_request_version_IRC
|
||||||
// since we cannot relay tagged version requests to the client
|
// since we cannot relay tagged version requests to the client
|
||||||
// easily, we request the version number once at starting time.
|
// easily, we request the version number once at starting time.
|
||||||
// any other protocol finds it completely normal to exchange
|
// any other protocol finds it completely normal to exchange
|
||||||
@ -995,6 +1011,7 @@ case "mode":
|
|||||||
return 1;
|
return 1;
|
||||||
case "topic":
|
case "topic":
|
||||||
unless (args && strlen(args)) return;
|
unless (args && strlen(args)) return;
|
||||||
|
P4(("IRC topic %O %O\n", args, text))
|
||||||
unless (t = channel2place(args)) return;
|
unless (t = channel2place(args)) return;
|
||||||
t = find_place(t) || t;
|
t = find_place(t) || t;
|
||||||
// The topic for channel <channel> is returned if there is
|
// The topic for channel <channel> is returned if there is
|
||||||
@ -1022,16 +1039,30 @@ case "user":
|
|||||||
vSet("mottotext", text);
|
vSet("mottotext", text);
|
||||||
return 1;
|
return 1;
|
||||||
case "invite":
|
case "invite":
|
||||||
sscanf(args, "%s #%s", n, t);
|
if (sscanf(args, "%s #%s", n, t) && strlen(t)) {
|
||||||
// t = channel2place(t) || t;
|
t2 = find_place(t);
|
||||||
vSet("place", t);
|
if (!t2 || !places[t2]) {
|
||||||
place = find_place(t);
|
PT(("irc: invite %s into %s = %O.\n", n, t, t2))
|
||||||
P2(("irc: invite %s into %s = %O\n", n, t, place))
|
w("_error_necessary_membership",
|
||||||
if (invite(n)) {
|
0, ([ "_nick_place": t ]));
|
||||||
// room should send this if successful or
|
return 1;
|
||||||
// ERR_USERONCHANNEL or ERR_CHANOPRIVSNEEDED otherwise?
|
}
|
||||||
reply(RPL_INVITING, args);
|
vSet("place", t);
|
||||||
|
place = t2;
|
||||||
|
} else {
|
||||||
|
#if 0
|
||||||
|
// atypical: allow for invite using current place.
|
||||||
|
n = args;
|
||||||
|
// runs the risk of you inviting the person to the
|
||||||
|
// wrong channel. too risky. let's go traditional:
|
||||||
|
#else
|
||||||
|
reply(ERR_NEEDMOREPARAMS,
|
||||||
|
"INVITE :Not enough parameters");
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
if (invite(n)) reply(RPL_INVITING, args);
|
||||||
|
// else: ERR_USERONCHANNEL or ERR_CHANOPRIVSNEEDED otherwise?
|
||||||
return 1;
|
return 1;
|
||||||
case "join":
|
case "join":
|
||||||
case "part":
|
case "part":
|
||||||
@ -1153,7 +1184,7 @@ static privmsg(args, text, req) {
|
|||||||
|
|
||||||
unless (stringp(text) && strlen(text)) return;
|
unless (stringp(text) && strlen(text)) return;
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL
|
#ifdef GAMMA
|
||||||
// fippoism typing indicator.. but shouldn't it *do* something
|
// fippoism typing indicator.. but shouldn't it *do* something
|
||||||
// after detecting this CTCP-like "typing" flag hack?
|
// after detecting this CTCP-like "typing" flag hack?
|
||||||
if (strlen(text) > 1 && text[<1] == 0x0f && text[<2] == 0x0f) {
|
if (strlen(text) > 1 && text[<1] == 0x0f && text[<2] == 0x0f) {
|
||||||
@ -1161,9 +1192,9 @@ static privmsg(args, text, req) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (index(args, ',') > 0) {
|
if (index(args, ',') > 0) {
|
||||||
w("_failure_unsupported_targets_multiple",
|
w("_failure_unsupported_targets_multiple",
|
||||||
"We do not allow sending to several recipients at once. Why did your client ignore our MAXTARGETS=1 directive?");
|
"We do not allow sending to several recipients at once. Why did your client ignore our MAXTARGETS=1 directive?");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (room = channel2place(args)) {
|
if (room = channel2place(args)) {
|
||||||
if (!place || !v("place") || stricmp(room, v("place"))) {
|
if (!place || !v("place") || stricmp(room, v("place"))) {
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
// $Id: active.c,v 1.395 2008/04/01 09:38:26 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: active.c,v 1.404 2008/10/26 17:24:57 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
|
|
||||||
#include <net.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <url.h>
|
|
||||||
|
|
||||||
// a jabber thing which actively connects something
|
// a jabber thing which actively connects something
|
||||||
#define NO_INHERIT
|
#define NO_INHERIT
|
||||||
#include "jabber.h"
|
#include "jabber.h"
|
||||||
#undef NO_INHERIT
|
#undef NO_INHERIT
|
||||||
|
#include <url.h>
|
||||||
|
|
||||||
#ifdef ERQ_WITHOUT_SRV
|
#ifdef ERQ_WITHOUT_SRV
|
||||||
# define hostname host // hostname contains the name before SRV resolution
|
# define hostname host // hostname contains the name before SRV resolution
|
||||||
@ -39,9 +36,9 @@ volatile int dialback_outgoing;
|
|||||||
|
|
||||||
tls_logon(); // prototype
|
tls_logon(); // prototype
|
||||||
|
|
||||||
#ifdef NOT_EXPERIMENTAL // not strictly necessary, but more spec conformant
|
// not strictly necessary, but more spec conformant
|
||||||
quit() {
|
quit() {
|
||||||
emit("</stream:stream>");
|
emitraw("</stream:stream>");
|
||||||
#ifdef _flag_log_sockets_XMPP
|
#ifdef _flag_log_sockets_XMPP
|
||||||
D0( log_file("RAW_XMPP", "\n%O: shutting down, quit called\n", ME); )
|
D0( log_file("RAW_XMPP", "\n%O: shutting down, quit called\n", ME); )
|
||||||
#endif
|
#endif
|
||||||
@ -49,7 +46,6 @@ quit() {
|
|||||||
// matter on an outgoing-only socket
|
// matter on an outgoing-only socket
|
||||||
//destruct(ME);
|
//destruct(ME);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
sGateway(gw, ho, id) {
|
sGateway(gw, ho, id) {
|
||||||
// TODO: ho is obsolete
|
// TODO: ho is obsolete
|
||||||
@ -68,7 +64,7 @@ removeGateway(gw, id) {
|
|||||||
start_dialback() {
|
start_dialback() {
|
||||||
string source_host, key;
|
string source_host, key;
|
||||||
|
|
||||||
source_host = NAMEPREP(JABBER_HOST);
|
source_host = NAMEPREP(_host_XMPP);
|
||||||
key = DIALBACK_KEY(streamid, hostname, source_host);
|
key = DIALBACK_KEY(streamid, hostname, source_host);
|
||||||
|
|
||||||
P3(("%O: starting dialback from %O to %O\n", ME, source_host, hostname))
|
P3(("%O: starting dialback from %O to %O\n", ME, source_host, hostname))
|
||||||
@ -137,7 +133,7 @@ handle_stream_features(XMLNode node) {
|
|||||||
// && !config(XMPP + hostname, "_tls_invalid")
|
// && !config(XMPP + hostname, "_tls_invalid")
|
||||||
){
|
){
|
||||||
// may use tls unless we already do so
|
// may use tls unless we already do so
|
||||||
emit("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
|
emitraw("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>");
|
||||||
nodeHandler = #'handle_starttls;
|
nodeHandler = #'handle_starttls;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -177,11 +173,11 @@ handle_stream_features(XMLNode node) {
|
|||||||
#ifndef _flag_disable_authentication_external_XMPP
|
#ifndef _flag_disable_authentication_external_XMPP
|
||||||
if (mechs["EXTERNAL"]) {
|
if (mechs["EXTERNAL"]) {
|
||||||
// TODO we should check that the name in our
|
// TODO we should check that the name in our
|
||||||
// certificate is equal to JABBER_HOST
|
// certificate is equal to _host_XMPP
|
||||||
// but so should the other side!
|
// but so should the other side!
|
||||||
emit("<auth mechanism='EXTERNAL' "
|
emit("<auth mechanism='EXTERNAL' "
|
||||||
"xmlns='" NS_XMPP "xmpp-sasl'>" +
|
"xmlns='" NS_XMPP "xmpp-sasl'>" +
|
||||||
encode_base64(JABBER_HOST)
|
encode_base64(_host_XMPP)
|
||||||
+ "</auth>");
|
+ "</auth>");
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
@ -191,7 +187,7 @@ handle_stream_features(XMLNode node) {
|
|||||||
PT(("jabber/active requesting to do digest md5\n"))
|
PT(("jabber/active requesting to do digest md5\n"))
|
||||||
emit("<auth mechanism='DIGEST-MD5' "
|
emit("<auth mechanism='DIGEST-MD5' "
|
||||||
"xmlns='" NS_XMPP "xmpp-sasl>" +
|
"xmlns='" NS_XMPP "xmpp-sasl>" +
|
||||||
encode_base64(JABBER_HOST) +
|
encode_base64(_host_XMPP) +
|
||||||
"</auth>");
|
"</auth>");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -201,7 +197,7 @@ handle_stream_features(XMLNode node) {
|
|||||||
#ifdef SWITCH2PSYC
|
#ifdef SWITCH2PSYC
|
||||||
else if (node["/switch"]) { // should check scheme
|
else if (node["/switch"]) { // should check scheme
|
||||||
PT(("upgrading %O from XMPP to PSYC.\n", ME))
|
PT(("upgrading %O from XMPP to PSYC.\n", ME))
|
||||||
emit("<switching xmlns='http://switch.psyced.org'>"
|
emitraw("<switching xmlns='http://switch.psyced.org'>"
|
||||||
"<scheme>psyc</scheme>"
|
"<scheme>psyc</scheme>"
|
||||||
"</switching>");
|
"</switching>");
|
||||||
return;
|
return;
|
||||||
@ -235,6 +231,11 @@ disconnected(remainder) {
|
|||||||
// nothing else happening here? no reconnect?
|
// nothing else happening here? no reconnect?
|
||||||
// TODO: what about the dialback Q if any?
|
// TODO: what about the dialback Q if any?
|
||||||
::disconnected(remainder);
|
::disconnected(remainder);
|
||||||
|
// let's call this a special case of good will:
|
||||||
|
// hopefully a sending side socket close operation
|
||||||
|
if (remainder == "</stream:stream>") return 1;
|
||||||
|
// we could forward remainder to feed(), but we haven't seen any other
|
||||||
|
// cases of content than the one above.
|
||||||
return flags & TCP_PENDING_DISCONNECT;
|
return flags & TCP_PENDING_DISCONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,18 +260,20 @@ static int logon(int failure) {
|
|||||||
emit("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "
|
emit("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "
|
||||||
"xmlns='jabber:server' xmlns:db='jabber:server:dialback' "
|
"xmlns='jabber:server' xmlns:db='jabber:server:dialback' "
|
||||||
"to='" + hostname + "' "
|
"to='" + hostname + "' "
|
||||||
"from='" + NAMEPREP(JABBER_HOST) + "' "
|
"from='" + NAMEPREP(_host_XMPP) + "' "
|
||||||
"xml:lang='en' "
|
"xml:lang='en' "
|
||||||
"version='1.0'>");
|
"version='1.0'>");
|
||||||
#ifdef NOT_EXPERIMENTAL // not strictly necessary, but more spec conformant
|
#if 1 // not strictly necessary, but more spec conformant
|
||||||
} else if (!qSize(me)) { // no retry for dialback-only
|
} else if (!qSize(me)) { // no retry for dialback-only
|
||||||
P0(("notify gateways %O of failure\n", gateways))
|
|
||||||
if (sizeof(dialback_queue) > 1) {
|
if (sizeof(dialback_queue) > 1) {
|
||||||
P0(("tell fippo that sizeof(dialback queue) was > 1\n"))
|
P0(("tell fippo that sizeof(dialback queue) was > 1\n"))
|
||||||
}
|
}
|
||||||
foreach(string id, mixed gw : gateways) {
|
if (sizeof(gateways)) {
|
||||||
if (objectp(gw)) {
|
P0(("%O notifies gateways %O of failure\n", ME, gateways))
|
||||||
gw->remote_connection_failed();
|
foreach(string id, mixed gw : gateways) {
|
||||||
|
if (objectp(gw)) {
|
||||||
|
gw->remote_connection_failed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialback_queue = 0;
|
dialback_queue = 0;
|
||||||
@ -286,7 +289,8 @@ static int logon(int failure) {
|
|||||||
#ifdef WANT_S2S_TLS
|
#ifdef WANT_S2S_TLS
|
||||||
tls_logon(result) {
|
tls_logon(result) {
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
PT(("%O tls_logon %d\n", ME, result))
|
P1(("%O tls_logon %d: %O\n", ME, result, tls_error(result) ))
|
||||||
|
// would be nice to insert the tls_error() message here.. TODO
|
||||||
connect_failure("_encrypt", "Problems setting up an encrypted circuit");
|
connect_failure("_encrypt", "Problems setting up an encrypted circuit");
|
||||||
} else if (result == 0) {
|
} else if (result == 0) {
|
||||||
// we need to check the certificate
|
// we need to check the certificate
|
||||||
@ -304,12 +308,12 @@ tls_logon(result) {
|
|||||||
"contains %O/%O",
|
"contains %O/%O",
|
||||||
hostname, cert["2.5.4.3"],
|
hostname, cert["2.5.4.3"],
|
||||||
cert["2.5.29.17:1.3.6.1.5.5.7.8.5"]));
|
cert["2.5.29.17:1.3.6.1.5.5.7.8.5"]));
|
||||||
#else
|
|
||||||
P1(("TLS: %s presented a certificate with unexpected identity.\n", hostname))
|
|
||||||
P2(("%O\n", cert))
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef _flag_log_bogus_certificates
|
#ifdef _flag_log_bogus_certificates
|
||||||
log_file("CERTS", S("%O %O %O id?\n", ME, hostname, cert));
|
log_file("CERTS", S("%O %O %O id?\n", ME, hostname, cert));
|
||||||
|
#else
|
||||||
|
P1(("TLS: %s presented a certificate with unexpected identity.\n", hostname))
|
||||||
|
P2(("%O\n", cert))
|
||||||
#endif
|
#endif
|
||||||
#if 0 //def _flag_reject_bogus_certificates
|
#if 0 //def _flag_reject_bogus_certificates
|
||||||
QUIT
|
QUIT
|
||||||
@ -321,12 +325,12 @@ tls_logon(result) {
|
|||||||
monitor_report("_error_untrusted_certificate",
|
monitor_report("_error_untrusted_certificate",
|
||||||
sprintf("%O certificate could not be verified",
|
sprintf("%O certificate could not be verified",
|
||||||
hostname));
|
hostname));
|
||||||
#else
|
|
||||||
P1(("TLS: %s presented untrusted certificate.\n", hostname))
|
|
||||||
P2(("%O\n", cert))
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef _flag_log_bogus_certificates
|
#ifdef _flag_log_bogus_certificates
|
||||||
log_file("CERTS", S("%O %O %O\n", ME, hostname, cert));
|
log_file("CERTS", S("%O %O %O\n", ME, hostname, cert));
|
||||||
|
#else
|
||||||
|
P1(("TLS: %s presented untrusted certificate.\n", hostname))
|
||||||
|
P2(("%O\n", cert))
|
||||||
#endif
|
#endif
|
||||||
#if 0 //def _flag_reject_bogus_certificates
|
#if 0 //def _flag_reject_bogus_certificates
|
||||||
// QUIT is wrong...
|
// QUIT is wrong...
|
||||||
@ -375,7 +379,7 @@ jabberMsg(XMLNode node) {
|
|||||||
* Server MUST terminate both the XML stream and the
|
* Server MUST terminate both the XML stream and the
|
||||||
* underlying TCP connection.
|
* underlying TCP connection.
|
||||||
*/
|
*/
|
||||||
emit("</stream:stream>");
|
emitraw("</stream:stream>");
|
||||||
remove_interactive(ME);
|
remove_interactive(ME);
|
||||||
connect_failure("_dialback", "dialback gone wrong");
|
connect_failure("_dialback", "dialback gone wrong");
|
||||||
}
|
}
|
||||||
@ -390,7 +394,7 @@ jabberMsg(XMLNode node) {
|
|||||||
node["@type"]);
|
node["@type"]);
|
||||||
// probably we can delete this...
|
// probably we can delete this...
|
||||||
m_delete(gateways, t);
|
m_delete(gateways, t);
|
||||||
#ifdef NOT_EXPERIMENTAL // not strictly necessary, but more spec conformant
|
#if 1 // not strictly necessary, but more spec conformant
|
||||||
} else if (member(gateways, t)) {
|
} else if (member(gateways, t)) {
|
||||||
P0(("%O found gateway for %O, but it is not an object: %O\n",
|
P0(("%O found gateway for %O, but it is not an object: %O\n",
|
||||||
ME, t, o))
|
ME, t, o))
|
||||||
@ -413,7 +417,7 @@ jabberMsg(XMLNode node) {
|
|||||||
emit("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "
|
emit("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' "
|
||||||
"xmlns='jabber:server' xmlns:db='jabber:server:dialback' "
|
"xmlns='jabber:server' xmlns:db='jabber:server:dialback' "
|
||||||
"to='" + hostname + "' "
|
"to='" + hostname + "' "
|
||||||
"from='" + NAMEPREP(JABBER_HOST) + "' "
|
"from='" + NAMEPREP(_host_XMPP) + "' "
|
||||||
"xml:lang='en' "
|
"xml:lang='en' "
|
||||||
"version='1.0'>");
|
"version='1.0'>");
|
||||||
authenticated = 1;
|
authenticated = 1;
|
||||||
@ -435,7 +439,7 @@ jabberMsg(XMLNode node) {
|
|||||||
data = sasl_parse(t);
|
data = sasl_parse(t);
|
||||||
PT(("extracted %O\n", data))
|
PT(("extracted %O\n", data))
|
||||||
|
|
||||||
data["username"] = JABBER_HOST;
|
data["username"] = _host_XMPP;
|
||||||
secret = config(XMPP + hostname, "_secret_shared");
|
secret = config(XMPP + hostname, "_secret_shared");
|
||||||
unless(secret) {
|
unless(secret) {
|
||||||
// mh... this is a problem!
|
// mh... this is a problem!
|
||||||
@ -444,13 +448,13 @@ jabberMsg(XMLNode node) {
|
|||||||
}
|
}
|
||||||
data["cnonce"] = RANDHEXSTRING;
|
data["cnonce"] = RANDHEXSTRING;
|
||||||
data["nc"] = "00000001";
|
data["nc"] = "00000001";
|
||||||
data["digest-uri"] = "xmpp/" JABBER_HOST;
|
data["digest-uri"] = "xmpp/" _host_XMPP;
|
||||||
|
|
||||||
response = sasl_calculate_digestMD5(data, secret, 0);
|
response = sasl_calculate_digestMD5(data, secret, 0);
|
||||||
|
|
||||||
// ok, the username is our hostname
|
// ok, the username is our hostname
|
||||||
// note: qop must not be quoted, as we are 'client'
|
// note: qop must not be quoted, as we are 'client'
|
||||||
t = "username=\"" JABBER_HOST "\","
|
t = "username=\"" _host_XMPP "\","
|
||||||
"realm=\"" + data["realm"] + "\","
|
"realm=\"" + data["realm"] + "\","
|
||||||
"nonce=\"" + data["nonce"] + "\","
|
"nonce=\"" + data["nonce"] + "\","
|
||||||
"cnonce=\"" + data["cnonce"] + "\","
|
"cnonce=\"" + data["cnonce"] + "\","
|
||||||
@ -584,7 +588,7 @@ int msg(string source, string mc, string data,
|
|||||||
if (interactive() && ready && dialback_outgoing == 0) {
|
if (interactive() && ready && dialback_outgoing == 0) {
|
||||||
start_dialback();
|
start_dialback();
|
||||||
}
|
}
|
||||||
#if JABBER_HOST == SERVER_HOST
|
#if _host_XMPP == SERVER_HOST
|
||||||
// we can only do this if mkjid patches the psyc host into jabber host
|
// we can only do this if mkjid patches the psyc host into jabber host
|
||||||
// but that is terrifically complicated and requires parsing of things
|
// but that is terrifically complicated and requires parsing of things
|
||||||
// we already knew.. so let's simply enqueue with object id and reject
|
// we already knew.. so let's simply enqueue with object id and reject
|
||||||
@ -596,7 +600,7 @@ int msg(string source, string mc, string data,
|
|||||||
#else
|
#else
|
||||||
// is this a bad idea? not sure.. we'll see..
|
// is this a bad idea? not sure.. we'll see..
|
||||||
// if i don't have this here, a "tell lynX where it happened" will
|
// if i don't have this here, a "tell lynX where it happened" will
|
||||||
// be triggered from here -- best to never use JABBER_HOST really ;)
|
// be triggered from here -- best to never use _host_XMPP really ;)
|
||||||
vars["_source"] = source;
|
vars["_source"] = source;
|
||||||
// behaviour has changed.. so maybe we don't need this any longer TODO
|
// behaviour has changed.. so maybe we don't need this any longer TODO
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// $Id: common.c,v 1.270 2008/04/11 10:27:24 fippo Exp $ // vim:syntax=lpc:ts=8
|
// $Id: common.c,v 1.276 2008/12/01 11:31:33 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
#define NO_INHERIT
|
#define NO_INHERIT
|
||||||
#include "jabber.h"
|
#include "jabber.h"
|
||||||
#undef NO_INHERIT
|
#undef NO_INHERIT
|
||||||
#include <net.h>
|
|
||||||
|
|
||||||
|
#include <net.h>
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
//virtual inherit NET_PATH "output";
|
//virtual inherit NET_PATH "output";
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
@ -22,7 +22,7 @@ jabberMsg();
|
|||||||
inherit NET_PATH "xml/common";
|
inherit NET_PATH "xml/common";
|
||||||
|
|
||||||
volatile string buffer = "";
|
volatile string buffer = "";
|
||||||
closure jid_has_node_cl = (: int t, t2;
|
volatile closure jid_has_node_cl = (: int t, t2;
|
||||||
t = index($1, '@');
|
t = index($1, '@');
|
||||||
if (t == -1) return 0;
|
if (t == -1) return 0;
|
||||||
t2 = index($1, '/');
|
t2 = index($1, '/');
|
||||||
@ -72,6 +72,15 @@ int emit(string message) {
|
|||||||
return ::emit(message);
|
return ::emit(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't check message, use this only where you are 100% sure
|
||||||
|
// to be sending safe data
|
||||||
|
int emitraw(string message) {
|
||||||
|
#ifdef _flag_log_sockets_XMPP
|
||||||
|
D0( log_file("RAW_XMPP", "\n« %O\t%s", ME, message); )
|
||||||
|
#endif
|
||||||
|
return ::emit(message);
|
||||||
|
}
|
||||||
|
|
||||||
// this assumes the old ldmuddish charmode+combine-charset
|
// this assumes the old ldmuddish charmode+combine-charset
|
||||||
// if we ever get a input_bytes it needs to be rewrittn
|
// if we ever get a input_bytes it needs to be rewrittn
|
||||||
feed(a) {
|
feed(a) {
|
||||||
@ -131,7 +140,7 @@ varargs string mkjid(mixed who, mixed vars, mixed ignore_context, string target
|
|||||||
*/
|
*/
|
||||||
string t, *u;
|
string t, *u;
|
||||||
if (!who || who == "") return "";
|
if (!who || who == "") return "";
|
||||||
unless (jabberhost) jabberhost = JABBER_HOST;
|
unless (jabberhost) jabberhost = _host_XMPP;
|
||||||
P3(("%O mkjid(%O, %O, %O, %O, %O)\n", ME, who, vars, ignore_context, target, jabberhost))
|
P3(("%O mkjid(%O, %O, %O, %O, %O)\n", ME, who, vars, ignore_context, target, jabberhost))
|
||||||
if (!ignore_context && vars && vars["_nick_place"]
|
if (!ignore_context && vars && vars["_nick_place"]
|
||||||
&& vars["_context"]) {
|
&& vars["_context"]) {
|
||||||
@ -274,7 +283,14 @@ render(string mc, string data, mapping vars, mixed source) {
|
|||||||
+"' from='"+ vars["_INTERNAL_source_jabber"] +"' type='"
|
+"' from='"+ vars["_INTERNAL_source_jabber"] +"' type='"
|
||||||
+ (ISPLACEMSG(vars["_INTERNAL_source_jabber"]) && vars["_nick"] ?
|
+ (ISPLACEMSG(vars["_INTERNAL_source_jabber"]) && vars["_nick"] ?
|
||||||
"groupchat" : "chat")
|
"groupchat" : "chat")
|
||||||
+"'><body>"+ chomp(xmlquote(output)) +"</body></message>";
|
+"'><body>"+
|
||||||
|
#ifdef NEW_LINE
|
||||||
|
xmlquote(output)
|
||||||
|
#else
|
||||||
|
// was: chomp after xmlquote.. but why?
|
||||||
|
xmlquote(chomp(output))
|
||||||
|
#endif
|
||||||
|
+"</body></message>";
|
||||||
#if DEBUG > 1
|
#if DEBUG > 1
|
||||||
// most of these message we are happy with, so we don't need this log
|
// most of these message we are happy with, so we don't need this log
|
||||||
log_file("XMPP_TODO", "%O %s %s\n", ME, mc, output);
|
log_file("XMPP_TODO", "%O %s %s\n", ME, mc, output);
|
||||||
@ -384,7 +400,6 @@ certificate_check_jabbername(name, cert) {
|
|||||||
foreach(string cn : t) {
|
foreach(string cn : t) {
|
||||||
if (NAMEPREP(cn) == name) return 1;
|
if (NAMEPREP(cn) == name) return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
else if (name == NAMEPREP(t))
|
else if (name == NAMEPREP(t))
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: component.c,v 1.68 2008/03/11 15:13:58 lynx Exp $ // vim:syntax=lpc
|
// $Id: component.c,v 1.72 2008/10/01 10:59:24 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// this implements a passive listener component
|
// this implements a passive listener component
|
||||||
#define NO_INHERIT
|
#define NO_INHERIT
|
||||||
@ -40,7 +40,7 @@ reboot(reason, restart, pass) {
|
|||||||
// close the stream according to XEP 0190
|
// close the stream according to XEP 0190
|
||||||
if (interactive(ME)) {
|
if (interactive(ME)) {
|
||||||
flags |= TCP_PENDING_DISCONNECT;
|
flags |= TCP_PENDING_DISCONNECT;
|
||||||
emit("</stream:stream>");
|
emitraw("</stream:stream>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ waitfor_handshake(XMLNode node) {
|
|||||||
PT(("%O component auth succeded as %O\n", ME, componentname))
|
PT(("%O component auth succeded as %O\n", ME, componentname))
|
||||||
nodeHandler = #'jabberMsg;
|
nodeHandler = #'jabberMsg;
|
||||||
authenticated = 1;
|
authenticated = 1;
|
||||||
emit("<handshake/>");
|
emitraw("<handshake/>");
|
||||||
onHandshake();
|
onHandshake();
|
||||||
} else {
|
} else {
|
||||||
monitor_report("_error_invalid_password",
|
monitor_report("_error_invalid_password",
|
||||||
@ -122,7 +122,7 @@ int msg(string source, string mc, string data,
|
|||||||
#ifdef PREFIXES
|
#ifdef PREFIXES
|
||||||
if (abbrev("_prefix", mc)) return 1;
|
if (abbrev("_prefix", mc)) return 1;
|
||||||
#endif
|
#endif
|
||||||
#ifndef EXPERIMENTAL // TODO: decide if this is good or bad
|
#ifndef GAMMA // TODO: decide if this is good or bad
|
||||||
else if (abbrev("_status_person_absent", mc)) {
|
else if (abbrev("_status_person_absent", mc)) {
|
||||||
PT(("Intercepted absent from %O to %O\n", mc, source, ME))
|
PT(("Intercepted absent from %O to %O\n", mc, source, ME))
|
||||||
return 1;
|
return 1;
|
||||||
@ -172,7 +172,7 @@ open_stream(node) {
|
|||||||
if (node["@to"]) {
|
if (node["@to"]) {
|
||||||
packet += "from='" + node["@to"] + "' ";
|
packet += "from='" + node["@to"] + "' ";
|
||||||
} else {
|
} else {
|
||||||
packet += "from='" JABBER_HOST "' ";
|
packet += "from='" _host_XMPP "' ";
|
||||||
}
|
}
|
||||||
if (!config) {
|
if (!config) {
|
||||||
/* reply with a stream error */
|
/* reply with a stream error */
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: disco.c,v 1.41 2008/01/05 13:44:38 lynx Exp $ // vim:syntax=lpc
|
// $Id: disco.c,v 1.43 2008/09/12 15:54:38 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// this gets included by user.c and gateway.c. you can distinguish this
|
// this gets included by user.c and gateway.c. you can distinguish this
|
||||||
// by ifdeffing USER_PROGRAM. it may be renamed into disco.i one day.
|
// by ifdeffing USER_PROGRAM. it may be renamed into disco.i one day.
|
||||||
@ -19,7 +19,9 @@ disco_info_root(vars) {
|
|||||||
string featurelist;
|
string featurelist;
|
||||||
featurelist = "<feature var='http://jabber.org/protocol/muc'/>"
|
featurelist = "<feature var='http://jabber.org/protocol/muc'/>"
|
||||||
#ifndef REGISTERED_USERS_ONLY
|
#ifndef REGISTERED_USERS_ONLY
|
||||||
|
# ifndef _flag_disable_registration_XMPP
|
||||||
"<feature var='jabber:iq:register'/>"
|
"<feature var='jabber:iq:register'/>"
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef VOLATILE
|
#ifndef VOLATILE
|
||||||
"<feature var='msgoffline'/>"
|
"<feature var='msgoffline'/>"
|
||||||
@ -95,8 +97,8 @@ disco_items_root(vars) {
|
|||||||
#ifdef PUBLIC_PLACES
|
#ifdef PUBLIC_PLACES
|
||||||
// see also: library advertised_places()
|
// see also: library advertised_places()
|
||||||
#endif
|
#endif
|
||||||
// TODO: is it safe to use JABBER_HOST here?
|
// is it safe to use _host_XMPP here?
|
||||||
vars["_list_item"] = "<item name='Chatrooms' jid='" JABBER_HOST "'/>";
|
vars["_list_item"] = "<item name='Chatrooms' jid='" _host_XMPP "'/>";
|
||||||
}
|
}
|
||||||
|
|
||||||
disco_items_place(name, vars) {
|
disco_items_place(name, vars) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: gateway.c,v 1.451 2008/03/29 16:07:30 fippo Exp $ // vim:syntax=lpc
|
// $Id: gateway.c,v 1.461 2008/10/22 16:35:59 fippo Exp $ // vim:syntax=lpc
|
||||||
/*
|
/*
|
||||||
* jabber/gateway
|
* jabber/gateway
|
||||||
* listens on jabber interserver port for incoming connections
|
* listens on jabber interserver port for incoming connections
|
||||||
@ -56,6 +56,12 @@ quit() {
|
|||||||
disconnected(remainder) {
|
disconnected(remainder) {
|
||||||
// TODO: handle remainder
|
// TODO: handle remainder
|
||||||
P2(( "gateway %O disconnected\n", ME ))
|
P2(( "gateway %O disconnected\n", ME ))
|
||||||
|
#ifdef GAMMA
|
||||||
|
// sometimes we get complete presence packets in the socket close
|
||||||
|
// remainder. probably broken xmpp implementations, let's try and
|
||||||
|
// do the best we can with it by forwarding stuff to feed().
|
||||||
|
if (remainder && strlen(remainder)) feed(remainder);
|
||||||
|
#endif
|
||||||
if (objectp(active)) active -> removeGateway(streamid);
|
if (objectp(active)) active -> removeGateway(streamid);
|
||||||
#ifdef _flag_log_sockets_XMPP
|
#ifdef _flag_log_sockets_XMPP
|
||||||
D0( log_file("RAW_XMPP", "\n%O disc\t%O", ME, ctime()); )
|
D0( log_file("RAW_XMPP", "\n%O disc\t%O", ME, ctime()); )
|
||||||
@ -85,13 +91,18 @@ void create() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WANT_S2S_TLS
|
#ifdef WANT_S2S_TLS
|
||||||
|
// similar code in other files
|
||||||
tls_logon(result) {
|
tls_logon(result) {
|
||||||
P2(("%O tls_logon(%d)\n", ME, result))
|
if (result == 0) {
|
||||||
if (result < 0) {
|
|
||||||
QUIT
|
|
||||||
}
|
|
||||||
else if (result == 0) {
|
|
||||||
certinfo = tls_certificate(ME, 0);
|
certinfo = tls_certificate(ME, 0);
|
||||||
|
P3(("%O tls_logon fetching certificate: %O\n", ME, certinfo))
|
||||||
|
# ifdef ERR_TLS_NOT_DETECTED
|
||||||
|
} else if (result == ERR_TLS_NOT_DETECTED) {
|
||||||
|
// just go on without encryption
|
||||||
|
# endif
|
||||||
|
} else if (result < 0) {
|
||||||
|
P1(("%O TLS error %d: %O\n", ME, result, tls_error(result)))
|
||||||
|
QUIT
|
||||||
} else {
|
} else {
|
||||||
P0(("tls_logon with result > 0?!?!\n"))
|
P0(("tls_logon with result > 0?!?!\n"))
|
||||||
// should not happen
|
// should not happen
|
||||||
@ -121,7 +132,7 @@ verify_connection(string to, string from, string type) {
|
|||||||
emit(sprintf("<db:result from='%s' to='%s' type='%s'/>",
|
emit(sprintf("<db:result from='%s' to='%s' type='%s'/>",
|
||||||
to, from, type));
|
to, from, type));
|
||||||
if (type != "valid") {
|
if (type != "valid") {
|
||||||
emit("</stream:stream>");
|
emitraw("</stream:stream>");
|
||||||
P2(("quitting invalid stream\n"))
|
P2(("quitting invalid stream\n"))
|
||||||
QUIT
|
QUIT
|
||||||
} else {
|
} else {
|
||||||
@ -217,7 +228,7 @@ jabberMsg(XMLNode node) {
|
|||||||
|
|
||||||
// <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:server' to='localhost' xmlns:db='jabber:server:dialback' version='1.0'><switching xmlns='http://switch.psyced.org'><scheme>psyc</scheme></switching>
|
// <?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:server' to='localhost' xmlns:db='jabber:server:dialback' version='1.0'><switching xmlns='http://switch.psyced.org'><scheme>psyc</scheme></switching>
|
||||||
|
|
||||||
emit("<switched xmlns='http://switch.psyced.org'/>");
|
emitraw("<switched xmlns='http://switch.psyced.org'/>");
|
||||||
PT(("received 'switching'. authhosts %O\n", authhosts))
|
PT(("received 'switching'. authhosts %O\n", authhosts))
|
||||||
o = ("S:psyc:" + host) -> load();
|
o = ("S:psyc:" + host) -> load();
|
||||||
P1(("%O switching to %O for %O\n", ME, o, host))
|
P1(("%O switching to %O for %O\n", ME, o, host))
|
||||||
@ -237,8 +248,8 @@ jabberMsg(XMLNode node) {
|
|||||||
* a request for verification of a key
|
* a request for verification of a key
|
||||||
*/
|
*/
|
||||||
// if we dont know the host, complain
|
// if we dont know the host, complain
|
||||||
// put NAMEPREP(JABBER_HOST) into the localhost mapping pleeeease
|
// put NAMEPREP(_host_XMPP) into the localhost mapping pleeeease
|
||||||
//if (target != NAMEPREP(JABBER_HOST)) {
|
//if (target != NAMEPREP(_host_XMPP)) {
|
||||||
unless (is_localhost(lower_case(target))) {
|
unless (is_localhost(lower_case(target))) {
|
||||||
monitor_report("_error_unknown_host",
|
monitor_report("_error_unknown_host",
|
||||||
sprintf("%O sent us a dialback packet believing we would be %O",
|
sprintf("%O sent us a dialback packet believing we would be %O",
|
||||||
@ -250,7 +261,7 @@ jabberMsg(XMLNode node) {
|
|||||||
sendmsg(origin,
|
sendmsg(origin,
|
||||||
"_dialback_request_verify", 0,
|
"_dialback_request_verify", 0,
|
||||||
([ "_INTERNAL_target_jabber" : source,
|
([ "_INTERNAL_target_jabber" : source,
|
||||||
"_INTERNAL_source_jabber" : NAMEPREP(JABBER_HOST),
|
"_INTERNAL_source_jabber" : NAMEPREP(_host_XMPP),
|
||||||
"_dialback_key" : node[Cdata],
|
"_dialback_key" : node[Cdata],
|
||||||
"_tag" : streamid
|
"_tag" : streamid
|
||||||
])
|
])
|
||||||
@ -296,7 +307,7 @@ jabberMsg(XMLNode node) {
|
|||||||
/* we were calling this server, this packet is step 8
|
/* we were calling this server, this packet is step 8
|
||||||
* and we are doing step 9
|
* and we are doing step 9
|
||||||
*/
|
*/
|
||||||
/* if we dont recognize target (currently: == JABBER_HOST)
|
/* if we dont recognize target (currently: == _host_XMPP)
|
||||||
* then croak with a host-unknown and commit suicide
|
* then croak with a host-unknown and commit suicide
|
||||||
*/
|
*/
|
||||||
// same as above...
|
// same as above...
|
||||||
@ -317,12 +328,15 @@ jabberMsg(XMLNode node) {
|
|||||||
case "starttls":
|
case "starttls":
|
||||||
#ifdef WANT_S2S_TLS
|
#ifdef WANT_S2S_TLS
|
||||||
if (tls_available()) {
|
if (tls_available()) {
|
||||||
emit("<proceed xmlns='" NS_XMPP "xmpp-tls'/>");
|
emitraw("<proceed xmlns='" NS_XMPP "xmpp-tls'/>");
|
||||||
|
# if __EFUN_DEFINED__(tls_want_peer_certificate)
|
||||||
|
tls_want_peer_certificate(ME);
|
||||||
|
# endif
|
||||||
tls_init_connection(ME, #'tls_logon);
|
tls_init_connection(ME, #'tls_logon);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
emit("<failure xmlns='" NS_XMPP "xmpp-tls'/>");
|
emitraw("<failure xmlns='" NS_XMPP "xmpp-tls'/>");
|
||||||
return;
|
return;
|
||||||
case "stream:error":
|
case "stream:error":
|
||||||
if (node["/connection-timeout"]) {
|
if (node["/connection-timeout"]) {
|
||||||
@ -351,7 +365,7 @@ jabberMsg(XMLNode node) {
|
|||||||
|
|
||||||
success = certificate_check_jabbername(t, certinfo);
|
success = certificate_check_jabbername(t, certinfo);
|
||||||
if (success) {
|
if (success) {
|
||||||
emit("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
emitraw("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
||||||
P2(("successful sasl external authentication with "
|
P2(("successful sasl external authentication with "
|
||||||
"%O\n", t))
|
"%O\n", t))
|
||||||
sAuthenticated(t);
|
sAuthenticated(t);
|
||||||
@ -377,7 +391,7 @@ jabberMsg(XMLNode node) {
|
|||||||
encode_base64(sprintf("realm=\"%s\",nonce=\"%s\","
|
encode_base64(sprintf("realm=\"%s\",nonce=\"%s\","
|
||||||
"qop=\"auth\",charset=utf-8,"
|
"qop=\"auth\",charset=utf-8,"
|
||||||
"algorithm=md5-sess",
|
"algorithm=md5-sess",
|
||||||
JABBER_HOST, RANDHEXSTRING)
|
_host_XMPP, RANDHEXSTRING)
|
||||||
) + "</challenge>");
|
) + "</challenge>");
|
||||||
} else {
|
} else {
|
||||||
// kind of 'unknown username'
|
// kind of 'unknown username'
|
||||||
@ -469,7 +483,10 @@ open_stream(XMLNode node) {
|
|||||||
if (node["@to"]) {
|
if (node["@to"]) {
|
||||||
packet += "from='" + node["@to"] + "' ";
|
packet += "from='" + node["@to"] + "' ";
|
||||||
} else {
|
} else {
|
||||||
packet += "from='" JABBER_HOST "' ";
|
packet += "from='" _host_XMPP "' ";
|
||||||
|
}
|
||||||
|
if (node["@from"]) {
|
||||||
|
packet += "to='" + node["@from"] + "' ";
|
||||||
}
|
}
|
||||||
if (node["@to"] && !(is_localhost(lower_case(node["@to"])))) {
|
if (node["@to"] && !(is_localhost(lower_case(node["@to"])))) {
|
||||||
emit(packet + ">");
|
emit(packet + ">");
|
||||||
@ -505,7 +522,7 @@ open_stream(XMLNode node) {
|
|||||||
// let the other side decide if it knows a shared secret
|
// let the other side decide if it knows a shared secret
|
||||||
// with us
|
// with us
|
||||||
// if it it has, it will use it with digest-md5
|
// if it it has, it will use it with digest-md5
|
||||||
# if __VERSION_MINOR__ > 3 || __VERSION_MICRO__ > 610
|
# ifndef _flag_disable_authentication_digest_MD5
|
||||||
if (node["@from"]
|
if (node["@from"]
|
||||||
&& config(XMPP + node["@from"],
|
&& config(XMPP + node["@from"],
|
||||||
"_secret_shared")) {
|
"_secret_shared")) {
|
||||||
@ -517,7 +534,7 @@ open_stream(XMLNode node) {
|
|||||||
// and we have verified it as X509_V_OK (0)
|
// and we have verified it as X509_V_OK (0)
|
||||||
// we offer SASL external (authentication via name
|
// we offer SASL external (authentication via name
|
||||||
// presented in x509 certificate
|
// presented in x509 certificate
|
||||||
P3(("gateway::certinfo %O\n", certinfo))
|
P0(("gateway::certinfo %O\n", certinfo))
|
||||||
if (mappingp(certinfo) && certinfo[0] == 0) {
|
if (mappingp(certinfo) && certinfo[0] == 0) {
|
||||||
// if from attribute is present we only offer
|
// if from attribute is present we only offer
|
||||||
// sasl external if we know that it will succeed
|
// sasl external if we know that it will succeed
|
||||||
@ -554,6 +571,6 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
P2(("%O using w() for %O, unimplemented... mc %O, source %O\n",
|
P2(("%O using w() for %O, unimplemented... mc %O, source %O\n",
|
||||||
ME, origin, mc, source))
|
ME, origin, mc, source))
|
||||||
unless (vars) vars = ([ ]);
|
unless (vars) vars = ([ ]);
|
||||||
vars["_INTERNAL_source_jabber"] = objectp(source) ? mkjid(source) : JABBER_HOST;
|
vars["_INTERNAL_source_jabber"] = objectp(source) ? mkjid(source) : _host_XMPP;
|
||||||
sendmsg(origin, mc, data, vars);
|
sendmsg(origin, mc, data, vars);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: interserver.c,v 1.12 2008/03/11 15:13:58 lynx Exp $ vim:syntax=lpc
|
// $Id: interserver.c,v 1.13 2008/10/01 10:59:24 lynx Exp $ vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// common things for interserver jabber.. included or maybe later inherited by
|
// common things for interserver jabber.. included or maybe later inherited by
|
||||||
// active.c and gateway.c. i am sure fippo will find some more nice things to
|
// active.c and gateway.c. i am sure fippo will find some more nice things to
|
||||||
@ -35,7 +35,7 @@ int clean_up(int refcount) {
|
|||||||
// and is therefore the correct way to timeout a connection.
|
// and is therefore the correct way to timeout a connection.
|
||||||
PT(("%O cleaning up: closing stream\n", ME))
|
PT(("%O cleaning up: closing stream\n", ME))
|
||||||
// close the stream according to XEP 0190
|
// close the stream according to XEP 0190
|
||||||
emit("</stream:stream>");
|
emitraw("</stream:stream>");
|
||||||
// flag says the stream is in closing phase and nothing may be
|
// flag says the stream is in closing phase and nothing may be
|
||||||
// delivered on it. but we aren't enforcing this. TODO!
|
// delivered on it. but we aren't enforcing this. TODO!
|
||||||
flags |= TCP_PENDING_DISCONNECT;
|
flags |= TCP_PENDING_DISCONNECT;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: jabber.h,v 1.74 2008/03/30 10:27:49 lynx Exp $ // vim:syntax=lpc
|
// $Id: jabber.h,v 1.75 2008/09/12 15:54:39 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// REMINDER:
|
// REMINDER:
|
||||||
// there are plenty of calls to lower_case in the code, that is because
|
// there are plenty of calls to lower_case in the code, that is because
|
||||||
@ -74,12 +74,12 @@ virtual inherit JABBER_PATH "common";
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef JABBER_HOST
|
#ifndef _host_XMPP
|
||||||
# define JABBER_HOST SERVER_HOST
|
# define _host_XMPP SERVER_HOST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// this is not ready for is_localhost
|
// this is not ready for is_localhost
|
||||||
#define is_localhost(a) (a) == JABBER_HOST
|
#define is_localhost(a) (a) == _host_XMPP
|
||||||
|
|
||||||
|
|
||||||
#define JABSOURCE "_INTERNAL_source_jabber"
|
#define JABSOURCE "_INTERNAL_source_jabber"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <net.h> // vim:set syntax=lpc
|
|
||||||
#include "jabber.h"
|
#include "jabber.h"
|
||||||
|
#include <net.h> // vim:set syntax=lpc
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
#include "presence.h"
|
#include "presence.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -48,7 +48,6 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||||||
// #define MYORIGIN XMPP + su[UUserAtHost]
|
// #define MYORIGIN XMPP + su[UUserAtHost]
|
||||||
|
|
||||||
unless(su) su = parse_uniform(origin);
|
unless(su) su = parse_uniform(origin);
|
||||||
#if 1 //def NOT_EXPERIMENTAL
|
|
||||||
origin = XMPP;
|
origin = XMPP;
|
||||||
if (su[UUser]) {
|
if (su[UUser]) {
|
||||||
origin += NODEPREP(su[UUser]) + "@";
|
origin += NODEPREP(su[UUser]) + "@";
|
||||||
@ -59,7 +58,6 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||||||
origin += "/" + RESOURCEPREP(su[UResource]);
|
origin += "/" + RESOURCEPREP(su[UResource]);
|
||||||
}
|
}
|
||||||
su = parse_uniform(origin);
|
su = parse_uniform(origin);
|
||||||
#endif
|
|
||||||
if (node["/nick"] &&
|
if (node["/nick"] &&
|
||||||
node["/nick"]["@xmlns"] == "http://jabber.org/protocol/nick" &&
|
node["/nick"]["@xmlns"] == "http://jabber.org/protocol/nick" &&
|
||||||
node["/nick"][Cdata]) {
|
node["/nick"][Cdata]) {
|
||||||
@ -133,7 +131,14 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||||||
data = "Talking to [_nick_target] is not possible: [_text_XMPP]";
|
data = "Talking to [_nick_target] is not possible: [_text_XMPP]";
|
||||||
} else {
|
} else {
|
||||||
mc = "_failure_unavailable_service_talk";
|
mc = "_failure_unavailable_service_talk";
|
||||||
data = "Talking to [_nick_target] is not possible. You may have to establish friendship first.";
|
// data = "Talking to [_nick_target] is not possible. You may have to establish friendship first.";
|
||||||
|
// google talk sends this quite frequently:
|
||||||
|
// * when a friendship exchange hasn't been done
|
||||||
|
// * when a friend has gone offline
|
||||||
|
// and you never know if a message has been delivered to the
|
||||||
|
// recipient just the same! so here's a more accurate error message,
|
||||||
|
// effectively giving you less information, since that's what we have here.
|
||||||
|
data = "Message to [_nick_target] may not have reached its recipient.";
|
||||||
}
|
}
|
||||||
} else if (1) { // TODO: what was that error?
|
} else if (1) { // TODO: what was that error?
|
||||||
PT(("gateway TODO <error> in <message>: %O\n",
|
PT(("gateway TODO <error> in <message>: %O\n",
|
||||||
@ -293,7 +298,7 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||||||
} else {
|
} else {
|
||||||
// no relaying allowed, so we ignore hostname
|
// no relaying allowed, so we ignore hostname
|
||||||
o = summon_person(tu[UUser]);
|
o = summon_person(tu[UUser]);
|
||||||
#ifdef EXPERIMENTAL
|
#ifdef GAMMA
|
||||||
// xep 0085 typing notices - we even split active into a separate message
|
// xep 0085 typing notices - we even split active into a separate message
|
||||||
// for now. could be sent as a flag
|
// for now. could be sent as a flag
|
||||||
if ((node[t="/composing"] || node[t="/active"] ||
|
if ((node[t="/composing"] || node[t="/active"] ||
|
||||||
@ -379,7 +384,7 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||||||
// so there wont be circular error messages
|
// so there wont be circular error messages
|
||||||
if (tu[UUser]) {
|
if (tu[UUser]) {
|
||||||
o = summon_person(tu[UUser]);
|
o = summon_person(tu[UUser]);
|
||||||
#ifndef EXPERIMENTAL
|
#ifndef GAMMA
|
||||||
if (o && o->execute_callback(node["@id"], ({ vars["_INTERNAL_identification"], vars, node }))) return 1;
|
if (o && o->execute_callback(node["@id"], ({ vars["_INTERNAL_identification"], vars, node }))) return 1;
|
||||||
#else
|
#else
|
||||||
// the following should catch errors - in theory, requires testing
|
// the following should catch errors - in theory, requires testing
|
||||||
@ -540,26 +545,20 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||||||
sendmsg(o, "_notice_place_leave_unicast", 0, vars, origin);
|
sendmsg(o, "_notice_place_leave_unicast", 0, vars, origin);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef AVAILABILITY_OFFLINE
|
||||||
o = summon_person(tu[UUser]);
|
o = summon_person(tu[UUser]);
|
||||||
// http://www.psyc.eu/presence
|
// http://www.psyc.eu/presence
|
||||||
vars["_degree_availability"] = AVAILABILITY_OFFLINE;
|
vars["_degree_availability"] = AVAILABILITY_OFFLINE;
|
||||||
#ifdef CACHE_PRESENCE
|
# ifdef CACHE_PRESENCE
|
||||||
persistent_presence(XMPP + su[UUserAtHost],
|
persistent_presence(XMPP + su[UUserAtHost],
|
||||||
AVAILABILITY_OFFLINE);
|
AVAILABILITY_OFFLINE);
|
||||||
#endif
|
# endif
|
||||||
vars["_description_presence"] =
|
vars["_description_presence"] =
|
||||||
(node["/status"] && node["/status"][Cdata]) ?
|
(node["/status"] && node["/status"][Cdata]) ?
|
||||||
node["/status"][Cdata] : ""; // "Get psyced!";
|
node["/status"][Cdata] : ""; // "Get psyced!";
|
||||||
vars["_INTERNAL_mood_jabber"] = "neutral";
|
vars["_INTERNAL_mood_jabber"] = "neutral";
|
||||||
sendmsg(o, "_notice_presence_absent", 0,
|
sendmsg(o, "_notice_presence_absent", 0,
|
||||||
vars, origin);
|
vars, origin);
|
||||||
#if 0 // packen wir das doch wieder zusammen...
|
|
||||||
} else {
|
|
||||||
// one more famous fippoesque else case.. let's fill it ;)
|
|
||||||
P0(("%O Surprise! Encountered absence with resource: %O\n",
|
|
||||||
ME, node))
|
|
||||||
// interessant... wir werden das wohl noch oefter sehen
|
|
||||||
// ich bin nicht sicher, ob das ein bug der gegenseite ist
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -637,11 +636,11 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
|
|||||||
// }
|
// }
|
||||||
P4(("_request_enter from %O to %O: %O\n", ME, o, vars))
|
P4(("_request_enter from %O to %O: %O\n", ME, o, vars))
|
||||||
// dont send me a memberlist if i am a member already
|
// dont send me a memberlist if i am a member already
|
||||||
#ifndef HISTORY_AMOUNT
|
#ifndef _limit_amount_history_place_default
|
||||||
# define HISTORY_AMOUNT 5
|
# define _limit_amount_history_place_default 5
|
||||||
#endif
|
#endif
|
||||||
unless(vars["_amount_history"])
|
unless(vars["_amount_history"])
|
||||||
vars["_amount_history"] = HISTORY_AMOUNT;
|
vars["_amount_history"] = _limit_amount_history_place_default;
|
||||||
sendmsg(o,
|
sendmsg(o,
|
||||||
#ifdef SPEC
|
#ifdef SPEC
|
||||||
"_request_context_enter"
|
"_request_context_enter"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
#include "jabber.h"
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
#include "jabber.h"
|
|
||||||
|
|
||||||
// just renderMembers
|
// just renderMembers
|
||||||
#include NET_PATH "members.i"
|
#include NET_PATH "members.i"
|
||||||
@ -37,9 +37,9 @@ int msg(string source, string mc, string data,
|
|||||||
// ignore these
|
// ignore these
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
case "_request_description": // wir sollten uns da auf eins einigen :)
|
case "_request_examine": // don't use this, please remove in 2009
|
||||||
case "_request_examine": // needs a tag also... probably all _request's do
|
case "_request_description": // this is the one.
|
||||||
mc = "_request_examine_vCard";
|
mc = "_request_description_vCard"; // pending rename.. TODO
|
||||||
unless (vars["_tag"]) vars["_tag"] = RANDHEXSTRING;
|
unless (vars["_tag"]) vars["_tag"] = RANDHEXSTRING;
|
||||||
source->chain_callback(vars["_tag"], (:
|
source->chain_callback(vars["_tag"], (:
|
||||||
if ($3["@type"] == "result") {
|
if ($3["@type"] == "result") {
|
||||||
@ -245,6 +245,7 @@ int msg(string source, string mc, string data,
|
|||||||
$2 });
|
$2 });
|
||||||
:));
|
:));
|
||||||
break;
|
break;
|
||||||
|
#ifndef _flag_disable_module_authentication
|
||||||
case "_request_authentication":
|
case "_request_authentication":
|
||||||
// TODO: XEP 0070 says we should use <message/> when the recipient is a bare jid
|
// TODO: XEP 0070 says we should use <message/> when the recipient is a bare jid
|
||||||
// but I prefer the iq method
|
// but I prefer the iq method
|
||||||
@ -255,6 +256,8 @@ int msg(string source, string mc, string data,
|
|||||||
return ({ $1, "_error_invalid_authentication", 0, $2 });
|
return ({ $1, "_error_invalid_authentication", 0, $2 });
|
||||||
:));
|
:));
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifndef _flag_disable_query_server
|
||||||
case "_notice_list_feature":
|
case "_notice_list_feature":
|
||||||
case "_notice_list_feature_person":
|
case "_notice_list_feature_person":
|
||||||
case "_notice_list_feature_place":
|
case "_notice_list_feature_place":
|
||||||
@ -266,6 +269,7 @@ int msg(string source, string mc, string data,
|
|||||||
vars["_list_feature"] = implode(map(vars["_list_feature"],
|
vars["_list_feature"] = implode(map(vars["_list_feature"],
|
||||||
(: return "<feature var='" + feat2jabber[$1] + "'/>"; :)), "");
|
(: return "<feature var='" + feat2jabber[$1] + "'/>"; :)), "");
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case "_notice_list_item":
|
case "_notice_list_item":
|
||||||
t = "";
|
t = "";
|
||||||
// same stuff in user.c (what happened to code sharing?)
|
// same stuff in user.c (what happened to code sharing?)
|
||||||
@ -513,6 +517,10 @@ int msg(string source, string mc, string data,
|
|||||||
#endif
|
#endif
|
||||||
if ($3["@type"] == "error") {
|
if ($3["@type"] == "error") {
|
||||||
// FIXME: could remove context
|
// FIXME: could remove context
|
||||||
|
//
|
||||||
|
// also, we should implement the full choice of errors and
|
||||||
|
// map them to appropriate psyc errors.. instead we just
|
||||||
|
// have this silly lazy coder's message:
|
||||||
return ({ t, "_failure_place_enter_XMPP",
|
return ({ t, "_failure_place_enter_XMPP",
|
||||||
"[_nick_place] could not be entered for jabberish reasons.",
|
"[_nick_place] could not be entered for jabberish reasons.",
|
||||||
$2 });
|
$2 });
|
||||||
@ -557,6 +565,9 @@ int msg(string source, string mc, string data,
|
|||||||
else if (abbrev("_failure_redirect", mc)) {
|
else if (abbrev("_failure_redirect", mc)) {
|
||||||
if (vars["_tag_reply"]) { // wild guess that it is an iq then
|
if (vars["_tag_reply"]) { // wild guess that it is an iq then
|
||||||
mc = "_jabber_iq_error";
|
mc = "_jabber_iq_error";
|
||||||
|
// <lynX> was spricht dagegen _failure_redirect als <redirect/> auszugeben?
|
||||||
|
// <fippo> ich denke nicht, dass es irgendwer vernünftig implementiert...
|
||||||
|
// außerdem musst du die jid des raumes in dem konkreten fall rausfinden
|
||||||
vars["_jabber_XML"] = "<error type='modify'><gone xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'>" + psyctext(data, vars) + "</text></error>";
|
vars["_jabber_XML"] = "<error type='modify'><gone xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang='en'>" + psyctext(data, vars) + "</text></error>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
|
||||||
/* a cache for the remote muc
|
/* a slave for the remote muc
|
||||||
* yes, this is for a SINGLE person
|
* yes, this is for a SINGLE person
|
||||||
* yes, that's horrible
|
* yes, that's horrible
|
||||||
*
|
*
|
||||||
@ -8,13 +8,6 @@
|
|||||||
* even /history if we'd like to have that.. ;)
|
* even /history if we'd like to have that.. ;)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// FIXME: should set "owner nick" and tag so
|
|
||||||
// we can detect when the remote room does not
|
|
||||||
// support tagging or when we are kicked
|
|
||||||
// and this could even do echo detection
|
|
||||||
// NOTE: this should work when using the
|
|
||||||
// isecho check
|
|
||||||
|
|
||||||
object owner;
|
object owner;
|
||||||
mapping membercache = ([ ]);
|
mapping membercache = ([ ]);
|
||||||
|
|
||||||
@ -49,6 +42,8 @@ castmsg(source, method, data, mapping vars) {
|
|||||||
case "_notice_place_leave":
|
case "_notice_place_leave":
|
||||||
if (isecho) {
|
if (isecho) {
|
||||||
// got kicked or room does not support tagging
|
// got kicked or room does not support tagging
|
||||||
|
// this works already for kick, but it might be nice to do that
|
||||||
|
// as a KICK for irc
|
||||||
P0(("%O left via _notice_place_leave, this is strange\n", vars["_context"]))
|
P0(("%O left via _notice_place_leave, this is strange\n", vars["_context"]))
|
||||||
}
|
}
|
||||||
m_delete(membercache, source);
|
m_delete(membercache, source);
|
||||||
@ -63,6 +58,5 @@ castmsg(source, method, data, mapping vars) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mapping qMembers() {
|
mapping qMembers() {
|
||||||
P4(("membercache is %O\n", membercache))
|
|
||||||
return m_indices(membercache);
|
return m_indices(membercache);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
// $Id: server.c,v 1.148 2008/03/11 15:13:58 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: server.c,v 1.159 2008/10/01 10:59:24 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
#include "jabber.h"
|
#include "jabber.h"
|
||||||
#include "server.h" // inherits net/server
|
#include "server.h" // inherits net/server
|
||||||
|
|
||||||
#include "person.h" // find_person
|
#include "person.h" // find_person
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
|
#include <sys/tls.h>
|
||||||
|
|
||||||
volatile string tag;
|
volatile string authtag;
|
||||||
volatile string resource;
|
volatile string resource;
|
||||||
volatile string streamid;
|
volatile string streamid;
|
||||||
volatile string pass;
|
volatile string pass;
|
||||||
@ -16,12 +17,11 @@ volatile string sasluser;
|
|||||||
volatile string saslchallenge;
|
volatile string saslchallenge;
|
||||||
|
|
||||||
#ifdef __TLS__
|
#ifdef __TLS__
|
||||||
volatile mixed cert;
|
volatile mixed certinfo;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qScheme() { return "jabber"; }
|
qScheme() { return "jabber"; }
|
||||||
// qName() { } // we need that in common.c - probably no more
|
// qName() { } // we need that in common.c - probably no more
|
||||||
qTag() { return tag; }
|
|
||||||
|
|
||||||
void create() {
|
void create() {
|
||||||
unless (clonep()) return;
|
unless (clonep()) return;
|
||||||
@ -30,13 +30,24 @@ void create() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __TLS__
|
#ifdef __TLS__
|
||||||
tls_logon(result) {
|
// similar code in other files
|
||||||
PT(("%O tls_logon(%d)\n", ME, result))
|
tls_logon(result) {
|
||||||
PT(("%O tls? %O\n", ME, tls_query_connection_state(ME)))
|
if (result == 0) {
|
||||||
// we may write again
|
# ifdef WANT_S2S_SASL /* hey wait.. this is not S2S here!? */
|
||||||
# ifdef WANT_S2S_SASL
|
certinfo = tls_certificate(ME, 0);
|
||||||
cert = tls_certificate(ME, 0);
|
|
||||||
# endif
|
# endif
|
||||||
|
P3(("%O tls_logon fetching certificate: %O\n", ME, certinfo))
|
||||||
|
# ifdef ERR_TLS_NOT_DETECTED
|
||||||
|
} else if (result == ERR_TLS_NOT_DETECTED) {
|
||||||
|
// no encryption. no problem.
|
||||||
|
# endif
|
||||||
|
} else if (result < 0) {
|
||||||
|
P1(("%O TLS error %d: %O\n", ME, result, tls_error(result)))
|
||||||
|
QUIT // don't fall back to plaintext instead
|
||||||
|
} else {
|
||||||
|
P0(("tls_logon with result > 0?!?!\n"))
|
||||||
|
// should not happen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -57,14 +68,13 @@ string *splitsasl(string data) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
promptForPassword(user) {
|
promptForPassword(user) {
|
||||||
P2(("promptForPassword with %O\n", user))
|
P2(("promptForPassword with %O\n", user))
|
||||||
if (reprompt == 1 || pass) {
|
if (reprompt == 1 || pass) {
|
||||||
w("_error_invalid_password", "Invalid password.\n",
|
w("_error_invalid_password", "Invalid password.\n",
|
||||||
([ "_tag_reply" : qTag(), "_nick" : nick,
|
([ "_tag_reply" : authtag || "", "_nick" : nick,
|
||||||
"_resource" : resource ]) );
|
"_resource" : resource ]) );
|
||||||
write("</stream:stream>");
|
emitraw("</stream:stream>");
|
||||||
QUIT
|
QUIT
|
||||||
return; // ?
|
return; // ?
|
||||||
}
|
}
|
||||||
@ -72,9 +82,9 @@ promptForPassword(user) {
|
|||||||
unless (pass) {
|
unless (pass) {
|
||||||
reprompt = 1;
|
reprompt = 1;
|
||||||
w("_query_password", 0, //"Please provide your password.",
|
w("_query_password", 0, //"Please provide your password.",
|
||||||
([ "_nick": nick, "_tag_reply" : qTag() ]) );
|
([ "_nick": nick, "_tag_reply" : authtag || "" ]) );
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
logon(a) {
|
logon(a) {
|
||||||
@ -100,17 +110,17 @@ createUser(nick) {
|
|||||||
|
|
||||||
|
|
||||||
userLogon() {
|
userLogon() {
|
||||||
user->sTag(tag);
|
user->sTag(authtag);
|
||||||
user->sResource(resource);
|
user->sResource(resource);
|
||||||
return ::userLogon();
|
return ::userLogon();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL
|
#ifdef GAMMA
|
||||||
authChecked(result, varargs array(mixed) args) {
|
authChecked(result, varargs array(mixed) args) {
|
||||||
// a point where we could be sending our jabber:iq:auth reply
|
// a point where we could be sending our jabber:iq:auth reply
|
||||||
// instead of letting _notice_login do that
|
// instead of letting _notice_login do that
|
||||||
PT(("%O got authChecked %O, %O\n", ME, result, args))
|
PT(("%O got authChecked %O, %O\n", ME, result, args))
|
||||||
return ::authChecked(result, args);
|
return ::authChecked(result, args...);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -119,12 +129,12 @@ jabberMsg(XMLNode node) {
|
|||||||
string id;
|
string id;
|
||||||
mixed t;
|
mixed t;
|
||||||
|
|
||||||
id = node["@id"]; // tag?
|
id = node["@id"] || ""; // tag?
|
||||||
switch (node[Tag]) {
|
switch (node[Tag]) {
|
||||||
case "iq":
|
case "iq":
|
||||||
if (node["/bind"]) {
|
if (node["/bind"]) {
|
||||||
// suppresses the jabber:iq:auth reply in the SASL case
|
// suppresses the jabber:iq:auth reply in the SASL case
|
||||||
tag = -1;
|
authtag = -1;
|
||||||
unless (sasluser) {
|
unless (sasluser) {
|
||||||
// not-allowed stanza error?
|
// not-allowed stanza error?
|
||||||
return 0;
|
return 0;
|
||||||
@ -137,31 +147,28 @@ jabberMsg(XMLNode node) {
|
|||||||
if (!stringp(resource) || resource == "")
|
if (!stringp(resource) || resource == "")
|
||||||
resource = "PSYC";
|
resource = "PSYC";
|
||||||
nick = sasluser;
|
nick = sasluser;
|
||||||
sasluser = "";
|
sasluser = ""; // why an empty string? explanation needed
|
||||||
|
|
||||||
emit(sprintf("<iq type='result' id='%s'>"
|
emit("<iq type='result' id='"+ id +"'>"
|
||||||
"<bind xmlns='" NS_XMPP "xmpp-bind'>"
|
"<bind xmlns='" NS_XMPP "xmpp-bind'><jid>"+
|
||||||
"<jid>%s</jid>"
|
nick +"@" SERVER_HOST "/"+ resource +"</jid>"
|
||||||
"</bind></iq>",
|
"</bind></iq>");
|
||||||
id, nick + "@" SERVER_HOST "/" + resource));
|
|
||||||
return 0;
|
return 0;
|
||||||
} else if (node["/session"]) {
|
} else if (node["/session"]) {
|
||||||
unless(user) return 0; // what then?
|
unless(user) return 0; // what then?
|
||||||
if (!stringp(id))
|
emit("<iq type='result' id='"+ id +"' from='"
|
||||||
id = "";
|
SERVER_HOST "'/>");
|
||||||
emit(sprintf("<iq type='result' id='%s' from='%s'/>",
|
|
||||||
id, SERVER_HOST));
|
|
||||||
user -> vSet("language", language);
|
user -> vSet("language", language);
|
||||||
return morph();
|
return morph();
|
||||||
}
|
}
|
||||||
switch (node["/query"]["@xmlns"]) {
|
switch (node["/query"]["@xmlns"]) {
|
||||||
// old-school style.. for clients that don't like SASL, like kopete
|
// old-school style.. for clients that don't like SASL, like kopete, jabbin
|
||||||
case "jabber:iq:auth":
|
case "jabber:iq:auth":
|
||||||
tag = id;
|
authtag = id;
|
||||||
if (node["@type"] == "get"){
|
if (node["@type"] == "get"){
|
||||||
// hello(nick) ?
|
// hello(nick) ?
|
||||||
w("_query_password", 0,
|
w("_query_password", 0,
|
||||||
([ "_nick": nick, "_tag_reply": tag ]), "");
|
([ "_nick": nick, "_tag_reply": authtag || "" ]), "");
|
||||||
} else if (node["@type"] == "set") {
|
} else if (node["@type"] == "set") {
|
||||||
helper = node["/query"];
|
helper = node["/query"];
|
||||||
resource = helper["/resource"][Cdata];
|
resource = helper["/resource"][Cdata];
|
||||||
@ -182,10 +189,11 @@ jabberMsg(XMLNode node) {
|
|||||||
case "jabber:iq:register":
|
case "jabber:iq:register":
|
||||||
if (node["@type"] == "get"){
|
if (node["@type"] == "get"){
|
||||||
string packet;
|
string packet;
|
||||||
#ifdef REGISTERED_USERS_ONLY
|
#if defined(REGISTERED_USERS_ONLY) || defined(_flag_disable_registration_XMPP)
|
||||||
|
// super dirty.. this should all be in textdb
|
||||||
packet = sprintf("<iq type='result' id='%s'>"
|
packet = sprintf("<iq type='result' id='%s'>"
|
||||||
"<query xmlns='jabber:iq:register'/>"
|
"<query xmlns='jabber:iq:register'/>"
|
||||||
"<error code='501>No way!</error>" IQ_OFF,
|
"<error code='501>Registration by XMPP not permitted.</error>" IQ_OFF,
|
||||||
id);
|
id);
|
||||||
#else
|
#else
|
||||||
packet = sprintf("<iq type='result' id='%s'>"
|
packet = sprintf("<iq type='result' id='%s'>"
|
||||||
@ -228,6 +236,9 @@ jabberMsg(XMLNode node) {
|
|||||||
emit(packet);
|
emit(packet);
|
||||||
QUIT
|
QUIT
|
||||||
} else {
|
} else {
|
||||||
|
#if defined(REGISTERED_USERS_ONLY) || defined(_flag_disable_registration_XMPP)
|
||||||
|
// TODO: generate some error as above
|
||||||
|
#else
|
||||||
user -> vSet("password", t[Cdata]);
|
user -> vSet("password", t[Cdata]);
|
||||||
if (t = helper["/email"]) {
|
if (t = helper["/email"]) {
|
||||||
user -> vSet("email", helper["/email"]);
|
user -> vSet("email", helper["/email"]);
|
||||||
@ -235,6 +246,7 @@ jabberMsg(XMLNode node) {
|
|||||||
// maybe immediate save is not really a good idea
|
// maybe immediate save is not really a good idea
|
||||||
// user -> save();
|
// user -> save();
|
||||||
emit(sprintf("<iq type='result' id='%s'/>", id));
|
emit(sprintf("<iq type='result' id='%s'/>", id));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
user = 0;
|
user = 0;
|
||||||
}
|
}
|
||||||
@ -243,15 +255,14 @@ jabberMsg(XMLNode node) {
|
|||||||
case "starttls":
|
case "starttls":
|
||||||
#if __EFUN_DEFINED__(tls_available)
|
#if __EFUN_DEFINED__(tls_available)
|
||||||
if (tls_available()) {
|
if (tls_available()) {
|
||||||
emit("<proceed xmlns='" NS_XMPP "xmpp-tls'/>");
|
emitraw("<proceed xmlns='" NS_XMPP "xmpp-tls'/>");
|
||||||
// we may not write until tls_logon is called!
|
// we may not write until tls_logon is called!
|
||||||
tls_init_connection(ME, #'tls_logon);
|
tls_init_connection(ME, #'tls_logon);
|
||||||
} else {
|
} else {
|
||||||
P1(("%O received a 'starttls' but TLS isn't available.\n", ME))
|
P1(("%O received a 'starttls' but TLS isn't available.\n", ME))
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
emit("<failure xmlns='" NS_XMPP "xmpp-tls'/>");
|
emitraw("<failure xmlns='" NS_XMPP "xmpp-tls'/></stream:stream>");
|
||||||
emit("</stream:stream>");
|
|
||||||
destruct(ME);
|
destruct(ME);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@ -282,7 +293,7 @@ jabberMsg(XMLNode node) {
|
|||||||
{
|
{
|
||||||
if (result) {
|
if (result) {
|
||||||
sasluser = creds[1];
|
sasluser = creds[1];
|
||||||
emit("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
emitraw("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
||||||
} else {
|
} else {
|
||||||
sasluser = 0;
|
sasluser = 0;
|
||||||
SASL_ERROR("temporary-auth-failure")
|
SASL_ERROR("temporary-auth-failure")
|
||||||
@ -294,7 +305,7 @@ jabberMsg(XMLNode node) {
|
|||||||
#else
|
#else
|
||||||
&& user -> checkPassword(creds[2], "plain")) {
|
&& user -> checkPassword(creds[2], "plain")) {
|
||||||
sasluser = creds[1];
|
sasluser = creds[1];
|
||||||
emit("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
emitraw("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
SASL_ERROR("invalid-mechanism")
|
SASL_ERROR("invalid-mechanism")
|
||||||
@ -312,8 +323,8 @@ jabberMsg(XMLNode node) {
|
|||||||
unless (node[Cdata]) {
|
unless (node[Cdata]) {
|
||||||
SASL_ERROR("incorrect-encoding")
|
SASL_ERROR("incorrect-encoding")
|
||||||
QUIT
|
QUIT
|
||||||
} else unless (mappingp(cert) && cert[0] == 0
|
} else unless (mappingp(certinfo) && certinfo[0] == 0
|
||||||
&& cert["1.2.840.113549.1.9.1"]) {
|
&& certinfo["1.2.840.113549.1.9.1"]) {
|
||||||
SASL_ERROR("invalid-mechanism")
|
SASL_ERROR("invalid-mechanism")
|
||||||
QUIT
|
QUIT
|
||||||
} else {
|
} else {
|
||||||
@ -322,7 +333,7 @@ jabberMsg(XMLNode node) {
|
|||||||
// incorrect-encoding sasl error
|
// incorrect-encoding sasl error
|
||||||
deco = to_string(decode_base64(node[Cdata]));
|
deco = to_string(decode_base64(node[Cdata]));
|
||||||
// TODO: the right thingie could be a list!
|
// TODO: the right thingie could be a list!
|
||||||
unless (deco == cert["1.2.840.113549.1.9.1"]) {
|
unless (deco == certinfo["1.2.840.113549.1.9.1"]) {
|
||||||
// TODO: not sure about this one
|
// TODO: not sure about this one
|
||||||
SASL_ERROR("invalid-mechanism")
|
SASL_ERROR("invalid-mechanism")
|
||||||
QUIT
|
QUIT
|
||||||
@ -340,7 +351,7 @@ jabberMsg(XMLNode node) {
|
|||||||
} else {
|
} else {
|
||||||
user = find_person(u) || createUser(u);
|
user = find_person(u) || createUser(u);
|
||||||
sasluser = u;
|
sasluser = u;
|
||||||
emit("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
emitraw("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
@ -377,7 +388,7 @@ jabberMsg(XMLNode node) {
|
|||||||
QUIT
|
QUIT
|
||||||
}
|
}
|
||||||
sasluser = u;
|
sasluser = u;
|
||||||
emit("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
emitraw("<success xmlns='" NS_XMPP "xmpp-sasl'/>");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -402,11 +413,12 @@ jabberMsg(XMLNode node) {
|
|||||||
+ encode_base64("rspauth=" + result) +
|
+ encode_base64("rspauth=" + result) +
|
||||||
"</success>");
|
"</success>");
|
||||||
} else {
|
} else {
|
||||||
PT(("digest md5 failure\n"))
|
P0(("digest md5 failure: %O\n", creds))
|
||||||
sasluser = 0;
|
sasluser = 0;
|
||||||
SASL_ERROR("invalid-authzid")
|
SASL_ERROR("invalid-authzid") // why do we get here?
|
||||||
QUIT
|
QUIT
|
||||||
}
|
}
|
||||||
|
return 0; // ignored, but avoids a warning
|
||||||
});
|
});
|
||||||
|
|
||||||
user = find_person(creds["username"]) || createUser(creds["username"]);
|
user = find_person(creds["username"]) || createUser(creds["username"]);
|
||||||
@ -422,7 +434,7 @@ jabberMsg(XMLNode node) {
|
|||||||
* wie auch immer haetten wir sonst mittlerweile net/queue fuer
|
* wie auch immer haetten wir sonst mittlerweile net/queue fuer
|
||||||
* diesen job
|
* diesen job
|
||||||
*/
|
*/
|
||||||
P2(("jabber/server:jabberMsg default case\n"))
|
P0(("jabber/server:jabberMsg default case\n"))
|
||||||
}
|
}
|
||||||
// return ::jabberMsg(from, cmd, args, data, all);
|
// return ::jabberMsg(from, cmd, args, data, all);
|
||||||
return 0;
|
return 0;
|
||||||
@ -467,7 +479,7 @@ open_stream(XMLNode node) {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
features += "<mechanisms xmlns='" NS_XMPP "xmpp-sasl'>"
|
features += "<mechanisms xmlns='" NS_XMPP "xmpp-sasl'>"
|
||||||
#if __VERSION_MINOR__ > 3 || __VERSION_MICRO__ > 610
|
#ifndef _flag_disable_authentication_digest_MD5
|
||||||
"<mechanism>DIGEST-MD5</mechanism>"
|
"<mechanism>DIGEST-MD5</mechanism>"
|
||||||
#endif
|
#endif
|
||||||
"<mechanism>PLAIN</mechanism>";
|
"<mechanism>PLAIN</mechanism>";
|
||||||
@ -477,8 +489,8 @@ open_stream(XMLNode node) {
|
|||||||
#endif
|
#endif
|
||||||
#if __EFUN_DEFINED__(tls_available)
|
#if __EFUN_DEFINED__(tls_available)
|
||||||
if (tls_available() && tls_query_connection_state(ME) > 0
|
if (tls_available() && tls_query_connection_state(ME) > 0
|
||||||
&& mappingp(cert) && cert[0] == 0
|
&& mappingp(certinfo) && certinfo[0] == 0
|
||||||
&& certificate_check_jabbername(0, cert)) {
|
&& certificate_check_jabbername(0, certinfo)) {
|
||||||
features += "<mechanism>EXTERNAL</mechanism>";
|
features += "<mechanism>EXTERNAL</mechanism>";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -496,7 +508,7 @@ open_stream(XMLNode node) {
|
|||||||
|
|
||||||
// overrides certificate_check_jabbername from common.c with a function
|
// overrides certificate_check_jabbername from common.c with a function
|
||||||
// that is approproate for authenticating users
|
// that is approproate for authenticating users
|
||||||
certificate_check_jabbername(name, cert) {
|
certificate_check_jabbername(name, certinfo) {
|
||||||
// plan: prefer subjectAltName:id-on-xmppAddr,
|
// plan: prefer subjectAltName:id-on-xmppAddr,
|
||||||
// but allow email (1.2.840.113549.1.9.1)
|
// but allow email (1.2.840.113549.1.9.1)
|
||||||
// and subjectAltName:rfc822Name
|
// and subjectAltName:rfc822Name
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// $Id: user.c,v 1.293 2008/04/15 19:18:12 lynx Exp $ // vim:syntax=lpc:ts=8
|
// $Id: user.c,v 1.303 2008/09/12 15:54:39 lynx Exp $ // vim:syntax=lpc:ts=8
|
||||||
#include "jabber.h"
|
#include "jabber.h"
|
||||||
#include "user.h"
|
#include "user.h"
|
||||||
#include "person.h"
|
#include "person.h"
|
||||||
@ -6,9 +6,9 @@
|
|||||||
#include <peers.h>
|
#include <peers.h>
|
||||||
|
|
||||||
// important to #include user.h first
|
// important to #include user.h first
|
||||||
// then we also repatch JABBER_HOST so disco.c does the right thing for us
|
// then we also repatch _host_XMPP so disco.c does the right thing for us
|
||||||
#undef JABBER_HOST
|
#undef _host_XMPP
|
||||||
#define JABBER_HOST SERVER_HOST
|
#define _host_XMPP SERVER_HOST
|
||||||
|
|
||||||
volatile string prefix; // used anywhere?
|
volatile string prefix; // used anywhere?
|
||||||
volatile string tag;
|
volatile string tag;
|
||||||
@ -42,6 +42,7 @@ msg(source, mc, data, mapping vars, showingLog) {
|
|||||||
int ret;
|
int ret;
|
||||||
string jid, buddy;
|
string jid, buddy;
|
||||||
string packet;
|
string packet;
|
||||||
|
mixed t;
|
||||||
|
|
||||||
P2(("%s beim jabber:user:msg\n", mc))
|
P2(("%s beim jabber:user:msg\n", mc))
|
||||||
// net/group/master says we should copy vars if we need to
|
// net/group/master says we should copy vars if we need to
|
||||||
@ -124,11 +125,25 @@ msg(source, mc, data, mapping vars, showingLog) {
|
|||||||
mc = "_notice_place_leave";
|
mc = "_notice_place_leave";
|
||||||
}
|
}
|
||||||
switch (mc) {
|
switch (mc) {
|
||||||
#ifndef EXPERIMENTAL
|
case "_status_person_present":
|
||||||
|
case "_status_person_present_implied":
|
||||||
case "_status_person_absent":
|
case "_status_person_absent":
|
||||||
case "_status_person_absent_recorded":
|
case "_status_person_absent_recorded":
|
||||||
return;
|
PT(("%O got %O\n", ME, mc))
|
||||||
#endif
|
|
||||||
|
// actually.. we never send _time_idle with this
|
||||||
|
if (member(vars, "_time_idle")) {
|
||||||
|
t = vars["_time_idle"];
|
||||||
|
if (stringp(t)) {
|
||||||
|
t = to_int(t);
|
||||||
|
PT(("_time_idle %O == %O, right?\n", vars["_time_idle"], t))
|
||||||
|
}
|
||||||
|
t = gmtime(time() - t);
|
||||||
|
vars["_INTERNAL_time_jabber"] = JABBERTIME(t);
|
||||||
|
} else {
|
||||||
|
vars["_INTERNAL_time_jabber"] = JABBERTIME(gmtime(time()));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "_notice_friendship_established":
|
case "_notice_friendship_established":
|
||||||
// TODO:
|
// TODO:
|
||||||
// it should be checked that this request is valid
|
// it should be checked that this request is valid
|
||||||
@ -270,7 +285,7 @@ presence(XMLNode node) {
|
|||||||
if (!isplacemsg && getchild(node, "x", "http://jabber.org/protocol/muc#user")) {
|
if (!isplacemsg && getchild(node, "x", "http://jabber.org/protocol/muc#user")) {
|
||||||
isplacemsg = 2;
|
isplacemsg = 2;
|
||||||
}
|
}
|
||||||
/* directed presence */
|
#ifndef _flag_disable_presence_directed_XMPP
|
||||||
if (node["@to"]) {
|
if (node["@to"]) {
|
||||||
target = jid2unl(node["@to"]);
|
target = jid2unl(node["@to"]);
|
||||||
if (isplacemsg) {
|
if (isplacemsg) {
|
||||||
@ -279,54 +294,56 @@ presence(XMLNode node) {
|
|||||||
if (node["@type"] == "unavailable") {
|
if (node["@type"] == "unavailable") {
|
||||||
P2(("requesting to leave %O\n", target))
|
P2(("requesting to leave %O\n", target))
|
||||||
placeRequest(target,
|
placeRequest(target,
|
||||||
#ifdef SPEC
|
# ifdef SPEC
|
||||||
"_request_context_leave"
|
"_request_context_leave"
|
||||||
#else
|
# else
|
||||||
"_request_leave"
|
"_request_leave"
|
||||||
#endif
|
# endif
|
||||||
, 1);
|
, 1);
|
||||||
place = 0; // should we do it when we receive the notice?
|
place = 0; // should we do it when we receive the notice?
|
||||||
// anyway, w/out this we show up as still being
|
// anyway, w/out this we show up as still being
|
||||||
// in that room in /p
|
// in that room in /p
|
||||||
} else {
|
} else {
|
||||||
#ifdef ENTER_MEMBERS
|
# ifdef ENTER_MEMBERS
|
||||||
// TODO: this might be needed and should work for remote rooms
|
// TODO: this might be needed and should work for remote rooms
|
||||||
// doing it in local rooms is a bad idea
|
// doing it in local rooms is a bad idea
|
||||||
if (is_formal(target))
|
if (is_formal(target))
|
||||||
placeRequest(target,
|
placeRequest(target,
|
||||||
# ifdef SPEC
|
# ifdef SPEC
|
||||||
"_request_context_enter"
|
"_request_context_enter"
|
||||||
# else
|
# else
|
||||||
"_request_enter"
|
"_request_enter"
|
||||||
# endif
|
# endif
|
||||||
"_again", 0, 1, ([
|
"_again", 0, 1, ([
|
||||||
"_nick" : MYNICK,
|
"_nick" : MYNICK,
|
||||||
"_nick_local" : u[UResource]
|
"_nick_local" : u[UResource]
|
||||||
]));
|
]));
|
||||||
else
|
else
|
||||||
placeRequest(target,
|
placeRequest(target,
|
||||||
# ifdef SPEC
|
# ifdef SPEC
|
||||||
"_request_context_enter"
|
"_request_context_enter"
|
||||||
# else
|
# else
|
||||||
"_request_enter"
|
"_request_enter"
|
||||||
# endif
|
# endif
|
||||||
"_again", 0, 1);
|
"_again", 0, 1);
|
||||||
#else
|
# else
|
||||||
P2(("teleporting to %O\n", target))
|
P2(("teleporting to %O\n", target))
|
||||||
teleport(target, "_join", 0, 1);
|
teleport(target, "_join", 0, 1);
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
# ifndef _flag_disable_module_friendship
|
||||||
} else if (node["@type"] == "subscribe") {
|
} else if (node["@type"] == "subscribe") {
|
||||||
// was: friend(({ jid2unl(node["@to"]) }), 0);
|
// was: friend(({ jid2unl(node["@to"]) }), 0);
|
||||||
friend(0, jid2unl(node["@to"]));
|
friend(0, jid2unl(node["@to"]));
|
||||||
} else if (node["@type"] == "unsubscribe") {
|
} else if (node["@type"] == "unsubscribe") {
|
||||||
friend(1, jid2unl(node["@to"]));
|
friend(1, jid2unl(node["@to"]));
|
||||||
|
# endif // _flag_disable_module_friendship
|
||||||
} else if (abbrev(XMPP, target)) {
|
} else if (abbrev(XMPP, target)) {
|
||||||
// if the person is not on our buddylist,
|
// if the person is not on our buddylist,
|
||||||
// this is usually a muc join
|
// this is usually a muc join
|
||||||
// but i am not sure if there are other uses of
|
// but i am not sure if there are other uses of
|
||||||
// presence in jabber
|
// presence in jabber
|
||||||
#ifdef JABBER_TRANSPARENCY
|
# ifdef JABBER_TRANSPARENCY
|
||||||
mapping vars = ([ "_nick" : MYNICK ]);
|
mapping vars = ([ "_nick" : MYNICK ]);
|
||||||
mixed *u = parse_uniform(XMPP + node["@to"]);
|
mixed *u = parse_uniform(XMPP + node["@to"]);
|
||||||
P3(("jtranz presence to %O\n", target))
|
P3(("jtranz presence to %O\n", target))
|
||||||
@ -339,7 +356,7 @@ presence(XMLNode node) {
|
|||||||
// unless(mappingp(presence_out)) presence_out = ([ ]);
|
// unless(mappingp(presence_out)) presence_out = ([ ]);
|
||||||
vars["_jabber_XML"] = innerxml;
|
vars["_jabber_XML"] = innerxml;
|
||||||
|
|
||||||
// TODO: wir fliegen wir mit JABBER_HOST auf die
|
// TODO: wir fliegen wir mit _host_XMPP auf die
|
||||||
// NASE.
|
// NASE.
|
||||||
// wir muessen die resource in die vars stecken...
|
// wir muessen die resource in die vars stecken...
|
||||||
vars["_INTERNAL_source_jabber"] = myjidresource;
|
vars["_INTERNAL_source_jabber"] = myjidresource;
|
||||||
@ -356,14 +373,15 @@ presence(XMLNode node) {
|
|||||||
"[_nick] is sending you a jabber presence.",
|
"[_nick] is sending you a jabber presence.",
|
||||||
vars);
|
vars);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
} else {
|
} else {
|
||||||
// TODO: what can we do in this case?
|
// TODO: what can we do in this case?
|
||||||
// we can look at our buddylist, if target is a member
|
// we can look at our buddylist, if target is a member
|
||||||
// then this is a directed presence
|
// then this is a directed presence
|
||||||
}
|
}
|
||||||
} /* end of directed presence handling */
|
} /* end of directed presence handling */
|
||||||
|
#endif // _flag_disable_presence_directed_XMPP
|
||||||
|
#ifdef AVAILABILITY_AWAY
|
||||||
else if (node["/show"]) {
|
else if (node["/show"]) {
|
||||||
// else this is one of the so-called "presence broadcasts"
|
// else this is one of the so-called "presence broadcasts"
|
||||||
// we will never support stupid broadcasts although we could
|
// we will never support stupid broadcasts although we could
|
||||||
@ -393,6 +411,7 @@ presence(XMLNode node) {
|
|||||||
// TODO: quiet?
|
// TODO: quiet?
|
||||||
announce(AVAILABILITY_HERE);
|
announce(AVAILABILITY_HERE);
|
||||||
}
|
}
|
||||||
|
#endif // AVAILABILITY_AWAY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -592,6 +611,7 @@ iq(XMLNode node) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#if !defined(REGISTERED_USERS_ONLY) && !defined(_flag_disable_registration_XMPP)
|
||||||
case "jabber:iq:register":
|
case "jabber:iq:register":
|
||||||
switch(node["@type"]) {
|
switch(node["@type"]) {
|
||||||
case "get":
|
case "get":
|
||||||
@ -632,6 +652,7 @@ iq(XMLNode node) {
|
|||||||
case "error":
|
case "error":
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif // jabber:iq:register
|
||||||
case "jabber:iq:roster":
|
case "jabber:iq:roster":
|
||||||
switch(node["@type"]) {
|
switch(node["@type"]) {
|
||||||
case "get":
|
case "get":
|
||||||
@ -716,8 +737,10 @@ iq(XMLNode node) {
|
|||||||
helper = helper["/item"];
|
helper = helper["/item"];
|
||||||
if (helper && helper["@subscription"] == "remove") {
|
if (helper && helper["@subscription"] == "remove") {
|
||||||
string buddy = jid2unl(helper["@jid"]);
|
string buddy = jid2unl(helper["@jid"]);
|
||||||
|
#ifndef _flag_disable_module_friendship
|
||||||
P2(("remove %O from roster\n", helper["@jid"]))
|
P2(("remove %O from roster\n", helper["@jid"]))
|
||||||
friend(1, buddy);
|
friend(1, buddy);
|
||||||
|
#endif
|
||||||
m_delete(xbuddylist, buddy);
|
m_delete(xbuddylist, buddy);
|
||||||
emit(sprintf("<iq type='result' id='%s'/>", tag));
|
emit(sprintf("<iq type='result' id='%s'/>", tag));
|
||||||
} else {
|
} else {
|
||||||
@ -806,11 +829,14 @@ iq(XMLNode node) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "http://jabber.org/protocol/disco#items":
|
case "http://jabber.org/protocol/disco#items":
|
||||||
|
// send a list of rooms to the client
|
||||||
switch(node["@type"]) {
|
switch(node["@type"]) {
|
||||||
case "get":
|
case "get":
|
||||||
if (!node["@to"])
|
if (!node["@to"])
|
||||||
|
// "my" places - let person.c handle this
|
||||||
sendmsg(ME, "_request_list_item", 0, vars);
|
sendmsg(ME, "_request_list_item", 0, vars);
|
||||||
else if (is_localhost(lower_case(node["@to"])))
|
else if (is_localhost(lower_case(node["@to"])))
|
||||||
|
// server's places - let root.c handle this
|
||||||
sendmsg("/", "_request_list_item", 0, vars);
|
sendmsg("/", "_request_list_item", 0, vars);
|
||||||
/* else... TODO */
|
/* else... TODO */
|
||||||
break;
|
break;
|
||||||
@ -833,6 +859,9 @@ iq(XMLNode node) {
|
|||||||
"<query xmlns='jabber:iq:private'>"
|
"<query xmlns='jabber:iq:private'>"
|
||||||
"<storage xmlns='storage:bookmarks'>",
|
"<storage xmlns='storage:bookmarks'>",
|
||||||
tag);
|
tag);
|
||||||
|
// hey wait.. we are sending the list of places here..
|
||||||
|
// why is it i have never seen a jabber client actually
|
||||||
|
// executing autojoins? FIXME
|
||||||
if (v("subscriptions"))
|
if (v("subscriptions"))
|
||||||
foreach (string s in v("subscriptions")) {
|
foreach (string s in v("subscriptions")) {
|
||||||
string jid;
|
string jid;
|
||||||
@ -1078,7 +1107,7 @@ string jid2unl(string jid) {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
# if 1
|
# if 1
|
||||||
else if (ISPLACEMSG(node)) {
|
else if (strlen(node) && ISPLACEMSG(node)) {
|
||||||
return "psyc://" + host + "/@" + PREFIXFREE(node);
|
return "psyc://" + host + "/@" + PREFIXFREE(node);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
@ -1199,12 +1228,17 @@ w(string mc, string data, mapping vars, mixed source) {
|
|||||||
case "_notice_list_feature_place":
|
case "_notice_list_feature_place":
|
||||||
case "_notice_list_feature_server":
|
case "_notice_list_feature_server":
|
||||||
case "_notice_list_feature_newsfeed":
|
case "_notice_list_feature_newsfeed":
|
||||||
|
#ifndef _flag_disable_query_server
|
||||||
mixed id2jabber = shared_memory("disco_identity");
|
mixed id2jabber = shared_memory("disco_identity");
|
||||||
mixed feat2jabber = shared_memory("disco_features");
|
mixed feat2jabber = shared_memory("disco_features");
|
||||||
|
unless (mappingp(id2jabber)) return 1;
|
||||||
vars["_identity"] = id2jabber[vars["_identity"]] || vars["_identity"];
|
vars["_identity"] = id2jabber[vars["_identity"]] || vars["_identity"];
|
||||||
vars["_list_feature"] = implode(map(vars["_list_feature"],
|
vars["_list_feature"] = implode(map(vars["_list_feature"],
|
||||||
(: return "<feature var='" + feat2jabber[$1] + "'/>"; :)), "");
|
(: return "<feature var='" + feat2jabber[$1] + "'/>"; :)), "");
|
||||||
break;
|
break;
|
||||||
|
#else
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
case "_notice_list_item":
|
case "_notice_list_item":
|
||||||
t = "";
|
t = "";
|
||||||
// same stuff in user.c (what happened to code sharing?)
|
// same stuff in user.c (what happened to code sharing?)
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
// $Id: lastlog.c,v 1.28 2008/04/12 22:57:17 lynx Exp $ // vim:syntax=lpc
|
// $Id: lastlog.c,v 1.29 2008/07/17 17:09:15 lynx Exp $ // vim:syntax=lpc
|
||||||
//
|
//
|
||||||
// generic implementation of a log of last messages,
|
// generic implementation of a log of last messages,
|
||||||
// also known as lastlog in irc tradition
|
// also known as lastlog in irc tradition
|
||||||
// stores log in a non-static variable ready for save_object
|
// stores log in a non-static variable ready for save_object
|
||||||
// used by user.c for /log and storic.c for /history in rooms
|
// used by user.c for /log and storic.c for /history in rooms
|
||||||
// memory allocation could be improved in a similar way to net/queue.c
|
// memory allocation could be improved in a similar way to net/queue.c
|
||||||
//
|
|
||||||
|
// local debug messages - turn them on by using psyclpc -DDlastlog=<level>
|
||||||
|
#ifdef Dlastlog
|
||||||
|
# undef DEBUG
|
||||||
|
# define DEBUG Dlastlog
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
|
||||||
protected array(mixed) _log;
|
protected array(mixed) _log;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
// vim:foldmethod=marker:syntax=lpc:noexpandtab
|
||||||
// $Id: library.i,v 1.335 2008/02/18 20:52:00 lynx Exp $
|
// $Id: library.i,v 1.344 2008/09/12 15:54:38 lynx Exp $
|
||||||
|
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <services.h>
|
#include <services.h>
|
||||||
#include <person.h>
|
#include <person.h>
|
||||||
#include <url.h>
|
#include <url.h>
|
||||||
|
|
||||||
#ifdef SERVER_URL
|
#ifdef _uniform_node
|
||||||
# define myUNL SERVER_URL
|
# define myUNL _uniform_node
|
||||||
#else
|
#else
|
||||||
volatile string myUNL;
|
volatile string myUNL;
|
||||||
#endif
|
#endif
|
||||||
@ -54,7 +54,7 @@ varargs int register_target(string uniform, vaobject handler, vaint shy) {
|
|||||||
unless (uniform)
|
unless (uniform)
|
||||||
raise_error("register_target without uniform\n");
|
raise_error("register_target without uniform\n");
|
||||||
#endif
|
#endif
|
||||||
#if 0 //def BETA
|
#if 0
|
||||||
if (query_server_unl() == uniform)
|
if (query_server_unl() == uniform)
|
||||||
raise_error("register_target for root!?\n");
|
raise_error("register_target for root!?\n");
|
||||||
#endif
|
#endif
|
||||||
@ -142,10 +142,8 @@ static void create() {
|
|||||||
ME->base64_self_test();
|
ME->base64_self_test();
|
||||||
if (md5("foobar") != "3858f62230ac3c915f300c664312c63f")
|
if (md5("foobar") != "3858f62230ac3c915f300c664312c63f")
|
||||||
raise_error("MD5 is br0ken!!11!!!\n");
|
raise_error("MD5 is br0ken!!11!!!\n");
|
||||||
# if __VERSION_MINOR__ > 3 || __VERSION_MICRO__ > 610
|
# ifndef _flag_disable_authentication_digest_MD5
|
||||||
sasl_test();
|
sasl_test();
|
||||||
# else
|
|
||||||
# echo SASL digest-md5 currently disabled for old LDMUDs.
|
|
||||||
# endif
|
# endif
|
||||||
//P4(("%O\n", make_json( ([ 7:"33\n44\t21", "!":93 ]) )))
|
//P4(("%O\n", make_json( ([ 7:"33\n44\t21", "!":93 ]) )))
|
||||||
printf("Testing make_json: Is %O equal to %O ?\n",
|
printf("Testing make_json: Is %O equal to %O ?\n",
|
||||||
@ -260,10 +258,10 @@ static void create() {
|
|||||||
#endif
|
#endif
|
||||||
#ifdef JABBER_PATH
|
#ifdef JABBER_PATH
|
||||||
register_target("xmpp:"+ myLowerCaseHost);
|
register_target("xmpp:"+ myLowerCaseHost);
|
||||||
# ifdef JABBER_HOST
|
# ifdef _host_XMPP
|
||||||
register_localhost(lower_case(JABBER_HOST));
|
register_localhost(lower_case(_host_XMPP));
|
||||||
register_target(lower_case(JABBER_HOST));
|
register_target(lower_case(_host_XMPP));
|
||||||
register_target("xmpp:"+ lower_case(JABBER_HOST));
|
register_target("xmpp:"+ lower_case(_host_XMPP));
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
// base64decode("test2000");
|
// base64decode("test2000");
|
||||||
@ -472,7 +470,7 @@ string is_formal(string nicki) {
|
|||||||
// for this person (psyc, xmpp, mailto..)
|
// for this person (psyc, xmpp, mailto..)
|
||||||
//
|
//
|
||||||
# echo We don't get here anyway.
|
# echo We don't get here anyway.
|
||||||
# if 1 //def EXPERIMENTAL
|
# if 1
|
||||||
if (index(nicki, ':') != -1 || index(nicki, '.') != -1)
|
if (index(nicki, ':') != -1 || index(nicki, '.') != -1)
|
||||||
return nicki;
|
return nicki;
|
||||||
# else
|
# else
|
||||||
@ -590,6 +588,7 @@ string legal_mailto(string a) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef hex2int
|
||||||
// thanks to saga this does now convert hex to integer.. :)
|
// thanks to saga this does now convert hex to integer.. :)
|
||||||
//
|
//
|
||||||
// modern ldmud now offers hex2int in form of
|
// modern ldmud now offers hex2int in form of
|
||||||
@ -614,6 +613,7 @@ int hex2int(string hex) {
|
|||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// only used by /lu these days
|
// only used by /lu these days
|
||||||
@ -717,14 +717,12 @@ varargs mixed sendmsg(mixed target, string mc, mixed data, vamapping vars,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
unless (source) source = previous_object();
|
unless (source) source = previous_object();
|
||||||
//#ifndef EXPERIMENTAL
|
|
||||||
// entity.c doesn't allow vars to be missing so we might
|
// entity.c doesn't allow vars to be missing so we might
|
||||||
// just aswell enforce it in the whole psyced source that
|
// just aswell enforce it in the whole psyced source that
|
||||||
// vars always need to be given as mapping. TODO
|
// vars always need to be given as mapping. TODO
|
||||||
// i changed the behaviour of entity.c because vars are missing
|
// i changed the behaviour of entity.c because vars are missing
|
||||||
// everywhere..
|
// everywhere..
|
||||||
unless (mappingp(vars)) vars = ([]);
|
unless (mappingp(vars)) vars = ([]);
|
||||||
//#endif
|
|
||||||
#ifdef TAGGING
|
#ifdef TAGGING
|
||||||
/* <fippo> I dont remember exactly why I did not want this
|
/* <fippo> I dont remember exactly why I did not want this
|
||||||
* for stringp sources... but for pushback, it should
|
* for stringp sources... but for pushback, it should
|
||||||
@ -795,6 +793,18 @@ varargs mixed sendmsg(mixed target, string mc, mixed data, vamapping vars,
|
|||||||
return psyc_sendmsg(target, mc, data, vars,
|
return psyc_sendmsg(target, mc, data, vars,
|
||||||
showingLog, source, u);
|
showingLog, source, u);
|
||||||
#endif
|
#endif
|
||||||
|
case 0:
|
||||||
|
#ifdef DEVELOPMENT
|
||||||
|
raise_error("scheme 0 is a bug\n");
|
||||||
|
//
|
||||||
|
// TODO: we had this error, and maybe it's
|
||||||
|
// because user@host addressing does get here
|
||||||
|
// so i'm not completely sure it is the right
|
||||||
|
// thing to do to just treat it like xmpp, but
|
||||||
|
// let's give that a try.
|
||||||
|
#endif
|
||||||
|
//
|
||||||
|
// fall thru
|
||||||
case "xmpp":
|
case "xmpp":
|
||||||
#ifdef SWITCH2PSYC
|
#ifdef SWITCH2PSYC
|
||||||
P4(("LOOKing for %O in %O\n",
|
P4(("LOOKing for %O in %O\n",
|
||||||
@ -829,8 +839,6 @@ varargs mixed sendmsg(mixed target, string mc, mixed data, vamapping vars,
|
|||||||
o -> msg(source, mc, data, vars);
|
o -> msg(source, mc, data, vars);
|
||||||
return 3;
|
return 3;
|
||||||
#endif
|
#endif
|
||||||
case 0:
|
|
||||||
raise_error("scheme 0 is a bug\n");
|
|
||||||
}
|
}
|
||||||
if (schemes[u[UScheme]])
|
if (schemes[u[UScheme]])
|
||||||
return schemes[u[UScheme]]->msg(source,
|
return schemes[u[UScheme]]->msg(source,
|
||||||
@ -918,10 +926,8 @@ varargs mixed sendmsg(mixed target, string mc, mixed data, vamapping vars,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (objectp(target)) {
|
if (objectp(target)) {
|
||||||
// returnwert sagt aus, ob msg dargestellt werden will
|
|
||||||
// nicht aber, dass sie erfolgreich angekommen ist, denn das ist ja eh
|
|
||||||
target -> msg(source, mc, data, vars, showingLog);
|
target -> msg(source, mc, data, vars, showingLog);
|
||||||
// deshalb machen wir das lieber selber klar
|
// make sure msg is treated as successfully delivered:
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
D2(else D(S("sendmsg encountered %O as target for (%O,%s,%O,%O)\n",
|
D2(else D(S("sendmsg encountered %O as target for (%O,%s,%O,%O)\n",
|
||||||
@ -1081,7 +1087,7 @@ varargs int sendmsg(mixed target, string mc, mixed data, mapping vars,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
unless (source) source = previous_object();
|
unless (source) source = previous_object();
|
||||||
#ifndef EXPERIMENTAL
|
#ifndef GAMMA
|
||||||
// entity.c doesn't allow vars to be missing so we might
|
// entity.c doesn't allow vars to be missing so we might
|
||||||
// just aswell enforce it in the whole psyced source that
|
// just aswell enforce it in the whole psyced source that
|
||||||
// vars always need to be given as mapping. TODO
|
// vars always need to be given as mapping. TODO
|
||||||
|
@ -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
|
it: profiles.c
|
||||||
|
|
||||||
profiles.c: profiles.pl
|
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
|
// admin functions and shutdown procedure
|
||||||
//
|
//
|
||||||
@ -42,7 +42,7 @@ varargs int server_shutdown(string reason, int restart, int pass) {
|
|||||||
#ifdef DEFAULT_SHUTDOWN_REASON
|
#ifdef DEFAULT_SHUTDOWN_REASON
|
||||||
reason = DEFAULT_SHUTDOWN_REASON;
|
reason = DEFAULT_SHUTDOWN_REASON;
|
||||||
#else
|
#else
|
||||||
reason = CHATNAME " is performing a quick full twist double "
|
reason = SERVER_HOST " is performing a quick full twist double "
|
||||||
"salto backwards.";
|
"salto backwards.";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// vim:syntax=lpc
|
// vim:syntax=lpc
|
||||||
// info: to unfold and view the complete file, hit zR in your vim command mode.
|
// 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
|
// {{{ meta-bla about foldmethod=marker
|
||||||
// <lynX> hm.. find ich folding jetzt eher nützlich oder lästig? muss ich
|
// <lynX> hm.. find ich folding jetzt eher nützlich oder lästig? muss ich
|
||||||
@ -53,9 +53,9 @@ volatile mapping localhosts = ([
|
|||||||
#endif
|
#endif
|
||||||
// the hostnames need to be in lowercase... lets do it later
|
// the hostnames need to be in lowercase... lets do it later
|
||||||
// SERVER_HOST : 1,
|
// SERVER_HOST : 1,
|
||||||
#if defined(JABBER_HOST)
|
#if defined(_host_XMPP)
|
||||||
# if JABBER_HOST != SERVER_HOST
|
# if _host_XMPP != SERVER_HOST
|
||||||
// JABBER_HOST : 1,
|
// _host_XMPP : 1,
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
]);
|
]);
|
||||||
|
@ -72,7 +72,9 @@ string make_json(mixed d) {
|
|||||||
P3(("\nintermediate: %O\n", m_values(x)))
|
P3(("\nintermediate: %O\n", m_values(x)))
|
||||||
return "{"+ implode(m_values(x), ",") +"}";
|
return "{"+ implode(m_values(x), ",") +"}";
|
||||||
#endif
|
#endif
|
||||||
}
|
} else if (objectp(d))
|
||||||
|
return "\'"+ psyc_name(d) +"\'";
|
||||||
|
return "00";
|
||||||
}
|
}
|
||||||
|
|
||||||
// see also net/place/storic.c for a JSON generator limited and optimized
|
// see also net/place/storic.c for a JSON generator limited and optimized
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// vim:syntax=lpc
|
// 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.
|
// I really hate those comments.
|
||||||
//
|
//
|
||||||
@ -107,6 +107,9 @@ PROTECTED void back() {
|
|||||||
myIndex -= 1;
|
myIndex -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GAMMA
|
||||||
|
// funny.. we already have two better ways to do hex2int than this:
|
||||||
|
//
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the hex value of a character (base16).
|
/// Get the hex value of a character (base16).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -130,6 +133,7 @@ PROTECTED int dehexchar(int c) {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determine if the source string still contains characters that next() can consume.
|
/// Determine if the source string still contains characters that next() can consume.
|
||||||
@ -331,12 +335,17 @@ PROTECTED varargs string unescape(string s)
|
|||||||
if (c == '+') {
|
if (c == '+') {
|
||||||
c = ' ';
|
c = ' ';
|
||||||
} else if (c == '%' && (i + 2 < len)) {
|
} else if (c == '%' && (i + 2 < len)) {
|
||||||
|
#ifndef GAMMA
|
||||||
int d = dehexchar(s[i+1]);
|
int d = dehexchar(s[i+1]);
|
||||||
int e = dehexchar(s[i+2]);
|
int e = dehexchar(s[i+2]);
|
||||||
if (d >= 0 && e >= 0) {
|
if (d >= 0 && e >= 0) {
|
||||||
c = (d*16 + e);
|
c = (d*16 + e);
|
||||||
i += 2;
|
i += 2;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
i += 2;
|
||||||
|
c = hex2int(s[i-1 .. i]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
sb+=int2char(c);
|
sb+=int2char(c);
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user