TnyMsgRemoveStrategy

TnyMsgRemoveStrategy — A type that implements removing a message

Synopsis




                    TnyMsgRemoveStrategy;
                    TnyMsgRemoveStrategyIface;
void                tny_msg_remove_strategy_perform_remove
                                                        (TnyMsgRemoveStrategy *self,
                                                         TnyFolder *folder,
                                                         TnyHeader *header,
                                                         GError **err);

Object Hierarchy


  GInterface
   +----TnyMsgRemoveStrategy

Known Implementations

TnyMsgRemoveStrategy is implemented by TnyCamelPopRemoteMsgRemoveStrategy and TnyCamelMsgRemoveStrategy.

Description

A type that implements removing a message from a TnyFolder

Details

TnyMsgRemoveStrategy

typedef struct _TnyMsgRemoveStrategy TnyMsgRemoveStrategy;


TnyMsgRemoveStrategyIface

typedef struct {
	GTypeInterface parent;

	void (*perform_remove_func) (TnyMsgRemoveStrategy *self, TnyFolder *folder, TnyHeader *header, GError **err);
} TnyMsgRemoveStrategyIface;


tny_msg_remove_strategy_perform_remove ()

void                tny_msg_remove_strategy_perform_remove
                                                        (TnyMsgRemoveStrategy *self,
                                                         TnyFolder *folder,
                                                         TnyHeader *header,
                                                         GError **err);

Performs the removal of a message from a folder

This doesn't remove it from a TnyList that holds the headers (for example for a header summary view) if the tny_folder_get_headers method happened before the deletion. You are responsible for refreshing your own lists.

This method also doesn't "have" to remove the header from the folder. Depending on the implementation it might only marks it as removed (it for example sets the TNY_HEADER_FLAG_DELETED). In such a case only after performing the tny_folder_sync method on the folder, it will really be removed.

In such a case this means that a tny_folder_get_headers method call will still prepend the removed message to the list. It will do this until the expunge happened. You are advised to hide messages that have been marked as being deleted from your summary view. In Gtk+, for the GtkTreeView component, you can do this using the GtkTreeModelFilter tree model filtering model.

The TnyCamelMsgRemoveStrategy implementation works this way. This implementation is also the default implementation for most TnyFolder implementations in libtinymail-camel

Note that it's possible that another implementation works differently. You could, for example, inherit or decorate the TnyCamelMsgRemoveStrategy implementation by adding code that also permanently removes the message in your inherited special type.

self : A TnyMsgRemoveStrategy instance
folder : The TnyFolder instance from which the message will be removed
header : The TnyHeader instance of the message that must be removed
err : A GError instance or NULL

See Also

TnyFolder, TnyMsg, TnyHeader