1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

USE_THE_NICK considered evil

This commit is contained in:
psyc://psyced.org/~lynX 2009-03-07 13:39:56 +01:00
parent 5b9320527d
commit 227eb4fbfd
5 changed files with 17 additions and 7 deletions

View file

@ -195,7 +195,7 @@ _message_public_whisper
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me whispers to [_nick_target]: [_data]</body></message>
_message_public_reduce
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_says} {_TEXT_something}.</body></message>
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_says} {_TEXT_something}.</body></message>
_message_public_question
|<message to='[_INTERNAL_target_jabber]' type='groupchat' from='[_INTERNAL_source_jabber]'><body>/me {_TEXT_action_asks}: [_data]</body></message>

View file

@ -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]

View file

@ -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]

View file

@ -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

View file

@ -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())