* Always add a timezone field to the date message, before that was only done
if there was an actual shift. * Automatic whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33606 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -206,12 +206,12 @@ BEmailMessage::ForwardMessage(bool accountFromMail, bool includeAttachments)
|
|||||||
BMailComponent *cmpt = GetComponent(i);
|
BMailComponent *cmpt = GetComponent(i);
|
||||||
if (cmpt == _text_body || cmpt == NULL)
|
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
|
||||||
// ... 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();
|
||||||
@@ -274,7 +274,7 @@ BEmailMessage::Priority()
|
|||||||
{
|
{
|
||||||
int priorityNumber;
|
int priorityNumber;
|
||||||
const char *priorityString;
|
const char *priorityString;
|
||||||
|
|
||||||
/* The usual values are a number from 1 to 5, or one of three words:
|
/* The usual values are a number from 1 to 5, or one of three words:
|
||||||
X-Priority: 1 and/or X-MSMail-Priority: High
|
X-Priority: 1 and/or X-MSMail-Priority: High
|
||||||
X-Priority: 3 and/or X-MSMail-Priority: Normal
|
X-Priority: 3 and/or X-MSMail-Priority: Normal
|
||||||
@@ -335,7 +335,7 @@ void BEmailMessage::SetBCC(const char *bcc) {
|
|||||||
|
|
||||||
void BEmailMessage::SetPriority(int to) {
|
void BEmailMessage::SetPriority(int to) {
|
||||||
char tempString [20];
|
char tempString [20];
|
||||||
|
|
||||||
if (to < 1)
|
if (to < 1)
|
||||||
to = 1;
|
to = 1;
|
||||||
if (to > 5)
|
if (to > 5)
|
||||||
@@ -684,7 +684,7 @@ BEmailMessage::SetToRFC822(BPositionIO *mail_file, size_t length, bool parse_now
|
|||||||
RemoveHeader(name);
|
RemoveHeader(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_body->RemoveHeader("Subject");
|
_body->RemoveHeader("Subject");
|
||||||
_body->RemoveHeader("To");
|
_body->RemoveHeader("To");
|
||||||
_body->RemoveHeader("From");
|
_body->RemoveHeader("From");
|
||||||
@@ -743,15 +743,8 @@ BEmailMessage::RenderToRFC822(BPositionIO *file)
|
|||||||
"%a, %d %b %Y %H:%M:%S", &tm);
|
"%a, %d %b %Y %H:%M:%S", &tm);
|
||||||
|
|
||||||
// GMT offsets are full hours, yes, but you never know :-)
|
// GMT offsets are full hours, yes, but you never know :-)
|
||||||
if (tm.tm_gmtoff) {
|
snprintf(date + length, sizeof(date) - length, " %+03d%02d",
|
||||||
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
tm.tm_gmtoff / 3600, (tm.tm_gmtoff / 60) % 60);
|
||||||
snprintf(date + length, sizeof(date) - length, " %+03d%02d",
|
|
||||||
tm.tm_gmtoff / 3600, (tm.tm_gmtoff / 60) % 60);
|
|
||||||
#else
|
|
||||||
sprintf(date + length, " %+03d%02d",
|
|
||||||
tm.tm_gmtoff / 3600, (tm.tm_gmtoff / 60) % 60);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
SetHeaderField("Date", date);
|
SetHeaderField("Date", date);
|
||||||
}
|
}
|
||||||
@@ -900,10 +893,10 @@ BEmailMessage::RenderTo(BDirectory *dir, BEntry *msg)
|
|||||||
status_t status = dir->CreateFile(worker.String(), &file);
|
status_t status = dir->CreateFile(worker.String(), &file);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
if (msg != NULL)
|
if (msg != NULL)
|
||||||
msg->SetTo(dir,worker.String());
|
msg->SetTo(dir,worker.String());
|
||||||
|
|
||||||
return RenderToRFC822(&file);
|
return RenderToRFC822(&file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -920,9 +913,9 @@ BEmailMessage::Send(bool send_now)
|
|||||||
|
|
||||||
create_directory(via->MetaData()->FindString("path"),0777);
|
create_directory(via->MetaData()->FindString("path"),0777);
|
||||||
BDirectory directory(via->MetaData()->FindString("path"));
|
BDirectory directory(via->MetaData()->FindString("path"));
|
||||||
|
|
||||||
BEntry message;
|
BEntry message;
|
||||||
|
|
||||||
status_t status = RenderTo(&directory,&message);
|
status_t status = RenderTo(&directory,&message);
|
||||||
delete via;
|
delete via;
|
||||||
if (status >= B_OK && send_now) {
|
if (status >= B_OK && send_now) {
|
||||||
@@ -948,11 +941,11 @@ BEmailMessage::Send(bool send_now)
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
BMessenger daemon("application/x-vnd.Be-POST");
|
BMessenger daemon("application/x-vnd.Be-POST");
|
||||||
if (!daemon.IsValid())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
BMessage msg('msnd');
|
BMessage msg('msnd');
|
||||||
msg.AddInt32("chain",_chain_id);
|
msg.AddInt32("chain",_chain_id);
|
||||||
BPath path;
|
BPath path;
|
||||||
|
|||||||
Reference in New Issue
Block a user