introducing PERSON2UNIFORM and SERVER_UNIFORM

This commit is contained in:
psyc://psyced.org/~lynX 2009-01-29 17:08:56 +01:00
parent f18678aa60
commit 14c65f90a8
2 changed files with 17 additions and 6 deletions

View File

@ -127,6 +127,12 @@
# endif
#endif
#ifdef _uniform_node
# define SERVER_UNIFORM _uniform_node
#else
# define SERVER_UNIFORM query_server_unl()
#endif
#ifdef MUD
# define NO_NEWBIES
#endif
@ -167,6 +173,11 @@
// pick the psyc: uniform for objects, otherwise keep what we have
#define UNIFORM(x) (objectp(x)? psyc_name(x): x)
// convert a plain nickname to a local uniform when necessary
#define PERSON2UNIFORM(x) (is_formal(x) ? x : (SERVER_UNIFORM +"~"+ x))
// here's a variant that summons an appropriate object.. unused however
//#define MAKEPERSON2UNIFORM(x) \
// (is_formal(t) ? t : psyc_name(summon_person(t, load_name())))
// we currently make no distinction
// now we do.

View File

@ -3018,17 +3018,17 @@ listAcq(ppltype, pplvalue) { // Acq(uaintance) to be renamed into Peer
// "_level_expose": PPLDEC(prof[PPL_EXPOSE]),
// "_level_display": PPLDEC(prof[PPL_DISPLAY]),
// "_level_notification": PPLDEC(prof[PPL_NOTIFY]),
"[_nick] ([_acquaintance]): D[_type_display], N[_type_notification], T[_degree_trust], E[_degree_expose].", ([
"[_acquaintance] ([_nick]): D[_type_display], N[_type_notification], T[_degree_trust], E[_degree_expose].", ([
"_degree_trust" : PPLDEC(prof[PPL_TRUST]),
"_degree_expose": PPLDEC(prof[PPL_EXPOSE]),
"_type_display" : share["_display"][prof[PPL_DISPLAY]],
"_type_notification": share["_notification"][prof[PPL_NOTIFY]],
// should we always deliver a uniform?
"_acquaintance": person,
// should we call _acquaintance _person instead?
"_acquaintance": PERSON2UNIFORM(person),
"_nick": pdisp ]) );
else if (ppltype == PPL_JSON) {
// should we always deliver a uniform?
mapping m = ([ "_contact": person ]);
// should we call _contact _person instead?
mapping m = ([ "_contact": PERSON2UNIFORM(person) ]);
#ifdef ALIASES
if (pdisp != person) m["_nick_alias"] = pdisp;
#endif