Merge commit 'origin'

This commit is contained in:
psyc://psyced.org/~lynX 2009-10-15 11:51:45 +02:00
commit 28148762a4
22 changed files with 233 additions and 87 deletions

View File

@ -21,6 +21,14 @@ ________________________________________________________________________
________________________________________________________________________
== currently being inspected ===========================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
? /ve/TODO/leave-from-user
- newbies are allowed to open new owned rooms
fippo sagt: ergo brauchst du nen exit-hook der owner löscht wenn der n00b-owner aus dem raum geht
- double _link does produce an _unlink to the old client, but not the proper
place enter events..?
- jabber logout isn't announced or offline avail isn't processed
... apparently other side did not logout properly, as it doesn't happen always
@ -60,6 +68,29 @@ ________________________________________________________________________
tgX sagt: on reconnect i didn't get any _echo_place_enter_login's from this room, then no response for _request_do_enter, and after a _request_do_leave i get replies for enter/leave but instead of _echo_place_enter/leave i get _notice_place_enter/leave
? should /load inform that errors go to the console?
________________________________________________________________________
:_group psyc://psyced.org/@welcome
:_source_identification psyc://xxx.no-ip.org/~xxx
:_tag msg_406
_request_do_message
bug!
.
:_source_relay psyc://xxx.no-ip.org/~0
:_context psyc://psyced.org/@welcome
:_nick_place psyc://psyced.org/@welcome
:_nick xxx
:_time_INTERNAL 1245932297
_message_echo_public
bug!
.
In welcome spricht «psyc://xxx.no-ip.org/~0» xxx: the bug in the scratchpad. why psyced echoes packets to "~0" instead of my real account? the same thing is for echo_private
In welcome spricht «psyc://xxx.no-ip.org/~0» xxx: it should either ignore first packet (if psyced is sure that i'm not authorized with password) or return echo to that account instead of misterious "0"
________________________________________________________________________
== psyced 1.0 ==========================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
@ -292,7 +323,9 @@ ________________________________________________________________________
- move templates from source code into default/en/plain.textdb
.. maybe write an automation to do it? they're just too many!
run more mailcast gateways!! on psyced.org? or elsewhere?
+ run more mailcast gateways!! on psyced.org? or elsewhere?
like.. gateway for email alerts from http://www.dernewsticker.de/
and google alerts obviously
- /log 9999999999 produces
Numeric overflow: 1410065407 *= 4
@ -340,6 +373,12 @@ WINDOWS DISTRIBUTION
? how can we compile SRV into erq.exe? do we care?
? which open source installer for win to use?
? what to do about psyconf.. include perl or re-implement psyconf for win?
TWITTER
+ resolve redirect-urls before forwarding to subscriptions, that means,
calling http/fetch on http://tr.im/whatever urls until it no longer
returns a 30x redirection code. [improves privacy btw, since all those
redirect services log your access for the one who installs them]
________________________________________________________________________
== OTHER MAJOR TODOS ===================================================
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
@ -3929,3 +3968,7 @@ http/fetch
- minor api cleanups to serve a more generic job
library/dns
+ honor #define _flag_disable_trust_localhost
net/irc
- bugfix from fippo concerning alias interpretation
include/net.h
- the efun has changed from stringprep() to idna_stringprep()

View File

@ -34,7 +34,10 @@ exit
enable_use_json=yes
# compile expat xml & xmpp parser in, if available
enable_use_expat=yes
enable_use_expat=no
# compile iksemel parser in, if available
enable_use_iksemel=no
# enable this if you want use http://about.psyc.eu/psyclpc#Authlocal
enable_use_authlocal=yes

View File

@ -1021,14 +1021,14 @@ _IRC_encrypted = $IRCS_PORT
_HTTP = $HTTP_PORT
_HTTP_encrypted = $HTTPS_PORT
_applet = $APPLET_PORT
_SMTP = $SMTP_PORT
_SMTP_encrypted = $SMTPS_PORT
; Experimental protocol services
;_SMTP = $SMTP_PORT
;_SMTP_encrypted = $SMTPS_PORT
;_POP3 = $POP3_PORT
;_POP3_encrypted = $POP3S_PORT
;_NNTP = $NNTP_PORT
;_NNTP_encrypted = $NNTPS_PORT
_POP3 = $POP3_PORT
_POP3_encrypted = $POP3S_PORT
_NNTP = $NNTP_PORT
_NNTP_encrypted = $NNTPS_PORT
[_optional]
; Enable web-based configuration tool
@ -1079,7 +1079,7 @@ then
echo "Creating $BASE_DIR..."
if mkdir -m $BASE_PERM -p $BASE_DIR 2> /dev/null
then
;
echo ""; # nop?
else
if test "x$userid" = "xroot"
then

View File

@ -154,13 +154,13 @@ _PAGES_help_display
|<b> /trust </b> Befehl gesondert den Vertrauenswert für diese Person.
|
|<a name="trust" />
|<DT><P><B> /trust &lt;Name&gt; &lt;Ziffer&gt;|- </B></p></dd>
|<DT><P><B> /trust &lt;Name&gt; &lt;Ziffer&gt;|- </B></p><dd>
|Gesonderten Vertrauenswert für eine Person einstellen, unabhängig
|vom Freundschaftszustand. Der Wert darf eine Ziffer von 0 bis 9 annehmen
|oder ein Minuszeichen, um den Normalzustand wieder herzustellen.
|
|<a name="expose" />
|<DT><P><B> /expose &lt;Name&gt; &lt;Ziffer&gt;|- </B></p></dd>
|<DT><P><B> /expose &lt;Name&gt; &lt;Ziffer&gt;|- </B></p><dd>
|Expositionswert für eine Person einstellen. Dieser Faktor bestimmt wie
|hoch ein Vertrauenswert eines Bekannten sein muss, damit er diesen
|Freund beim betrachten des Profils zu sehen bekommt. Mittels
@ -515,7 +515,7 @@ _PAGES_help_room
|die anderen Anwesenden über die Tat des Einladens informieren.
|
|<a name="follow"></a>
|<p><b> /f(ollow) </b></p><dd>
|<dt><p><b> /f(ollow) </b></p><dd>
|Der Empfänger einer Einladung braucht einfach nur <b>/f</b> wie
|<b>/follow</b> einzugeben, um jenen Raum zu betreten. Sollte keine
|Einladung vorliegen, wird in den zuletzt aktiven Raum gewechselt.

View File

@ -236,13 +236,13 @@ _PAGES_help_display
|<b> /trust </b> command to specify a custom trust level for this person.
|
|<a name="trust"></a>
|<DT><P><B> /trust &lt;Name&gt; &lt;Digit&gt;|- </B></p></dd>
|<DT><P><B> /trust &lt;Name&gt; &lt;Digit&gt;|- </B></p><dd>
|Define a custom trust level value for a person. The trust level must
|be a digit ranging from 0 to 9, or a minus character, which will restore
|the default.
|
|<a name="expose"></a>
|<DT><P><B> /expose &lt;Name&gt; &lt;Digit&gt;|- </B></p></dd>
|<DT><P><B> /expose &lt;Name&gt; &lt;Digit&gt;|- </B></p><dd>
|Define the exposure level for a friend. This factor defines how high the
|trust level a person must be, to be enabled to see your friend listed in
|your profile. By issueing <b> /expose Merlin 0 </b> for instance you can
@ -562,7 +562,7 @@ _PAGES_help_room
|invitation.
|
|<a name="follow"></a>
|<p><b> /f(ollow) </b></p><dd>
|<dt><p><b> /f(ollow) </b></p><dd>
|The recipient of an invitation just needs to type <b>/f</b> as in
|<b>/follow</b> to enter the room. If there was no invitation, then
|the last active room is selected.

View File

@ -364,28 +364,28 @@ _notice_place_leave
|<presence type='unavailable' to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]' id='[_tag]'><x xmlns='http://jabber.org/protocol/muc#user'><item affiliation='none' role='none'/></x></presence>
_status_presence_here
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_status_presence_here_talkative
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>chat</show><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>chat</show><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_status_presence_here_busy
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>dnd</show><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>dnd</show><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_status_presence_away
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>away</show><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>away</show><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_status_presence_absent_vacation
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>xa</show><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>xa</show><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_status_presence_absent
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]' type='unavailable'><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]' type='unavailable'><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_status_presence_here_quiet
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'/>
_notice_presence_here
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber_bare]'><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber_bare]'><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_notice_presence_here_plain
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'/>
@ -394,19 +394,19 @@ _notice_presence_here_quiet
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'/>
_notice_presence_here_talkative
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber_bare]'><show>chat</show><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber_bare]'><show>chat</show><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_notice_presence_here_busy
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'><show>dnd</show><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'><show>dnd</show><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_notice_presence_away
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'><show>away</show><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'><show>away</show><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_notice_presence_absent_vacation
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'><show>xa</show><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]'><show>xa</show><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_notice_presence_absent
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]' type='unavailable'><status>[_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
|<presence to='[_INTERNAL_target_jabber_bare]' from='[_INTERNAL_source_jabber]' type='unavailable'><status>[_XML_description_presence]</status><mood xmlns='http://jabber.org/protocol/mood'><[_INTERNAL_mood_jabber]/></mood></presence>
_notice_person_absent_netburp
|<presence to='[_INTERNAL_target_jabber]' from='[_INTERNAL_source_jabber]'><show>xa</show><status>{_notice_person_absent_netburp}</status></presence>

View File

@ -873,6 +873,9 @@ _notice_invitation
_notice_received_email_UNUSED
|([_nick_alias]) [_origin]: [_subject]
_notice_headline_twitter
|([_nick_place]) [_headline]
_notice_headline_news
|([_nick_place]News) [_headline] [_page_news]

View File

@ -153,7 +153,7 @@
#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
//#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

View File

@ -53,17 +53,18 @@
# define DEFAULT_CONTENT_TYPE "text/html; charset=" SYSTEM_CHARSET
#endif
#if __EFUN_DEFINED__(stringprep)
#if __EFUN_DEFINED__(idna_stringprep) && defined(DRIVER_PATH)
// 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>
# include DRIVER_PATH "sys/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))
# define NODEPREP(s) FROM_UTF8(idna_stringprep(TO_UTF8(s), STRINGPREP_XMPP_NODEPREP))
# define NAMEPREP(s) FROM_UTF8(idna_stringprep(TO_UTF8(s), STRINGPREP_NAMEPREP))
# define RESOURCEPREP(s) FROM_UTF8(idna_stringprep(TO_UTF8(s), STRINGPREP_XMPP_RESOURCEPREP))
#else
# echo Warning: using lower_case instead of idna_stringprep!
# define NODEPREP(s) lower_case(s)
# define NAMEPREP(s) lower_case(s)
# define RESOURCEPREP(s) (s)

View File

@ -23,6 +23,27 @@
#define PPL_NOTIFY 1
// this model does not handle the "None + Pending Out/In" state in
// http://xmpp.org/rfcs/rfc3921.html#substates - in psyc, if two
// people intend to subscribe to each other, they are either upgraded
// to friendship aka "Both," or rather - the actual subscription state
// on the other side is not stored here, except for the special case
// of PPL_NOTIFY_OFFERED.
//
// if a full implementation of XMPP requires local storage of whether the
// other side intends to send us presence (even though she can actually do
// whatever she wants, so the information doesn't seem very useful and is
// in fact very likely to go out of sync), we'd have to add a new flag class.
// something like PPL_SUBSCRIBED or PPL_FOLLOW.
//
// this all clashes with the PSYC model of context subscriptions - we should
// throw away all of these PPL_ subscription flags, and model all xmpp
// friendship states with generic context subscriptions - no matter if we
// are dealing with people, places or other pubsub apps. seen from this
// perspective, "None + Pending Out/In" is equivalent to a pair of
// _request_context_subscribe's which haven't been answered yet. we need
// a generic per-entity way to store these states, below user level.
//
#define PPL_NOTIFY_IMMEDIATE '8'
#define PPL_NOTIFY_DEFAULT PPL_NOTIFY_IMMEDIATE
#define PPL_NOTIFY_DELAYED '6'

View File

@ -395,6 +395,9 @@ w(string mc, string data, mapping vars, mixed source) {
} else if (abbrev("_echo_place_enter", mc)) {
vars["_INTERNAL_source_IRC"] = MYNICK + "!" + MYNICK + "@" SERVER_HOST;
#endif
} else if (source == "/") { // new style server root message
vars["_INTERNAL_source_IRC"] = SERVER_HOST;
nick2 = source = SERVER_UNIFORM;
} else {
#ifdef GHOST //{{{
// in S2S mode we are not supposed to deliver nick!user@host
@ -843,7 +846,7 @@ logon() {
// but i guess it is indeed appropriate to make it clear how very much
// different we are from a regular irc server.
//
reply(RPL_ISUPPORT, "PSYC=.99 ALIAS AVAILABILITY FRIEND HISTORY MOOD SHOUT SSET STATUS SUBSCRIBE THREAD TRUST PREFIX= CHANTYPES=# CHANMODES= NICKLEN="+ (string)MAX_UNIFORM_LEN +" CHANNELLEN="+ (string)MAX_UNIFORM_LEN +" CASEMAPPING=ascii TOPICLEN=4404 KICKLEN=4404 AWAYLEN=4404 MAXTARGETS=1 CHARSET="+ (v("charset")||SYSTEM_CHARSET) +" NETWORK=PSYC CTCP=PRESENCE,TS UNIFORMS=psyc,xmpp :are supported by this server");
reply(RPL_ISUPPORT, "PSYC=.99 ALIAS AVAILABILITY FRIEND HISTORY MOOD SHOUT SSET STATUS SUBSCRIBE THREAD TRUST PREFIX= CHANTYPES=# CHANMODES= NICKLEN="+ (string)MAX_UNIFORM_LEN +" CHANNELLEN="+ (string)MAX_UNIFORM_LEN +" CASEMAPPING=ascii TOPICLEN=4404 KICKLEN=4404 AWAYLEN=4404 MAXTARGETS=1 CHARSET="+ (v("charset")||SYSTEM_CHARSET) +" NETWORK=" SERVER_HOST " CTCP=PRESENCE,TS UNIFORMS=psyc,xmpp :are supported by this server");
//
// MAXCHANNELS vs CHANLIMIT - we currently only have a limit on subs
// STD? what the hell is STD?
@ -853,12 +856,15 @@ logon() {
// MAXNICKLEN?
// neue befehle: IGNORE vs SILENCE? SHOW? MASQUERADE?
//
// PSYC as network name is not a #define, since any psyc server is
// a gateway to the complete PSYC. introducing network names here is
// misleading and not useful thing to do. that's why it is statically
// PSYC, nothing more or less.
// NETWORK:=
// We used to have PSYC as the network name, as no matter which
// PSYC server you use, you are always connected to the entire
// PSYCspace. But now we use the hostname as the network name,
// because you may want your IRC client to connect multiple
// identities on multiple hosts and not get confused.
// Maybe we should even use something like user@host at this point.
//
// nei suggests: ALIAS SUBSCRIBE FRIEND SET SSET SILENCE CHANTYPES=# PREFIX= CHANMODES= CMDCHAR=+ ACTIONCHAR=: EINOTIFY=notify LANGUAGE=en CHARSET_PAYLOAD=utf-8 CHARSET=utf-8 NETWORK=psyc UNIFORM_NICK UNIFORM_CHAN
// nei suggests: ALIAS SUBSCRIBE FRIEND SET SSET SILENCE CHANTYPES=# PREFIX= CHANMODES= CMDCHAR=+ ACTIONCHAR=: EINOTIFY=notify LANGUAGE=en CHARSET_PAYLOAD=utf-8 CHARSET=utf-8 NETWORK=... UNIFORM_NICK UNIFORM_CHAN
// 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

View File

@ -296,12 +296,24 @@ render(string mc, string data, mapping vars, mixed source) {
log_file("XMPP_TODO", "%O %s %s\n", ME, mc, output);
#endif
} else {
// hack for a special case where status update contains <, >
// if this kind of problem recurrs, we should quote every
// single damn variable
if (vars["_description_presence"])
vars["_XML_description_presence"] =
xmlquote(vars["_description_presence"]);
if (stringp(data)) data = xmlquote(data);
else if (vars["_action"])
data = "/me " + xmlquote(vars["_action"]);
output = psyctext(template, vars, data, source);
if (!stringp(output) || output=="")
return P2(("jabber:w() no output\n"));
#if 0
if (strstr(output, "r00t") >= 0) {
P0(("common:render(%O, %O, %O, %O) -> %O\n", mc,
data, vars, source, output))
}
#endif
}
#if __EFUN_DEFINED__(convert_charset) && SYSTEM_CHARSET != "UTF-8"
if (catch(output = convert_charset(output,
@ -448,10 +460,11 @@ certificate_check_jabbername(name, cert) {
}
#endif
/* get first child of a node
* used for <iq/>
/* get first child of a node used for <iq/>
* "first" is actually inaccurate, since there is no defined order in mappings,
* so we select the child, that is not an error
*/
getfirstchild(node) {
getiqchild(node) {
mixed res;
foreach(mixed key, mixed val : node) {
unless(stringp(key) && key[0] == '/') continue;

View File

@ -550,6 +550,8 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
vars["_description_presence"] =
(node["/status"] && node["/status"][Cdata]) ?
node["/status"][Cdata] : ""; // "Get psyced!";
vars["_XML_description_presence"] =
xmlquote(vars["_description_presence"]);
vars["_INTERNAL_mood_jabber"] = "neutral";
sendmsg(o, "_notice_presence_absent", 0,
vars, origin);
@ -693,6 +695,8 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
vars["_description_presence"] =
(node["/status"] && node["/status"][Cdata]) ?
node["/status"][Cdata] : ""; // "Get psyced!";
vars["_XML_description_presence"] =
xmlquote(vars["_description_presence"]);
vars["_degree_availability"] = jabber2avail[node["/show"]
&& node["/show"][Cdata]];
// this message is too verbose, let's put in into
@ -716,8 +720,8 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
break;
case "iq":
{
mixed firstchild = getfirstchild(node);
string xmlns = firstchild ? firstchild["@xmlns"] : 0;
mixed iqchild = getiqchild(node);
string xmlns = iqchild ? iqchild["@xmlns"] : 0;
// TODO: maybe this should be handled by several functions
// iq_get, iq_set, iq_result, iq_error
t = node["@type"];
@ -790,8 +794,8 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
break;
}
case "http://jabber.org/protocol/disco#info":
if (firstchild["@node"])
vars["_target_fragment"] = firstchild["@node"];
if (iqchild["@node"])
vars["_target_fragment"] = iqchild["@node"];
if (tu[UUser])
o = FIND_OBJECT(tu[UUser]);
else
@ -807,8 +811,8 @@ jabberMsg(XMLNode node, mixed origin, mixed *su, array(mixed) tu) {
}
break;
case "http://jabber.org/protocol/disco#items":
if (firstchild["@node"])
vars["_target_fragment"] = firstchild["@node"];
if (iqchild["@node"])
vars["_target_fragment"] = iqchild["@node"];
if (tu[UUser])
o = FIND_OBJECT(tu[UUser]);
else

View File

@ -250,11 +250,12 @@ showFriends() {
"_INTERNAL_target_jabber" : myjid,
"_INTERNAL_source_jabber" : mkjid(person),
"_description_presence" : "", // TODO: get these from state
"_XML_description_presence" : "",
"_INTERNAL_mood_jabber" : "neutral"
]));
}
if (strlen(packet)) emit(packet);
PT(("%O jabberish showFriends: %O outputs as %O\n", ME, friends, packet))
P2(("%O jabberish showFriends: %O outputs as %O\n", ME, friends, packet))
}
logon() {
@ -558,7 +559,7 @@ iq(XMLNode node) {
string target;
string friend;
XMLNode helper;
XMLNode firstchild;
XMLNode iqchild;
string t;
string packet;
string template;
@ -569,9 +570,9 @@ iq(XMLNode node) {
target = jid2ppl(node["@to"]);
isplacemsg = stringp(target) && strlen(target) && ISPLACEMSG(target);
P0(("+++ %O IQ node %O\n", ME, node))
firstchild = getfirstchild(node);
unless(firstchild) switch(node["@type"]) {
P3(("+++ %O IQ node %O\n", ME, node))
iqchild = getiqchild(node);
unless(iqchild) switch(node["@type"]) {
case "get":
case "set":
case "result":
@ -581,9 +582,9 @@ iq(XMLNode node) {
P1(("%O got invalid iq %O\n", ME, node))
return;
}
helper = firstchild;
helper = iqchild;
switch(firstchild["@xmlns"]) {
switch(iqchild["@xmlns"]) {
case "jabber:iq:version":
switch(node["@type"]) {
case "get":
@ -978,16 +979,16 @@ iq(XMLNode node) {
packet += "</blocklist></iq>";
break;
case "set":
if (firstchild["/item"] && !nodelistp(firstchild["/item"]))
firstchild["/item"] = ({ firstchild["/item"] });
unless(firstchild["/item"]) { /* clear the blocklist */
if (iqchild["/item"] && !nodelistp(iqchild["/item"]))
iqchild["/item"] = ({ iqchild["/item"] });
unless(iqchild["/item"]) { /* clear the blocklist */
foreach(mixed p, mixed val : ppl) {
if (val[PPL_DISPLAY] == PPL_DISPLAY_NONE)
sPerson(p, PPL_DISPLAY, PPL_DISPLAY_DEFAULT);
}
} else {
int block = firstchild[Tag] == "block";
foreach (helper : firstchild["/item"]) {
int block = iqchild[Tag] == "block";
foreach (helper : iqchild["/item"]) {
/* add/remove each item to/from the blocklist */
if (block) {
/* TODO:
@ -1212,6 +1213,7 @@ varargs string mkjid(mixed who, mixed vars, mixed ignore_nick, mixed ignore_cont
// message rendering a la jabber
w(string mc, string data, mapping vars, mixed source) {
mixed t;
unless (mappingp(vars)) vars = ([]);
else if (vars["_nick_verbatim"]) vars["_nick"] = vars["_nick_verbatim"];
// ^^ this is a temporary workaround until we fix the real problem!
@ -1284,7 +1286,11 @@ w(string mc, string data, mapping vars, mixed source) {
unless (vars["_tag_reply"]) vars["_tag_reply"] = tag;
if (vars["_list_groups"])
vars["_list_groups"] = IMPLODE_XML(vars["_list_groups"], "<group>");
#if 0
if (stringp(data) && strstr(data, "r00t") >= 0) {
P0(("user:w(%O, %O, %O, %O)\n", mc, data, vars, source))
}
#endif
unless (interactive(ME)) {
P1(("%O not interactive. w(%O) from %O.\n", ME, mc, source))
return;

View File

@ -527,7 +527,7 @@ PROTECTED mixed nextObject() {
if ((b >= '0' && b <= '9') || b == '.' || b == '-' || b == '+') {
int a; float b_; string c_;
sscanf(s, "%d%s", a, c_);
if(c_ && sizeof(c_)) {
if ((c_ && sizeof(c_))) {
#ifdef __PIKE__
sscanf(s, "%f", b_);
#else
@ -535,6 +535,18 @@ PROTECTED mixed nextObject() {
#endif
return b_;
}
if (!a || s != to_string(a)) {
// some values of json ints exceed the limits of MAX_INT.
// in that case we tried to use float, but rendering floats
// will produce something like 2.17734e+09 instead of just
// a long integer. we have to return a string here, and risk
// to run into runtime errors. we should probably stop trying
// to convert json integers into ints in the first place.
// javascript and lpc just aren't compatible. do we have a
// bignum package for ldmud?
P3(("Warning: JSON integer too big. Returning %O as string.\n", s))
return s;
}
else return a;
}
if (s == "") {

View File

@ -572,7 +572,13 @@ htget(prot, query, headers, qs, data, noprocess) {
write("\ndocument."+ (query["name"] || MYLOWERNICK)
+ " = new Array(\n");
logView(a, "ecmascript", 15);
write(" \""+ implode(names(), ", ")+"\")\n\n");
write(" \""+ implode(names(), ", ")+"\""
#if defined(ALPHA) && defined(PLACE_TOPIC)
// this adds current topic to data structure
// but probably breaks all psyclog.js code
",\n\t\""+ v("topic") +"\""
#endif
")\n\n");
break;
#if 0
case "json":
@ -1312,7 +1318,7 @@ msg(source, mc, data, mapping vars) {
if (isValidRelay(source)
|| isValidRelay(vars["_source_relay"])
|| isValidRelay(vars["_context"])) {
P1(("yes. cast & out.\n"))
P1(("yes. cast & out: %O in %O\n", source, ME))
return castPresence(source, mc, data, vars,
// don't broadcast the user's presence
!neu || v("_filter_presence"));

View File

@ -177,19 +177,28 @@ static varargs string psyc_render(mixed source, string mc, mixed data,
data = data? to_string(data): "";
#endif
}
else if (data == S_GLYPH_PACKET_DELIMITER || (strlen(data) > 1 &&
else if (data == S_GLYPH_PACKET_DELIMITER ||
# ifdef SPYC
// just some random limit that makes us prefer _length
// over scanning data for illegal characters
strlen(data) > 444 ||
# endif
(strlen(data) > 1 &&
data[0] == C_GLYPH_PACKET_DELIMITER && data[1] == '\n')
|| strstr(data, "\n" S_GLYPH_PACKET_DELIMITER "\n") != -1) {
// this check shouldn't be necessary here: we should check what
// people are typing in usercmd
// we could check what people are typing in usercmd.. then
// again, "illegal" data may also come in from XMPP, and
// anything should be legal in PSYC.. so let's handle it here.
# ifdef SPYC
needLen++;
# else
// old psyc syntax has no clean solution to this problem,
// so we just censor the message. use the new syntax!
P1(("%O: %O tried to send %O via psyc. censored.\n",
previous_object() || ME, vars["_nick"] || vars, data))
data = "*** censored message ***";
return 0;
# endif
# endif
# ifndef NEW_LINE
} else
# ifdef SPYC

View File

@ -187,7 +187,7 @@ int psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
int showingLog, mixed source, array(mixed) u) {
string sname, host, buf, room;
int port, usesrv = 1;
object o;
object ob;
mixed t;
unless (u[UHost]) {
@ -246,15 +246,15 @@ int psyc_sendmsg(mixed target, string mc, mixed data, mapping vars,
if (query_udp_port() == port && is_localhost(host)) {
// this happens when a psyc client sends to a local
// target that hasn't been incarnated yet...
o = find_psyc_object(u);
ob = find_psyc_object(u);
// cache the resulting object for the url
if (o) {
if (ob) {
P2(("psyc_sendmsg registering %O for %O found by parsing uniform\n",
target, o))
register_target(target, o);
target, ob))
register_target(target, ob);
}
#ifndef __PIKE__ // TPD
return sendmsg(o, mc, data, vars, source);
return sendmsg(ob, mc, data, vars, source);
#endif
// or deliver directly?
}

View File

@ -108,11 +108,12 @@ list_sockets(guy, flags) {
#endif
#if __EFUN_DEFINED__(tls_query_connection_info)
tls ? intp(tls[TLS_PROT]) ?
TLS_PROT_NAME(tls[TLS_PROT]) :
tls[TLS_PROT] : "",
TLS_PROT_NAME(tls[TLS_PROT]) ||
to_string(tls[TLS_PROT]) : tls[TLS_PROT] : "",
tls ? intp(tls[TLS_CIPHER]) ?
TLS_CIPHER_NAME(tls[TLS_CIPHER]) :
tls[TLS_CIPHER] : ""
TLS_CIPHER_NAME(tls[TLS_CIPHER])
|| to_string(tls[TLS_CIPHER])
: tls[TLS_CIPHER] : ""
#else
"", ""
#endif

View File

@ -5,7 +5,7 @@
#include <net.h>
persistent int lastid;
persistent mixed lastid;
volatile object feed;
@ -28,18 +28,29 @@ parse(string body, mapping headers) {
P4((body))
//#endif
unless (pointerp(wurst = parse_json(body))) {
P1(("%O failed to parse its timeline.\n", ME))
monitor_report("_failure_network_fetch_twitter_empty",
"[_source] failed to parse its timeline");
return;
}
unless (sizeof(wurst)) {
P1(("%O received an empty structure.\n", ME))
monitor_report("_failure_network_fetch_twitter_empty",
"[_source] received an empty structure.");
return;
}
if (wurst[0]["id"] <= lastid) {
P1(("%O received %d old updates.\n", ME, sizeof(wurst)))
// this used to fail on MAX_INT turning the ints to negative.. it would work for
// a while longer using floats, but since floating point mantissa in lpc is only
// 32 bits wide, it's just a question of time until we hit that roof again (when
// status_id reaches 4294967296). so let's try strings instead. funny to run into
// such a weird problem only after years that twitter has been in existence.
// twitterific may have run into the same problem, as the timing of its breakdown
// matches ours.
if (lastid && wurst[0]["id"] <= lastid) {
P1(("%O received %d old updates (id0 %O <= lastid %O).\n",
ME, sizeof(wurst), wurst[0]["id"], lastid))
return;
}
lastid = wurst[0]["id"];
P2(("%O -- new lastid %O\n", ME, lastid))
save_object(DATA_PATH "twitter");
for (i=sizeof(wurst)-1; i>=0; i--) {
d = wurst[i];
@ -99,7 +110,7 @@ parse(string body, mapping headers) {
}
fetch() {
P1(("%O going to fetch from %O since %O\n", ME, feed, lastid))
P2(("%O going to fetch from %O since %O\n", ME, feed, lastid))
call_out( #'fetch, 4 * 59 ); // odd is better
feed -> content( #'parse, 1, 1 );
// twitter ignores since_id if count is present. stupid.

View File

@ -435,8 +435,10 @@ msg(source, mc, data, mapping vars, showingLog) {
&& abbrev(SERVER_UNIFORM +"~", source))
#endif
) {
#ifdef PRO_PATH
if (data && index(data, '\n') != -1)
data = replace(data, "\n", " ");
#endif
#ifdef USE_THE_NICK
if (t != source) {
if (objectp(source)) {

View File

@ -1895,6 +1895,7 @@ motto(t) {
}
private talk(to, handleAliases) {
// check if we are already in a query with this person.. here?
if (to) {
string tn;
// looking for a bug.. intermediate hack here..
@ -3426,6 +3427,7 @@ teleport(where, mcv, quiet, stay, morevars) {
}
unless(mcv) mcv = "";
if (place && member(places, place)) {
#ifndef EXPERIMENTAL // ALTE_SCHULE
if (place == where) {
P3(("teleport: %O is already in %O\n", ME, place))
// why error.. this should be a _warning !!
@ -3438,6 +3440,7 @@ teleport(where, mcv, quiet, stay, morevars) {
// here's a kludge to not return in that case:
unless (morevars) return;
}
#endif
if (NICKPLACE) {
vSet("lastplace", NICKPLACE);
unless (stay) {
@ -3463,8 +3466,10 @@ teleport(where, mcv, quiet, stay, morevars) {
if (places[where]) {
place = where;
vSet("place", objectp(where) ? where->qName() : where);
#ifndef EXPERIMENTAL // ALTE_SCHULE
unless(quiet) showRoom();
return place;
#endif
}
return placeRequest(where,
#ifdef SPEC