Log In
New Account
Home My Page Project Cloud Code Snippets Project Openings modest
Summary Lists SCM Wiki

Send Receive Sequence

Send receive sequence

Send and receive operation is started in two places:

  • modest_ui_actions_on_send_receive (from UI send receive buttons)
  • Dbus event (for scheduled send receive).

They both call modest_ui_actions_do_send_receive_all, or modest_ui_actions_do_send_Receive (that updates just one account).


  • Checks the account to perform send receive.
  • Obtains the server account for that account.
  • Checks if the send receive is not interactive. If not, check if the account has the tag no_auto_update, that disables automatic send receives (i.e. send receive is handled internally).
  • Does connect and perform, to only do send receive if we have network connection.
  • Launch update account mail operation


  • Obtains the server store account
  • Sets in account manager that account is busy (to show "updating" in accounts view).
  • Obtains the folders (tny_folder_store_get_folders_async and recurse_folders_async_cb). This asynchronous operations traverse all the folders of the account.
  • For each folder, it does tny_folder_poke_status (that refreshes the count of messages and unread messages).
  • But, if the folder is inbox, it refreshes the folder. This means fetching all the new headers. On finishing the refresh, it runs inbox_refreshed_cb. Any observer of the folder (i.e. the headers list) will be updated with the new headers.
  • inbox_refreshed_cb reviews the list of new headers, updates the account manager busy state, and then checks to retrieve the latest messages (the full messages).
  • The procedure follows fetching the latest messages with tny_folder_get_msg_async.
  • Once all the messages has been received, then it will ask for sending mails in the mail queues.

New messages notifications to headers list

The headers list (widget ModestHeaderView) is a GtkTreeView that has as model the object TnyGtkHeaderListModel. This model is:

   * A TnyList with all the headers of a folder
   * A TnyFolderObserver, that listens to changes in folder, and updates the list inside with the changes (new messages, removed messages, flags, etc).
   * A GtkListStore. This is just pointing to the headers too, but only the headers we allow to be seen in header view. This is how we implement showing only the latest messages.

(last edited February 25, 2010) - Read Only [info] [diff])
FindPage by browsing or searching
5 best incoming links: ModestArchitecture (5), RecentChanges (5)
5 best outgoing links:
5 most popular nearby: ModestArchitecture (4040), RecentChanges (697)

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment