From 227eb4fbfdd34b0c0bd3f72c7f660c679d0c1116 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Sat, 7 Mar 2009 13:39:56 +0100 Subject: [PATCH] USE_THE_NICK considered evil --- world/default/en/jabber.textdb | 2 +- world/default/en/plain.textdb | 5 ++++- world/default/en_g/plain.textdb | 2 +- world/net/include/net.h | 4 +++- world/net/library/text.c | 11 ++++++++--- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/world/default/en/jabber.textdb b/world/default/en/jabber.textdb index 339a603..e8b32c9 100644 --- a/world/default/en/jabber.textdb +++ b/world/default/en/jabber.textdb @@ -195,7 +195,7 @@ _message_public_whisper |/me whispers to [_nick_target]: [_data] _message_public_reduce -|/me {_TEXT_says} {_TEXT_something}. +|/me {_TEXT_action_says} {_TEXT_something}. _message_public_question |/me {_TEXT_action_asks}: [_data] diff --git a/world/default/en/plain.textdb b/world/default/en/plain.textdb index 8bfc102..3d1f02d 100644 --- a/world/default/en/plain.textdb +++ b/world/default/en/plain.textdb @@ -757,7 +757,10 @@ _message_public_whisper |[_nick] whispers to [_nick_target]: [_data] _message_public_reduce -|[_nick] {_TEXT_says} {_TEXT_something}. +|[_nick] {_TEXT_action_says} {_TEXT_something}. + +_message_public_ask_reduce +|[_nick] {_TEXT_action_asks} {_TEXT_something}. _message_public_question |[_nick] {_TEXT_action_asks}: [_data] diff --git a/world/default/en_g/plain.textdb b/world/default/en_g/plain.textdb index 9a74730..18cf9ef 100644 --- a/world/default/en_g/plain.textdb +++ b/world/default/en_g/plain.textdb @@ -70,7 +70,7 @@ _message_public_whisper |[_nick] -> [_nick_target]: [_data] _message_public_reduce -|[_nick] {_TEXT_says} {_TEXT_something}. +|[_nick] {_TEXT_action_says} {_TEXT_something}. _message_public_question |«[_nick]» [_data] diff --git a/world/net/include/net.h b/world/net/include/net.h index 589bcb2..4ae2f6f 100644 --- a/world/net/include/net.h +++ b/world/net/include/net.h @@ -220,6 +220,9 @@ # define NEW_UNLINK # define NEW_RENDER # define MUCSUC +#else +// the old nick code seems to introduce the remote-part bug +# define USE_THE_NICK #endif #define GAMMA // code that has left BETA and is in production use @@ -242,7 +245,6 @@ //# ifndef __PIKE__ //# define USE_LIVING //# endif -# define USE_THE_NICK #endif #ifdef __NO_SRV__ // since psyclpc 4.0.4 diff --git a/world/net/library/text.c b/world/net/library/text.c index 6b936a9..55c4d37 100644 --- a/world/net/library/text.c +++ b/world/net/library/text.c @@ -24,7 +24,7 @@ varargs string psyctext(string s, mapping m, vastring data, string r, p, q, v; #if DEBUG > 2 - P3(("psyctext(%O, .., %O, %O, %O) %O\n", s, data, source, nick, m)) + PT(("psyctext(%O, .., %O, %O, %O) %O\n", s, data, source, nick, m)) #else P2(("psyctext(%O, .., %O, %O, %O)\n", s, data, source, nick)) #endif @@ -46,12 +46,14 @@ varargs string psyctext(string s, mapping m, vastring data, r += p + (data || ""); break; case "_nick": -#ifdef USE_THE_NICK +#if 1 //def USE_THE_NICK r += p + (nick || m["_nick"] || "?"); #else +// doesn't work for "wax enters psyc://ve.symlynx.com/@Wax." // _nick can mean _source_relay instead of physical source // and in some dirty cases we do not even provide _source_relay q = m["_source_relay"] || m["_source"]; + PT(("trying %O for _nick\n", q)) unless (q) { // so we are forced to use the _nick from the message q = m["_nick"] || nick; @@ -62,15 +64,18 @@ varargs string psyctext(string s, mapping m, vastring data, // no _nick? okay, then it has to be this one q = UNIFORM(source) || "?"; } + PT(("trying %O for _nick\n", q)) if (previous_object()) q = previous_object()->uni2nick(q, m) || q; + PT(("using %O for _nick\n", q)) r += p + q; #endif break; case "_source": // should this support _source_relay? var inheritance! #ifdef USE_THE_NICK - r += p + (nick || m["_nick"] || m["_source"] || UNIFORM(source) || "?"); + r += p + (nick || m["_nick"] || m["_source"] + || UNIFORM(source) || "?"); #else q = m["_source"] || UNIFORM(source) || "?"; if (previous_object())