[OGo-Developer] Locating Participants For New CalDAV Appointments

Adam Tauno Williams developer@opengroupware.org
Fri, 11 May 2007 09:08:08 -0400


--=-peM4NczfMRkI5chSommn
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

I'm testing the latest ZideStore against Sunbird 0.3.1 and watching what
goes on in the backend.  One thing that seems odd:  if I create an
appointment with myself as the recipient ZideStore does four queries to
turn that e-mail address into a participant - even though it finds me
with the first one.

I'm curious if this is on purpose; maybe to support catching multiple
recipients with the same e-mail address?

SELECT DISTINCT c1.company_id AS pkey   <--- GOT ME
FROM company_value cv, person c1=20
WHERE c1.is_person=3D1 AND (c1.is_account=3D1)=20
  AND (c1.is_private=3D0 OR c1.is_private IS NULL)=20
  AND ( lower(cv.value_string) =3D 'adam@morrison-ind.com'=20
  AND lower(cv.attribute) =3D 'email1'=20
  AND (c1.db_status <> 'archived')=20
  AND c1.company_id =3D cv.company_id );

SELECT DISTINCT c1.company_id AS pkey
FROM company_value cv, person c1=20
WHERE c1.is_person=3D1 AND (c1.is_account=3D0 OR c1.is_account IS NULL)=20
  AND (c1.is_private=3D0 OR c1.is_private IS NULL)=20
  AND ( lower(cv.value_string) =3D 'adam@morrison-ind.com'=20
  AND lower(cv.attribute) =3D 'email1'=20
  AND (c1.db_status <> 'archived') AND c1.company_id =3D cv.company_id );

SELECT DISTINCT c1.company_id AS pkey
FROM company_value cv, person c1=20
WHERE c1.is_person=3D1 AND (c1.is_account=3D0 OR c1.is_account IS NULL)=20
  AND c1.is_private=3D1=20
  AND c1.owner_id=3D10100=20
  AND ( lower(cv.value_string) =3D 'adam@morrison-ind.com'=20
  AND lower(cv.attribute) =3D 'email1'=20
  AND (c1.db_status <> 'archived')=20
  AND c1.company_id =3D cv.company_id );

SELECT DISTINCT c1.company_id AS pkey, c1.is_team AS isteam=20
FROM team c1=20
WHERE c1.is_team=3D1=20
  AND (c1.is_private=3D0 OR c1.is_private IS NULL)=20
  AND c1.email =3D 'adam@morrison-ind.com';

--=-peM4NczfMRkI5chSommn
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBGRGq4LRePpNle04MRAvYCAJ9sCw3+gRHTwEFbBGRsUfqltARYqQCcCSxw
+mzbm8YJYcV0L6NCb+xgI04=
=hixN
-----END PGP SIGNATURE-----

--=-peM4NczfMRkI5chSommn--