[RFC2 Patch 5/5] lib: iterator API for message properties

Tomi Ollila tomi.ollila at iki.fi
Tue May 31 21:38:17 PDT 2016


On Wed, Jun 01 2016, David Bremner <david at tethera.net> wrote:

> David Bremner <david at tethera.net> writes:
>
>> +   notmuch_message_properties_t *list;
>> +   RUN(notmuch_message_add_property (message, "testkey1", "bob"));
>> +   RUN(notmuch_message_add_property (message, "testkey1", "testvalue2"));
>> +   RUN(notmuch_message_add_property (message, "testkey1", "alice"));
>> +
>> +   for (list = notmuch_message_get_properties (message, "testkey1", TRUE);
>> +        notmuch_message_properties_valid (list); notmuch_message_properties_move_to_next (list)) {
>> +      printf("%s\n", notmuch_message_properties_value(list));
>> +   }
>> +   notmuch_message_properties_destroy (list);
>
> I was thinking a bit about how to dump/restore these.
>
> The most upwardly compatible way that i thought of is something like
>
> #= msg-id key=val key=val
>
> i.e. duplicate the msg-id for messages with properties
>
> This would be ignored by old notmuch-restore.
>
> Otherwise, maybe something like
>
> msg-id -- +tag +tag # key=val key=val
>
> I'm not sure. this might crash old notmuch-restore.
>
> How important is backward compatibility, and how important is minimizing
> dump size? It's a bit hard to predict the things people might use
> message properties for, but for thread surgery, I would expect a small
> number of messages with properties.

If we had compatibility version information in the dump file we could just
bump the version. (and if we added to newer, old notmuches would not
magically get that feature ;/)

Anyay, IMO we could make backward-incompatible changes, and then perhaps
provide conversion program (a few lines of perl(1) anyway (more lines on
many other))

Tomi

>
> d


More information about the notmuch mailing list