Fixed forward with attachments
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9657 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -352,6 +352,23 @@ TEnclosuresView::Focus(bool focus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void recursive_attachment_search(TEnclosuresView *us,BMailContainer *mail) {
|
||||||
|
if (mail == NULL)
|
||||||
|
return;
|
||||||
|
for (int32 i = 0; i < mail->CountComponents(); i++)
|
||||||
|
{
|
||||||
|
BMailComponent *component = mail->GetComponent(i);
|
||||||
|
if (component->ComponentType() == B_MAIL_MULTIPART_CONTAINER)
|
||||||
|
recursive_attachment_search(us,dynamic_cast<BMIMEMultipartMailContainer *>(component));
|
||||||
|
|
||||||
|
BMailAttachment *attachment = dynamic_cast<BMailAttachment *>(component);
|
||||||
|
if (attachment == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
us->fList->AddItem(new TListItem(component));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TEnclosuresView::AddEnclosuresFromMail(BEmailMessage *mail)
|
TEnclosuresView::AddEnclosuresFromMail(BEmailMessage *mail)
|
||||||
{
|
{
|
||||||
@@ -360,7 +377,10 @@ TEnclosuresView::AddEnclosuresFromMail(BEmailMessage *mail)
|
|||||||
BMailComponent *component = mail->GetComponent(i);
|
BMailComponent *component = mail->GetComponent(i);
|
||||||
if (component == mail->Body())
|
if (component == mail->Body())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (component->ComponentType() == B_MAIL_MULTIPART_CONTAINER)
|
||||||
|
recursive_attachment_search(this,dynamic_cast<BMIMEMultipartMailContainer *>(component));
|
||||||
|
|
||||||
BMailAttachment *attachment = dynamic_cast<BMailAttachment *>(component);
|
BMailAttachment *attachment = dynamic_cast<BMailAttachment *>(component);
|
||||||
if (attachment == NULL)
|
if (attachment == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ TMailApp::AboutRequested()
|
|||||||
(new BAlert("",
|
(new BAlert("",
|
||||||
"BeMail\nBy Robert Polic\n\n"
|
"BeMail\nBy Robert Polic\n\n"
|
||||||
"Enhanced by Axel Dörfler and the Dr. Zoidberg crew\n\n"
|
"Enhanced by Axel Dörfler and the Dr. Zoidberg crew\n\n"
|
||||||
"Mail.cpp $Revision: 1.1 $\n"
|
"Mail.cpp $Revision: 1.2 $\n"
|
||||||
"Compiled on " __DATE__ " at " __TIME__ ".",
|
"Compiled on " __DATE__ " at " __TIME__ ".",
|
||||||
"Close"))->Go();
|
"Close"))->Go();
|
||||||
}
|
}
|
||||||
@@ -2875,14 +2875,19 @@ class HorizontalLine : public BView {
|
|||||||
void
|
void
|
||||||
TMailWindow::Print()
|
TMailWindow::Print()
|
||||||
{
|
{
|
||||||
|
BPrintJob print(Title());
|
||||||
|
|
||||||
if (!print_settings)
|
if (!print_settings)
|
||||||
{
|
{
|
||||||
PrintSetup();
|
if (print.Settings()) {
|
||||||
if (!print_settings)
|
print_settings = print.Settings();
|
||||||
return;
|
} else {
|
||||||
|
PrintSetup();
|
||||||
|
if (!print_settings)
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BPrintJob print(Title());
|
|
||||||
print.SetSettings(new BMessage(*print_settings));
|
print.SetSettings(new BMessage(*print_settings));
|
||||||
|
|
||||||
if (print.ConfigJob() == B_NO_ERROR)
|
if (print.ConfigJob() == B_NO_ERROR)
|
||||||
|
|||||||
@@ -340,6 +340,7 @@ void BSimpleMailAttachment::ParseNow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t BSimpleMailAttachment::RenderToRFC822(BPositionIO *render_to) {
|
status_t BSimpleMailAttachment::RenderToRFC822(BPositionIO *render_to) {
|
||||||
|
ParseNow();
|
||||||
BMailComponent::RenderToRFC822(render_to);
|
BMailComponent::RenderToRFC822(render_to);
|
||||||
//---------Massive memory squandering!---ALERT!----------
|
//---------Massive memory squandering!---ALERT!----------
|
||||||
// now with error checks, dumb :-) -- axeld.
|
// now with error checks, dumb :-) -- axeld.
|
||||||
|
|||||||
@@ -427,6 +427,9 @@ void BTextMailComponent::Quote(const char *message, const char *quote_style) {
|
|||||||
|
|
||||||
status_t BTextMailComponent::GetDecodedData(BPositionIO *data) {
|
status_t BTextMailComponent::GetDecodedData(BPositionIO *data) {
|
||||||
ParseRaw();
|
ParseRaw();
|
||||||
|
|
||||||
|
if (data == NULL)
|
||||||
|
return B_IO_ERROR;
|
||||||
|
|
||||||
BMimeType type;
|
BMimeType type;
|
||||||
ssize_t written;
|
ssize_t written;
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ BEmailMessage::ReplyMessage(mail_reply_to_mode replyTo, bool accountFromMail, co
|
|||||||
return to_return;
|
return to_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BEmailMessage *
|
BEmailMessage *
|
||||||
BEmailMessage::ForwardMessage(bool accountFromMail, bool includeAttachments)
|
BEmailMessage::ForwardMessage(bool accountFromMail, bool includeAttachments)
|
||||||
{
|
{
|
||||||
@@ -195,25 +194,23 @@ BEmailMessage::ForwardMessage(bool accountFromMail, bool includeAttachments)
|
|||||||
if (includeAttachments) {
|
if (includeAttachments) {
|
||||||
for (int32 i = 0; i < CountComponents(); i++) {
|
for (int32 i = 0; i < CountComponents(); i++) {
|
||||||
BMailComponent *cmpt = GetComponent(i);
|
BMailComponent *cmpt = GetComponent(i);
|
||||||
if (cmpt == _text_body)
|
if (cmpt == _text_body || cmpt == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//---I am ashamed to have the written the code between here and the next comment
|
//---I am ashamed to have the written the code between here and the next comment
|
||||||
cmpt->GetDecodedData(NULL);
|
|
||||||
// ... and you still managed to get it wrong ;-)), axeld.
|
// ... and you still managed to get it wrong ;-)), axeld.
|
||||||
// we should really move this stuff into copy constructors
|
// we should really move this stuff into copy constructors
|
||||||
// or something like that
|
// or something like that
|
||||||
|
|
||||||
BMallocIO io;
|
BMallocIO io;
|
||||||
cmpt->RenderToRFC822(&io);
|
cmpt->RenderToRFC822(&io);
|
||||||
BMailComponent *clone = cmpt->WhatIsThis();
|
BMailComponent *clone = cmpt->WhatIsThis();
|
||||||
io.Seek(0, SEEK_SET);
|
io.Seek(0, SEEK_SET);
|
||||||
clone->SetToRFC822(&io, io.BufferLength(), true);
|
clone->SetToRFC822(&io, io.BufferLength(), true);
|
||||||
message->AddComponent(clone);
|
message->AddComponent(clone);
|
||||||
//---
|
//---
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accountFromMail)
|
if (accountFromMail)
|
||||||
message->SendViaAccountFrom(this);
|
message->SendViaAccountFrom(this);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user