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

spec conformant leave (EXPERIMENTAL)

This commit is contained in:
psyc://psyced.org/~lynX 2009-03-17 16:47:27 +01:00
parent 67c41bde14
commit 18aa0276d1

View file

@ -935,6 +935,14 @@ private leaveMsg(ni, isError, source, mc, data, vars) {
// optimize away the echo isn't really pragmatic.. TODO. // optimize away the echo isn't really pragmatic.. TODO.
// we may also simplify the context specification then, huh? // we may also simplify the context specification then, huh?
// //
#ifdef EXPERIMENTAL
// first send tagged echo to the person leaving
unless(isError) sendmsg(source, mc, data, vars+ ([ "_source_relay" : source ]));
// remove her from the context
remove_member(source, vars["_INTERNAL_origin"]);
// let everybody else know about the loss
unless(isError || v("_filter_presence")) castmsg(source, mc, data, vars);
#else
unless(isError) { unless(isError) {
if (v("_filter_presence")) { if (v("_filter_presence")) {
// arent you a little heavy on the relays here? i dont get it // arent you a little heavy on the relays here? i dont get it
@ -943,6 +951,7 @@ private leaveMsg(ni, isError, source, mc, data, vars) {
else castmsg(source, mc, data, vars); else castmsg(source, mc, data, vars);
} }
remove_member(source, vars["_INTERNAL_origin"]); remove_member(source, vars["_INTERNAL_origin"]);
#endif
// it's probably safer to call this hook _after_ removing // it's probably safer to call this hook _after_ removing
// the candidate to avoid risking loops // the candidate to avoid risking loops
leave(source, mc, data, vars); // hook here.. hardly ever used leave(source, mc, data, vars); // hook here.. hardly ever used