[2806] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: [PATCH] Ability to set exposure arbitrarily (like "zctl set

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Mon Nov 22 22:10:48 2010

Date: Mon, 22 Nov 2010 22:10:45 -0500 (EST)
From: Anders Kaseorg <andersk@MIT.EDU>
To: Jason Gross <jgross@mit.edu>
cc: barnowl-dev@mit.edu
In-Reply-To: <1290480221-21609-1-git-send-email-jgross@mit.edu>

Make sure this still works when configuring --without-zephyr; you=E2=80=99l=
l=20
probably need to put the new variable and associated new functions inside=
=20
#ifdef HAVE_LIBZEPHYR.

On Mon, 22 Nov 2010, Jason Gross wrote:
> +  OWLVAR_STRING_FULL( "exposure" /* %OwlVarStub */, "REALM-VISIBLE ", /*=
 we don't actually want to set this as the default;
> +                                                                       *=
 the extra space allows us to just display it. */

Hmm, I=E2=80=99d like to hope there=E2=80=99s a better solution.

> +                    "none,net-announced,realm-visible,realm-announced,op=
staff,net-visible",

That=E2=80=99s a weird order.

> +                    "controls who can zlocate you",
> +                    /* Copied almost verbatim from man zctl.
> +                     * XXX TODO: Cite or reword?
> +                     */

Just say =E2=80=9Cas listed in zctl(1)=E2=80=9D or something.

> +                    "The exposure-level can be one of the following \n"
> +                    "(listed from least exposure to widest exposure):\n"

Again, the order looks wrong.  Was there something wrong with the order in=
=20
zctl(1)?

> +  return ZSetLocation(zstr(exposure)) |
> +         ZSetVariable(zstr("exposure"), zstr(exposure));

That | is too clever; just write some if statements.

> +  ret =3D ZSetLocation(ZParseExposureLevel(zstr(owl_global_get_exposure(=
&g))));

owl_global_get_exposure has already ZParseExposureLevel=E2=80=99d that; no =
need to=20
do it again.

Anders

home help back first fref pref prev next nref lref last post