Hi,

(continued below)
On Dec 5, 2003, at 12:46 AM, Ricardo Andere de Mello wrote:

err... I moved some messages from one folder to a dmail account using kmail,
and then messages showed the size of 0 bytes.

looking at the code I found this at mysql/mysql.c:

 snprintf(query, DEF_QUERYSIZE, "INSERT INTO messages "
           "(mailbox_idnr,messagesize,unique_id,internal_date,status,"
           " seen_flag) VALUES (%llu, 0, \"\", \"%s\",%d,1)",
           mboxid, timestr, STATUS_SEEN);

is there any reason to set the size directly to 0?

why not:

snprintf(query, DEF_QUERYSIZE, "INSERT INTO messages "
           "(mailbox_idnr,messagesize,unique_id,internal_date,status,"
           " seen_flag) VALUES (%llu, %llu, \"\", \"%s\",%d,1)",
           mboxid, datalen, timestr, STATUS_SEEN);

Messagesize is calculated after the messagerecord is inserted. After all messageblocks are inserted, a call
to db_update_message() will set the messagesize.

Ilja

--
IC&S
Stadhouderslaan 57
3583 JD Utrecht
telnr. 030-6355730
faxnr. 030-6355731

PGP-key:
http://www.ic-s.nl/keys/ilja.txt

Reply via email to