More Qs about Message copy/transfer



I'm still a bit frustrated about this transfer messages problem,
especially as it relates to deleting files.

For some reason, even when the destination mailbox is open, the following
works in send.c

mutt_write_fcc(...);
mailbox_check_new_messages(mailbox);
LOCK_MAILBOX(mailbox);
load_messages(mailbox, 1);
UNLOCK_MAILBOX(mailbox);

The message shows up immediately, and you can view both old and new
messages.

But, in the message_move function:

mutt_append_message(...);

then, calling in a parent function:

mailbox_check_new_messages(dest)
LOCK_MAILBOX(dest);
load_messages(dest, 1);
UNLOCK_MAILBOX(dest);

...doesn't work.

If you allow message_move to send out a watcher message, the header shows
up in the open index, but if you select it, balsa crashes.  If you don't,
it doesn't show up.

Using different combinations of the above, I've managed to get
message_move to move a file to a new open folder and:
1) select the new message in the open dest. folder, but selecting any
other crashes.
2) select the old messages in the dest. folder, but selecting the new
message crashes.

I can't get mutt_write_fcc to work from message move because the process
of creating the message is different if you're creating it from the
composition dialog (it seems) than if you're creating it from a mailbox
file.  (calling mutt_write_fcc with a header/file from another balsa
mailbox in this context caused balsa to crash, for me.)

There has been one and only one solution that's worked for me, and that
is:
If the destination mailbox is 'open' in the notebook, close and destroy
the notebook page, copy the message, open a new notebook page with the
destination mailbox, move the 'source' notebook page back to the front.

As you can see, it's a pretty undesirable hack.

Can someone who knows the mutt/libmutt code better than I do tell me why
mutt_write_fcc (from sendlib.c?) would work to do this but
mutt_append_message from copy.c wouldn't?

Another approach -- is there some way to force an index page to reload the
contents of the index from a mailbox file?  (Maybe I should just write a
reload function).  Is there some way to get the combination of
mailbox_check_new_messages(mbox)/load_messages(mbox, 1) to work here as it
does in send.c?

Sorry if I have some of these function names a bit turned around -- I'm on
a windows machine away from home and I don't have the code in front of me.

It's probably something obvious and stupid that I just haven't seen...
but, for some reason, I'm just not getting very far with it.

David





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]