Camel.MessageInfo

g Camel.MessageInfo Camel.MessageInfo GObject.Object GObject.Object GObject.Object->Camel.MessageInfo

Subclasses:

Camel.MessageInfoBase, Camel.VeeMessageInfo

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (summary)

class

new_from_headers (summary, headers)

clone (assign_summary)

dump ()

dup_headers ()

dup_preview ()

dup_references ()

dup_user_flags ()

dup_user_header (name)

dup_user_headers ()

dup_user_tag (name)

dup_user_tags ()

freeze_notifications ()

get_abort_notifications ()

get_cc ()

get_date_received ()

get_date_sent ()

get_dirty ()

get_flags ()

get_folder_flagged ()

get_folder_flagged_stamp ()

get_from ()

get_headers ()

get_message_id ()

get_mlist ()

get_notifications_frozen ()

get_preview ()

get_references ()

get_size ()

get_subject ()

get_to ()

get_uid ()

get_user_flag (name)

get_user_flags ()

get_user_header (name)

get_user_headers ()

get_user_tag (name)

get_user_tags ()

load (record, bdata_ptr)

pooldup_uid ()

property_lock ()

property_unlock ()

ref_summary ()

save (record, bdata_str)

set_abort_notifications (abort_notifications)

set_cc (cc)

set_date_received (date_received)

set_date_sent (date_sent)

set_dirty (dirty)

set_flags (mask, set)

set_folder_flagged (folder_flagged)

set_from (from_)

set_message_id (message_id)

set_mlist (mlist)

set_preview (preview)

set_size (size)

set_subject (subject)

set_to (to)

set_uid (uid)

set_user_flag (name, state)

set_user_header (name, value)

set_user_tag (name, value)

take_headers (headers)

take_references (references)

take_user_flags (user_flags)

take_user_headers (headers)

take_user_tags (user_tags)

thaw_notifications ()

Virtual Methods

Inherited:

GObject.Object (7)

do_clone (assign_summary)

do_dup_user_flags ()

do_dup_user_tags ()

do_get_cc ()

do_get_date_received ()

do_get_date_sent ()

do_get_flags ()

do_get_from ()

do_get_headers ()

do_get_message_id ()

do_get_mlist ()

do_get_preview ()

do_get_references ()

do_get_size ()

do_get_subject ()

do_get_to ()

do_get_user_flag (name)

do_get_user_flags ()

do_get_user_header (name)

do_get_user_headers ()

do_get_user_tag (name)

do_get_user_tags ()

do_load (record, bdata_ptr)

do_save (record, bdata_str)

do_set_cc (cc)

do_set_date_received (date_received)

do_set_date_sent (date_sent)

do_set_flags (mask, set)

do_set_from (from_)

do_set_message_id (message_id)

do_set_mlist (mlist)

do_set_preview (preview)

do_set_size (size)

do_set_subject (subject)

do_set_to (to)

do_set_user_flag (name, state)

do_set_user_header (name, value)

do_set_user_tag (name, value)

do_take_headers (headers)

do_take_references (references)

do_take_user_flags (user_flags)

do_take_user_headers (headers)

do_take_user_tags (user_tags)

Properties

Name

Type

Flags

Short Description

abort-notifications

bool

r/w/en

cc

str

r/w/en

date-received

int

r/w/en

date-sent

int

r/w/en

dirty

bool

r/w/en

flags

Camel.MessageFlags

r/w/en

folder-flagged

bool

r/w/en

folder-flagged-stamp

int

r

from

str

r/w/en

headers

Camel.NameValueArray

r/w/en

message-id

int

r/w/en

mlist

str

r/w/en

preview

str

r/w/en

references

GLib.Array

r/w/en

size

int

r/w/en

subject

str

r/w/en

summary

Camel.FolderSummary

r/w/co

to

str

r/w/en

uid

str

r/w/en

user-flags

Camel.NamedFlags

r/w/en

user-headers

Camel.NameValueArray

r/w/en

user-tags

Camel.NameValueArray

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Camel.MessageInfo(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Camel.MessageInfoClass

classmethod new(summary)
Parameters:

summary (Camel.FolderSummary or None) – parent Camel.FolderSummary object, or None

Returns:

a new Camel.MessageInfo object

Return type:

Camel.MessageInfo

Create a new Camel.MessageInfo object, optionally for given summary.

New in version 3.24.

classmethod new_from_headers(summary, headers)
Parameters:
Returns:

a new Camel.MessageInfo

Return type:

Camel.MessageInfo

Create a new Camel.MessageInfo pre-populated with info from headers.

New in version 3.24.

clone(assign_summary)
Parameters:

assign_summary (Camel.FolderSummary or None) – parent Camel.FolderSummary object, or None, to set on the clone

Returns:

a new Camel.MessageInfo object, clone of the self

Return type:

Camel.MessageInfo

Clones the self as a new Camel.MessageInfo and eventually assigns a new Camel.FolderSummary to it. If it’s not set, then the same summary as the one with self is used.

New in version 3.24.

dump()

Dumps the mesasge info self to stdout. This is meand for debugging purposes only.

New in version 3.24.

dup_headers()
Returns:

All the message headers of the associated message, or None, when none are available. Free returned array with Camel.NameValueArray.free() when no longer needed.

Return type:

Camel.NameValueArray or None

Duplicates array of headers for the self.

New in version 3.24.

dup_preview()
Returns:

Body preview of the associated message, or None, when not available. Free the returned string with GLib.free(), when no longer needed.

Return type:

str or None

New in version 3.42.

dup_references()
Returns:

A GLib.Array of guint64 encoded Message-ID-s; or None when none are available. Free returned array with g_array_unref() when no longer needed.

Return type:

[int] or None

Duplicates encoded In-Reply-To and References headers of the associated message as an array of guint64 numbers, partial MD5 sums. Each value can be cast to Camel.SummaryMessageID.

New in version 3.24.

dup_user_flags()
Returns:

A newly allocated Camel.NamedFlags with all the currently set user flags on the self. Free the returned structure with Camel.NamedFlags.free() when no londer needed.

Return type:

Camel.NamedFlags or None

New in version 3.24.

dup_user_header(name)
Parameters:

name (str) – header name

Returns:

Value of the header named name from the user-defined message headers of the associated message, or None, when not available. Free the returned string with GLib.free(), when no longer needed.

Return type:

str or None

New in version 3.42.

dup_user_headers()
Returns:

All the user-defined message headers of the associated message, or None, when none are available. Free returned array with Camel.NameValueArray.free() when no longer needed.

Return type:

Camel.NameValueArray or None

New in version 3.42.

dup_user_tag(name)
Parameters:

name (str) – user tag name

Returns:

Value of the user tag as newly allocated string, or None when it is not set. Free it with GLib.free() when no longer needed.

Return type:

str or None

New in version 3.24.

dup_user_tags()
Returns:

a newly allocated Camel.NameValueArray containing all set user tags of the self. Free it with Camel.NameValueArray.free() when no longer needed.

Return type:

Camel.NameValueArray or None

New in version 3.24.

freeze_notifications()

Freezes all the notifications until the Camel.MessageInfo.thaw_notifications() is called. This function can be called multiple times, where the last thaw will do the notifications.

New in version 3.24.

get_abort_notifications()
Returns:

Whether the self is aborting notifications, which means that it will not influence ‘dirty’ and ‘folder-flagged’ flags in the set/take functions, neither it will emit any GObject.Object ::notify signals on change, nor associated folder’s “changed” signal.

Return type:

bool

New in version 3.24.

get_cc()
Returns:

CC address of the self.

Return type:

str

New in version 3.24.

get_date_received()
Returns:

time_t of the Received header of the message, encoded as gint64.

Return type:

int

New in version 3.24.

get_date_sent()
Returns:

time_t of the Date header of the message, encoded as gint64.

Return type:

int

New in version 3.24.

get_dirty()
Returns:

Whether the self is dirty, which means that it had been changed and a save to the local summary is required.

Return type:

bool

New in version 3.24.

get_flags()
Returns:

Bit-or of Camel.MessageFlags set on the self.

Return type:

int

New in version 3.24.

get_folder_flagged()
Returns:

Whether requires save of the local changes into the remote store.

Return type:

bool

The folder flagged flag is used to mark the message infor as being changed and this change should be propagated to the remote store (server). This is different from the ‘dirty’ flag, which is set for local changes only. It can happen that the ‘folder-flagged’ flag is set, but the ‘dirty’ flag not.

This is only a convenient wrapper around Camel.MessageFlags.FOLDER_FLAGGED flag, for better readiness of the code.

New in version 3.24.

get_folder_flagged_stamp()
Returns:

Stamp of the ‘folder-flagged’ flag.

Return type:

int

The ‘folder-flagged-stamp’ is a stamp of the ‘folder-flagged’ flag. This stamp changes whenever anything would mark the self as ‘folder-flagged’, regardless the self being already ‘folder-flagged’. It can be used to recognize changes on the ‘folder-flagged’ flag during the time.

New in version 3.24.

get_from()
Returns:

From address of the self.

Return type:

str

New in version 3.24.

get_headers()
Returns:

All the message headers of the associated message, or None, when none are available.

Return type:

Camel.NameValueArray or None

New in version 3.24.

get_message_id()
Returns:

Partial MD5 hash of the Message-ID header of the associated message.

Return type:

int

Encoded Message-ID of the associated message as a guint64 number, partial MD5 sum. The value can be cast to Camel.SummaryMessageID.

New in version 3.24.

get_mlist()
Returns:

Mailing list address of the self.

Return type:

str

New in version 3.24.

get_notifications_frozen()
Returns:

Whether the notifications are frozen.

See: Camel.MessageInfo.freeze_notifications()

Return type:

bool

New in version 3.24.

get_preview()
Returns:

Body preview of the associated message, or None, when not available.

Return type:

str or None

New in version 3.42.

get_references()
Returns:

A GLib.Array of guint64 encoded Message-ID-s; or None when none are available.

Return type:

[int] or None

Gets encoded In-Reply-To and References headers of the associated message as an array of guint64 numbers, partial MD5 sums. Each value can be cast to Camel.SummaryMessageID.

New in version 3.24.

get_size()
Returns:

Size of the associated message.

Return type:

int

New in version 3.24.

get_subject()
Returns:

Subject of the #mi.

Return type:

str

New in version 3.24.

get_to()
Returns:

To address of the self.

Return type:

str

New in version 3.24.

get_uid()
Returns:

The UID of the self.

Return type:

str

Get the UID of the #mi.

New in version 3.24.

get_user_flag(name)
Parameters:

name (str) – user flag name

Returns:

Whther the user flag named name is set.

Return type:

bool

New in version 3.24.

get_user_flags()
Returns:

A Camel.NamedFlags with all the currently set user flags on the self. Do not modify it.

Return type:

Camel.NamedFlags or None

New in version 3.24.

get_user_header(name)
Parameters:

name (str) – header name

Returns:

Value of the header named name from the user-defined message headers of the associated message, or None, when not available.

Return type:

str or None

New in version 3.42.

get_user_headers()
Returns:

All the user-defined message headers of the associated message, or None, when none are available.

Return type:

Camel.NameValueArray or None

New in version 3.42.

get_user_tag(name)
Parameters:

name (str) – user tag name

Returns:

Value of the user tag, or None when it is not set.

Return type:

str or None

New in version 3.24.

get_user_tags()
Returns:

a Camel.NameValueArray containing all set user tags of the self. Do not modify it.

Return type:

Camel.NameValueArray or None

New in version 3.24.

load(record, bdata_ptr)
Parameters:
Returns:

Whether the load was successful.

Return type:

bool

Load content of self from the data stored in record. The bdata_ptr points to the current position of the record->bdata, where the read can continue. Use helper functions Camel.util_bdata_get_number() and Camel.util_bdata_get_string() to read data from it and also move forward the *bdata_ptr.

After successful load of the self, the ‘dirty’ flag is unset.

New in version 3.24.

pooldup_uid()
Returns:

A newly references string in the string pool, the #mi UID. Free it with Camel.pstring_free() when no longer needed.

Return type:

str

Get the UID of the #mi, duplicated on the Camel’s string pool. This is good for thread safety, though the UID should not change once set.

New in version 3.24.

property_lock()

Acquires a property lock, which is used to ensure thread safety when properties are changing. Release the lock with Camel.MessageInfo.property_unlock().

Note: Make sure the Camel.FolderSummary lock is held before this lock, if there will be called any ‘set’ function on the self, to avoid deadlock when the summary would be set as dirty while another thread might try to read values from the self, waiting for the property lock and holding the summary lock at the same time.

New in version 3.24.

property_unlock()

Releases a property lock, previously acquired with Camel.MessageInfo.property_lock().

New in version 3.24.

ref_summary()
Returns:

Referenced Camel.FolderSummary to which the self belongs, or None, if there is none. Use GObject.Object.unref() for non-None returned values when done with it.

Return type:

object or None

New in version 3.24.

save(record, bdata_str)
Parameters:
Returns:

Whether the save succeeded.

Return type:

bool

Save the self content to the message info record record. It can populate all but the record->bdata value, which is set fro mthe bdata_str. Use helper functions Camel.util_bdata_put_number() and Camel.util_bdata_put_string() to put data into the bdata_str.

New in version 3.24.

set_abort_notifications(abort_notifications)
Parameters:

abort_notifications (bool) – a state to set

Marks the self to abort any notifications, which means that it will not influence ‘dirty’ and ‘folder-flagged’ flags in the set/take functions, neither it will emit any GObject.Object ::notify signals on change, nor associated folder’s “changed” signal.

New in version 3.24.

set_cc(cc)
Parameters:

cc (str or None) – a CC to set

Returns:

Whether the value changed.

Return type:

bool

Sets CC from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_date_received(date_received)
Parameters:

date_received (int) – a received date to set

Returns:

Whether the value changed.

Return type:

bool

Sets received date (the Received header) of the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_date_sent(date_sent)
Parameters:

date_sent (int) – a sent date to set

Returns:

Whether the value changed.

Return type:

bool

Sets sent date (the Date header) of the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_dirty(dirty)
Parameters:

dirty (bool) – a dirty state to set

Marks the self as dirty, which means a save to the local summary is required.

New in version 3.24.

set_flags(mask, set)
Parameters:
  • mask (int) – mask of flags to change

  • set (int) – state the flags should be changed to

Returns:

Whether the flags changed.

Return type:

bool

Change the state of the flags on the self. Both mask and set are bit-or of Camel.MessageFlags.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is also emitted folder’s “changed” signal for this self, if necessary. In case the Camel.MessageFlags.FOLDER_FLAGGED flag would be set and the self is not aborting notifications, the ‘folder-flagged-stamp’ changes too.

New in version 3.24.

set_folder_flagged(folder_flagged)
Parameters:

folder_flagged (bool) – a value to set to

Returns:

Whether the flag had been changed.

Return type:

bool

Changes the folder-flagged flag to the folder_flagged value. See Camel.MessageInfo.get_folder_flagged() for more information about the use of this flag.

This is only a convenient wrapper around Camel.MessageFlags.FOLDER_FLAGGED flag, for better readiness of the code.

New in version 3.24.

set_from(from_)
Parameters:

from (str or None) – a From to set

Returns:

Whether the value changed.

Return type:

bool

Sets From from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_message_id(message_id)
Parameters:

message_id (int) – a message id to set

Returns:

Whether the value changed.

Return type:

bool

Sets encoded Message-ID of the associated message as a guint64 number, partial MD5 sum. The value can be cast to Camel.SummaryMessageID.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_mlist(mlist)
Parameters:

mlist (str or None) – a message list address to set

Returns:

Whether the value changed.

Return type:

bool

Sets mesage list address from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_preview(preview)
Parameters:

preview (str or None) – message body preview, or None

Returns:

Whether the value changed.

Return type:

bool

Set preview as the body preview of the associated message. Use None or an empty string to unset the value.

If the self changed, the ‘dirty’ flag is set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.42.

set_size(size)
Parameters:

size (int) – a size to set

Returns:

Whether the value changed.

Return type:

bool

Sets size of the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_subject(subject)
Parameters:

subject (str or None) – a Subject to set

Returns:

Whether the value changed.

Return type:

bool

Sets Subject from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_to(to)
Parameters:

to (str or None) – a To to set

Returns:

Whether the value changed.

Return type:

bool

Sets To from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.24.

set_uid(uid)
Parameters:

uid (str) – a UID to set

Returns:

Whether the UID changed.

Return type:

bool

Changes UID of the self to uid. If it changes, the ‘dirty’ flag of the self is set too, unless the self is aborting notifications. This change does not influence the ‘folder-flagged’ flag.

New in version 3.24.

set_user_flag(name, state)
Parameters:
  • name (str) – user flag name

  • state (bool) – state to set for the flag

Returns:

Whether the message info changed.

Return type:

bool

Change state of the flag named name. Unlike user tags, user flags can only be set or unset, while the user tags can contain certain values.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is also emitted folder’s “changed” signal for this self, if necessary.

New in version 3.24.

set_user_header(name, value)
Parameters:
  • name (str) – header name

  • value (str or None) – header value, or None

Returns:

Whether the value changed.

Return type:

bool

Set value for a single user-defined message header of the associated message. When the value is None, the header name is removed from the user-defined headers.

If the self changed, the ‘dirty’ flag is set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

New in version 3.42.

set_user_tag(name, value)
Parameters:
  • name (str) – user tag name

  • value (str or None) – user tag value, or None to remove the user tag

Returns:

Whether the self changed.

Return type:

bool

Set user tag name to value, or remove it, if value is None.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is also emitted folder’s “changed” signal for this self, if necessary.

New in version 3.24.

take_headers(headers)
Parameters:

headers (Camel.NameValueArray or None) – headers to set, as Camel.NameValueArray, or None

Returns:

Whether the value changed.

Return type:

bool

Takes headers of the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

Note that it’s not safe to use the headers after the call to this function, because it can be freed due to no change.

New in version 3.24.

take_references(references)
Parameters:

references ([int] or None) – a references to set

Returns:

Whether the value changed.

Return type:

bool

Takes encoded In-Reply-To and References headers of the associated message as an array of guint64 numbers, partial MD5 sums. Each value can be cast to Camel.SummaryMessageID.

This property is considered static, in a meaning that it should not change during the life-time of the self, the same as it doesn’t change in the associated message.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

Note that it’s not safe to use the references after the call to this function, because it can be freed due to no change.

New in version 3.24.

take_user_flags(user_flags)
Parameters:

user_flags (Camel.NamedFlags or None) – user flags to set

Returns:

Whether the message info changed.

Return type:

bool

Takes all the user_flags, which replaces any current user flags on the self. The passed-in user_flags is consumed by the self, which becomes an owner of it. The caller should not change user_flags afterwards.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is also emitted folder’s “changed” signal for this self, if necessary.

Note that it’s not safe to use the user_flags after the call to this function, because it can be freed due to no change.

New in version 3.24.

take_user_headers(headers)
Parameters:

headers (Camel.NameValueArray or None) – headers to set, as Camel.NameValueArray, or None

Returns:

Whether the value changed.

Return type:

bool

Takes user-defined message headers of the associated message.

If the self changed, the ‘dirty’ flag is set automatically, unless the self is aborting notifications. There is not emitted folder’s “changed” signal for this self.

Note that it’s not safe to use the headers after the call to this function, because it can be freed due to no change.

New in version 3.42.

take_user_tags(user_tags)
Parameters:

user_tags (Camel.NameValueArray or None) – user tags to set

Returns:

Whether the self changed.

Return type:

bool

Takes all the user_tags, which replaces any current user tags on the self. The passed-in user_tags is consumed by the self, which becomes an owner of it. The caller should not change user_tags afterwards.

If the self changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the self is aborting notifications. There is also emitted folder’s “changed” signal for this self, if necessary.

Note that it’s not safe to use the user_tags after the call to this function, because it can be freed due to no change.

New in version 3.24.

thaw_notifications()

Reverses the call of the Camel.MessageInfo.freeze_notifications(). If this is the last freeze, then the associated folder is also notified about the change, if any happened during the freeze.

New in version 3.24.

do_clone(assign_summary) virtual
Parameters:

assign_summary (Camel.FolderSummary or None) – parent Camel.FolderSummary object, or None, to set on the clone

Returns:

a new Camel.MessageInfo object, clone of the mi

Return type:

Camel.MessageInfo

Clones the mi as a new Camel.MessageInfo and eventually assigns a new Camel.FolderSummary to it. If it’s not set, then the same summary as the one with mi is used.

New in version 3.24.

do_dup_user_flags() virtual
Returns:

A newly allocated Camel.NamedFlags with all the currently set user flags on the mi. Free the returned structure with Camel.NamedFlags.free() when no londer needed.

Return type:

Camel.NamedFlags or None

New in version 3.24.

do_dup_user_tags() virtual
Returns:

a newly allocated Camel.NameValueArray containing all set user tags of the mi. Free it with Camel.NameValueArray.free() when no longer needed.

Return type:

Camel.NameValueArray or None

New in version 3.24.

do_get_cc() virtual
Returns:

CC address of the mi.

Return type:

str

New in version 3.24.

do_get_date_received() virtual
Returns:

time_t of the Received header of the message, encoded as gint64.

Return type:

int

New in version 3.24.

do_get_date_sent() virtual
Returns:

time_t of the Date header of the message, encoded as gint64.

Return type:

int

New in version 3.24.

do_get_flags() virtual
Returns:

Bit-or of Camel.MessageFlags set on the mi.

Return type:

int

New in version 3.24.

do_get_from() virtual
Returns:

From address of the mi.

Return type:

str

New in version 3.24.

do_get_headers() virtual
Returns:

All the message headers of the associated message, or None, when none are available.

Return type:

Camel.NameValueArray or None

New in version 3.24.

do_get_message_id() virtual
Returns:

Partial MD5 hash of the Message-ID header of the associated message.

Return type:

int

Encoded Message-ID of the associated message as a guint64 number, partial MD5 sum. The value can be cast to Camel.SummaryMessageID.

New in version 3.24.

do_get_mlist() virtual
Returns:

Mailing list address of the mi.

Return type:

str

New in version 3.24.

do_get_preview() virtual
Returns:

Body preview of the associated message, or None, when not available.

Return type:

str or None

New in version 3.42.

do_get_references() virtual
Returns:

A GLib.Array of guint64 encoded Message-ID-s; or None when none are available.

Return type:

[int] or None

Gets encoded In-Reply-To and References headers of the associated message as an array of guint64 numbers, partial MD5 sums. Each value can be cast to Camel.SummaryMessageID.

New in version 3.24.

do_get_size() virtual
Returns:

Size of the associated message.

Return type:

int

New in version 3.24.

do_get_subject() virtual
Returns:

Subject of the #mi.

Return type:

str

New in version 3.24.

do_get_to() virtual
Returns:

To address of the mi.

Return type:

str

New in version 3.24.

do_get_user_flag(name) virtual
Parameters:

name (str) – user flag name

Returns:

Whther the user flag named name is set.

Return type:

bool

New in version 3.24.

do_get_user_flags() virtual
Returns:

A Camel.NamedFlags with all the currently set user flags on the mi. Do not modify it.

Return type:

Camel.NamedFlags or None

New in version 3.24.

do_get_user_header(name) virtual
Parameters:

name (str) – header name

Returns:

Value of the header named name from the user-defined message headers of the associated message, or None, when not available.

Return type:

str or None

New in version 3.42.

do_get_user_headers() virtual
Returns:

All the user-defined message headers of the associated message, or None, when none are available.

Return type:

Camel.NameValueArray or None

New in version 3.42.

do_get_user_tag(name) virtual
Parameters:

name (str) – user tag name

Returns:

Value of the user tag, or None when it is not set.

Return type:

str or None

New in version 3.24.

do_get_user_tags() virtual
Returns:

a Camel.NameValueArray containing all set user tags of the mi. Do not modify it.

Return type:

Camel.NameValueArray or None

New in version 3.24.

do_load(record, bdata_ptr) virtual
Parameters:
Returns:

Whether the load was successful.

Return type:

bool

Load content of mi from the data stored in record. The bdata_ptr points to the current position of the record->bdata, where the read can continue. Use helper functions Camel.util_bdata_get_number() and Camel.util_bdata_get_string() to read data from it and also move forward the *bdata_ptr.

After successful load of the mi, the ‘dirty’ flag is unset.

New in version 3.24.

do_save(record, bdata_str) virtual
Parameters:
Returns:

Whether the save succeeded.

Return type:

bool

Save the mi content to the message info record record. It can populate all but the record->bdata value, which is set fro mthe bdata_str. Use helper functions Camel.util_bdata_put_number() and Camel.util_bdata_put_string() to put data into the bdata_str.

New in version 3.24.

do_set_cc(cc) virtual
Parameters:

cc (str or None) – a CC to set

Returns:

Whether the value changed.

Return type:

bool

Sets CC from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_date_received(date_received) virtual
Parameters:

date_received (int) – a received date to set

Returns:

Whether the value changed.

Return type:

bool

Sets received date (the Received header) of the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_date_sent(date_sent) virtual
Parameters:

date_sent (int) – a sent date to set

Returns:

Whether the value changed.

Return type:

bool

Sets sent date (the Date header) of the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_flags(mask, set) virtual
Parameters:
  • mask (int) – mask of flags to change

  • set (int) – state the flags should be changed to

Returns:

Whether the flags changed.

Return type:

bool

Change the state of the flags on the mi. Both mask and set are bit-or of Camel.MessageFlags.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is also emitted folder’s “changed” signal for this mi, if necessary. In case the Camel.MessageFlags.FOLDER_FLAGGED flag would be set and the mi is not aborting notifications, the ‘folder-flagged-stamp’ changes too.

New in version 3.24.

do_set_from(from_) virtual
Parameters:

from (str or None) – a From to set

Returns:

Whether the value changed.

Return type:

bool

Sets From from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_message_id(message_id) virtual
Parameters:

message_id (int) – a message id to set

Returns:

Whether the value changed.

Return type:

bool

Sets encoded Message-ID of the associated message as a guint64 number, partial MD5 sum. The value can be cast to Camel.SummaryMessageID.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_mlist(mlist) virtual
Parameters:

mlist (str or None) – a message list address to set

Returns:

Whether the value changed.

Return type:

bool

Sets mesage list address from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_preview(preview) virtual
Parameters:

preview (str or None) – message body preview, or None

Returns:

Whether the value changed.

Return type:

bool

Set preview as the body preview of the associated message. Use None or an empty string to unset the value.

If the mi changed, the ‘dirty’ flag is set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.42.

do_set_size(size) virtual
Parameters:

size (int) – a size to set

Returns:

Whether the value changed.

Return type:

bool

Sets size of the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_subject(subject) virtual
Parameters:

subject (str or None) – a Subject to set

Returns:

Whether the value changed.

Return type:

bool

Sets Subject from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_to(to) virtual
Parameters:

to (str or None) – a To to set

Returns:

Whether the value changed.

Return type:

bool

Sets To from the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.24.

do_set_user_flag(name, state) virtual
Parameters:
  • name (str) – user flag name

  • state (bool) – state to set for the flag

Returns:

Whether the message info changed.

Return type:

bool

Change state of the flag named name. Unlike user tags, user flags can only be set or unset, while the user tags can contain certain values.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is also emitted folder’s “changed” signal for this mi, if necessary.

New in version 3.24.

do_set_user_header(name, value) virtual
Parameters:
  • name (str) – header name

  • value (str or None) – header value, or None

Returns:

Whether the value changed.

Return type:

bool

Set value for a single user-defined message header of the associated message. When the value is None, the header name is removed from the user-defined headers.

If the mi changed, the ‘dirty’ flag is set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

New in version 3.42.

do_set_user_tag(name, value) virtual
Parameters:
  • name (str) – user tag name

  • value (str or None) – user tag value, or None to remove the user tag

Returns:

Whether the mi changed.

Return type:

bool

Set user tag name to value, or remove it, if value is None.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is also emitted folder’s “changed” signal for this mi, if necessary.

New in version 3.24.

do_take_headers(headers) virtual
Parameters:

headers (Camel.NameValueArray or None) – headers to set, as Camel.NameValueArray, or None

Returns:

Whether the value changed.

Return type:

bool

Takes headers of the associated message.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

Note that it’s not safe to use the headers after the call to this function, because it can be freed due to no change.

New in version 3.24.

do_take_references(references) virtual
Parameters:

references ([int] or None) – a references to set

Returns:

Whether the value changed.

Return type:

bool

Takes encoded In-Reply-To and References headers of the associated message as an array of guint64 numbers, partial MD5 sums. Each value can be cast to Camel.SummaryMessageID.

This property is considered static, in a meaning that it should not change during the life-time of the mi, the same as it doesn’t change in the associated message.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

Note that it’s not safe to use the references after the call to this function, because it can be freed due to no change.

New in version 3.24.

do_take_user_flags(user_flags) virtual
Parameters:

user_flags (Camel.NamedFlags or None) – user flags to set

Returns:

Whether the message info changed.

Return type:

bool

Takes all the user_flags, which replaces any current user flags on the mi. The passed-in user_flags is consumed by the mi, which becomes an owner of it. The caller should not change user_flags afterwards.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is also emitted folder’s “changed” signal for this mi, if necessary.

Note that it’s not safe to use the user_flags after the call to this function, because it can be freed due to no change.

New in version 3.24.

do_take_user_headers(headers) virtual
Parameters:

headers (Camel.NameValueArray or None) – headers to set, as Camel.NameValueArray, or None

Returns:

Whether the value changed.

Return type:

bool

Takes user-defined message headers of the associated message.

If the mi changed, the ‘dirty’ flag is set automatically, unless the mi is aborting notifications. There is not emitted folder’s “changed” signal for this mi.

Note that it’s not safe to use the headers after the call to this function, because it can be freed due to no change.

New in version 3.42.

do_take_user_tags(user_tags) virtual
Parameters:

user_tags (Camel.NameValueArray or None) – user tags to set

Returns:

Whether the mi changed.

Return type:

bool

Takes all the user_tags, which replaces any current user tags on the mi. The passed-in user_tags is consumed by the mi, which becomes an owner of it. The caller should not change user_tags afterwards.

If the mi changed, the ‘dirty’ flag and the ‘folder-flagged’ flag are set automatically, unless the mi is aborting notifications. There is also emitted folder’s “changed” signal for this mi, if necessary.

Note that it’s not safe to use the user_tags after the call to this function, because it can be freed due to no change.

New in version 3.24.

Property Details

Camel.MessageInfo.props.abort_notifications
Name:

abort-notifications

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Flag, whether the info is currently aborting notifications. It is used to avoid unnecessary ‘folder-flagged’ and ‘dirty’ flags changes and also to avoid associated folder’s “changed” signal. f

New in version 3.24.

Camel.MessageInfo.props.cc
Name:

cc

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

CC address of the associated message.

New in version 3.24.

Camel.MessageInfo.props.date_received
Name:

date-received

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Received date of the associated message.

New in version 3.24.

Camel.MessageInfo.props.date_sent
Name:

date-sent

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Sent Date of the associated message.

New in version 3.24.

Camel.MessageInfo.props.dirty
Name:

dirty

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Flag, whether the info is changed and requires save to disk. Compare with Camel.MessageInfo :folder-flagged

New in version 3.24.

Camel.MessageInfo.props.flags
Name:

flags

Type:

Camel.MessageFlags

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Bit-or of Camel.MessageFlags.

New in version 3.24.

Camel.MessageInfo.props.folder_flagged
Name:

folder-flagged

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Flag, whether the info is changed and requires save to the destination store/server. This is different from the Camel.MessageInfo :dirty, which takes care of the local information only.

New in version 3.24.

Camel.MessageInfo.props.folder_flagged_stamp
Name:

folder-flagged-stamp

Type:

int

Default Value:

0

Flags:

READABLE

The ‘folder-flagged-stamp’ is a stamp of the ‘folder-flagged’ flag. This stamp changes whenever anything would mark the mi ‘folder-flagged’, regardless the mi being already ‘folder-flagged’. It can be used to recognize changes on the ‘folder-flagged’ flag during the time.

New in version 3.24.

Camel.MessageInfo.props.from_
Name:

from

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

From address of the associated message.

New in version 3.24.

Camel.MessageInfo.props.headers
Name:

headers

Type:

Camel.NameValueArray

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Headers of the associated message. Can be None.

New in version 3.24.

Camel.MessageInfo.props.message_id
Name:

message-id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Encoded Message-ID of the associated message as a guint64 number, partial MD5 sum. The value can be cast to Camel.SummaryMessageID.

New in version 3.24.

Camel.MessageInfo.props.mlist
Name:

mlist

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Mailing list address of the associated message.

New in version 3.24.

Camel.MessageInfo.props.preview
Name:

preview

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Body preview of the associated message. Can be None.

New in version 3.42.

Camel.MessageInfo.props.references
Name:

references

Type:

GLib.Array

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Encoded In-Reply-To and References headers of the associated message as an array of guint64 numbers, partial MD5 sums. Each value can be cast to Camel.SummaryMessageID.

New in version 3.24.

Camel.MessageInfo.props.size
Name:

size

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Size of the associated message.

New in version 3.24.

Camel.MessageInfo.props.subject
Name:

subject

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Subject of the associated message.

New in version 3.24.

Camel.MessageInfo.props.summary
Name:

summary

Type:

Camel.FolderSummary

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Camel.FolderSummary to which the message info belongs, or None. It can be set only during construction of the object.

New in version 3.24.

Camel.MessageInfo.props.to
Name:

to

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

To address of the associated message.

New in version 3.24.

Camel.MessageInfo.props.uid
Name:

uid

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A unique ID of the message in its folder.

New in version 3.24.

Camel.MessageInfo.props.user_flags
Name:

user-flags

Type:

Camel.NamedFlags

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

User flags for the associated message. Can be None. Unlike user-tags, which can contain various values, the user-flags can only be set or not.

New in version 3.24.

Camel.MessageInfo.props.user_headers
Name:

user-headers

Type:

Camel.NameValueArray

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

User-defined headers of the associated message. Can be None.

New in version 3.42.

Camel.MessageInfo.props.user_tags
Name:

user-tags

Type:

Camel.NameValueArray

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

User tags for the associated message. Can be None. Unlike user-flags, which can be set or not, the user-tags can contain various values.

New in version 3.24.