[dev] Question regarding IMP_Maillog
Michael M Slusarz
slusarz at horde.org
Tue Mar 19 21:51:36 UTC 2013
Quoting Michael J Rubinsky <mrubinsk at horde.org>:
> ActiveSync 14.0 adds support for synchronizing message reply/forward
> state. In trying to implement this, I've come across an issue with
> the way IMP_Maillog stores the guid of the email. In every other
> application in Horde, history guids are build with ':' delimiting
> the various parts of the guid. This makes it possible to search for
> all entries that have changed within only a specific application,
> for a specific user or resource. In kronolith, E.g, the guids are
> 'kronolith:share_id:event_id'.
>
> According to the phpdoc for Horde_History::getByTimestamp(), the ':'
> delimiter is part of the API:
>
> * @param string $parent The parent history to start searching at. If
> * non-empty, will be searched for with a LIKE
> * '$parent:%' clause.
>
>
> In IMP_Maillog, however, the ids are build using '.' as the
> delimiter. Due to this, it's impossible for me to use the History
> API to obtain all entries that have been added since the last sync:
>
> $history->getByTimeStamp('<', $ts, array(), 'imp.mike');
>
> will fail since the history library appends the ':' delimter
> automatically. I can't hack around it using the $query parameter
> either, since those fields only work with the 'history_' fields in
> the SQL backend.
>
> Is there a technical reason for this? I had thought it might be
> because the Message-ID can contain ':' characters - but then it can
> also contain '.'. Is this something that can be changed in
> IMP_Maillog, or should I extend Horde_History to allow specifying
> the delimter to be used in the ::getByTimeStamp() method?
My guess is that this is just a historical anomaly. In that I believe
maillog was the first action to use Horde_History (it may have even
been moved from IMP -> Horde_History). So it's possible that this is
the way we started out doing it and it was never changed to match. I
am unaware of any technical reason behind this decision - although
I'll admit I am not very familiar with the code.
Although it seems like it should be Horde_History that enforces this
prefix. In other words - it strips off the 'app:' prefix if passed
in, and adds the correct app prefix. That's not a good API if it
requires you to conform the ID to a certain format that is strictly
enforced elsewhere in the code (and can't be worked around).
michael
___________________________________
Michael Slusarz [slusarz at horde.org]
More information about the dev
mailing list