Re: [evolution-patches] folder.expunged and message.changed events




Hi Nat,

I'm not sure there is a reliable way to do the folder.expunged one, since we have no internal event to track it, i'm actually not sure its a very useful one anyway.  Actually, you will get folder changed events with removed messages if expunge did any work, so it is probably redundant (and for normal local folders, you wont get removed messages any other way).  If you just need to know when uids were removed, having a list of them would be more useful anyway.

message.changed isn't too useful, we already have folder.changed, which listens to the root camel events, not just assume it changed after you call something.  Also the code has a problem, camel_folder_get_message() shouldn't be called from the main thread, since it may block and is not cancellable if you do this.  Also note that a message can't "change" at all, all messages are read-only objects.  What changes is their state in the folder they belong to.  Which is another reason message.changed api isn't quite right.  I think this event could also cause a pretty major performance hit, whereas events should be lightweight, using data available at the time.

Since folder.changed has no detail on how it changed, it would probably make sense to just extend its target to include a CamelFolderChangeInfo, then you can extrapolate a message.changed and folder.expunged equivalent from that yourself.  The source camel event folder_changed does include this info so it probably wouldn't be too hard to add to the target.

Michael

On Sun, 2005-01-16 at 21:27 -0500, Nat Friedman wrote:
Hi,

This patch adds two EPlugin events: message.changed is emitted when
message flags change, and folder.expunged is emitted when the user
expunges the deleted messages in a folder.

I implemented these events for a plugin that I was writing that I've
since abandoned, but I figure they might be useful for someone.

I'm interested in review on both; I think I may have missed some code
paths on folder expunging, in particular.

Thanks,
Nat

--
Michael Zucchi <notzed ximian com>
"Ride, Work, Sleep. Beer."
Novell's Evolution and Free Software Developer


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]