* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see http://www.gnu.org/licenses/ .
+ * along with this program. If not, see https://www.gnu.org/licenses/ .
*
* Author: Carl Worth <cworth@cworth.org>
*/
#define EMPTY_STRING(s) ((s)[0] == '\0')
-struct visible _notmuch_thread {
+struct _notmuch_thread {
notmuch_database_t *notmuch;
char *thread_id;
char *subject;
GHashTable *message_hash;
int total_messages;
+ int total_files;
int matched_messages;
time_t oldest;
time_t newest;
_notmuch_message_list_add_message (thread->message_list,
talloc_steal (thread, message));
thread->total_messages++;
+ thread->total_files += notmuch_message_count_files (message);
g_hash_table_insert (thread->message_hash,
xstrdup (notmuch_message_get_message_id (message)),
notmuch_messages_t *messages;
notmuch_message_t *message;
+ notmuch_status_t status;
seed_message = _notmuch_message_create (local, notmuch, seed_doc_id, NULL);
if (! seed_message)
free, NULL);
thread->total_messages = 0;
+ thread->total_files = 0;
thread->matched_messages = 0;
thread->oldest = 0;
thread->newest = 0;
* oldest or newest subject is desired. */
notmuch_query_set_sort (thread_id_query, NOTMUCH_SORT_OLDEST_FIRST);
- /* XXX: this should use the _st version, but it needs an error path
- */
- for (messages = notmuch_query_search_messages (thread_id_query);
+ status = notmuch_query_search_messages (thread_id_query, &messages);
+ if (status)
+ goto DONE;
+
+ for (;
notmuch_messages_valid (messages);
notmuch_messages_move_to_next (messages))
{
return thread->total_messages;
}
+int
+notmuch_thread_get_total_files (notmuch_thread_t *thread)
+{
+ return thread->total_files;
+}
+
int
notmuch_thread_get_matched_messages (notmuch_thread_t *thread)
{