BMailProtocol: Removed delete/append methods.
* The mail system is file based which makes these methods pretty much superfluous.
This commit is contained in:
@@ -70,11 +70,6 @@ public:
|
||||
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
|
||||
// Mail storage operations
|
||||
virtual status_t MoveMessage(const entry_ref& ref,
|
||||
BDirectory& dir);
|
||||
virtual status_t DeleteMessage(const entry_ref& ref);
|
||||
|
||||
// Convenience methods that call the BMailNotifier
|
||||
void ShowError(const char* error);
|
||||
void ShowMessage(const char* message);
|
||||
@@ -140,8 +135,6 @@ public:
|
||||
BMessenger* replyTo);
|
||||
virtual status_t MarkMessageAsRead(const entry_ref& ref,
|
||||
read_flags flags = B_READ);
|
||||
virtual status_t DeleteMessage(const entry_ref& ref);
|
||||
virtual status_t AppendMessage(const entry_ref& ref);
|
||||
|
||||
static void ReplyBodyFetched(const BMessenger& replyTo,
|
||||
const entry_ref& ref, status_t status);
|
||||
@@ -150,8 +143,6 @@ protected:
|
||||
virtual status_t HandleFetchBody(const entry_ref& ref,
|
||||
const BMessenger& replyTo) = 0;
|
||||
|
||||
virtual status_t HandleDeleteMessage(const entry_ref& ref) = 0;
|
||||
|
||||
void NotiyMailboxSynchronized(status_t status);
|
||||
};
|
||||
|
||||
|
||||
@@ -200,14 +200,6 @@ IMAPProtocol::MarkMessageAsRead(const entry_ref& ref, read_flags flags)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
IMAPProtocol::AppendMessage(const entry_ref& ref)
|
||||
{
|
||||
printf("IMAP: append message %s\n", ref.name);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IMAPProtocol::MessageReceived(BMessage* message)
|
||||
{
|
||||
@@ -247,14 +239,6 @@ IMAPProtocol::HandleFetchBody(const entry_ref& ref, const BMessenger& replyTo)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
IMAPProtocol::HandleDeleteMessage(const entry_ref& ref)
|
||||
{
|
||||
printf("IMAP: delete message %s\n", ref.name);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
IMAPProtocol::ReadyToRun()
|
||||
{
|
||||
|
||||
@@ -47,14 +47,12 @@ public:
|
||||
virtual status_t SyncMessages();
|
||||
virtual status_t MarkMessageAsRead(const entry_ref& ref,
|
||||
read_flags flags = B_READ);
|
||||
virtual status_t AppendMessage(const entry_ref& ref);
|
||||
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
|
||||
protected:
|
||||
virtual status_t HandleFetchBody(const entry_ref& ref,
|
||||
const BMessenger& replyTo);
|
||||
virtual status_t HandleDeleteMessage(const entry_ref& ref);
|
||||
|
||||
void ReadyToRun();
|
||||
|
||||
|
||||
@@ -316,37 +316,6 @@ POP3Protocol::HandleFetchBody(const entry_ref& ref, const BMessenger& replyTo)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
POP3Protocol::HandleDeleteMessage(const entry_ref& ref)
|
||||
{
|
||||
status_t error = Connect();
|
||||
if (error < B_OK)
|
||||
return error;
|
||||
|
||||
error = _RetrieveUniqueIDs();
|
||||
if (error < B_OK) {
|
||||
Disconnect();
|
||||
return error;
|
||||
}
|
||||
|
||||
char uidString[256];
|
||||
BNode node(&ref);
|
||||
if (node.ReadAttr("MAIL:unique_id", B_STRING_TYPE, 0, uidString, 256) < 0) {
|
||||
Disconnect();
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
printf("DeleteMessage: ID is %d\n", (int)fUniqueIDs.IndexOf(uidString));
|
||||
// What should we use for int32 instead of %d?
|
||||
#endif
|
||||
Delete(fUniqueIDs.IndexOf(uidString));
|
||||
|
||||
Disconnect();
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
POP3Protocol::Open(const char* server, int port, int)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,6 @@ public:
|
||||
protected:
|
||||
virtual status_t HandleFetchBody(const entry_ref& ref,
|
||||
const BMessenger& replyTo);
|
||||
virtual status_t HandleDeleteMessage(const entry_ref& ref);
|
||||
|
||||
// pop3 methods
|
||||
status_t Open(const char* server, int port,
|
||||
|
||||
@@ -39,10 +39,6 @@
|
||||
using namespace BPrivate;
|
||||
|
||||
|
||||
const uint32 kMsgDeleteMessage = '&DeM';
|
||||
const uint32 kMsgAppendMessage = '&ApM';
|
||||
|
||||
|
||||
BMailProtocol::BMailProtocol(const char* name,
|
||||
const BMailAccountSettings& settings)
|
||||
:
|
||||
@@ -136,22 +132,6 @@ BMailProtocol::MessageReceived(BMessage* message)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BMailProtocol::MoveMessage(const entry_ref& ref, BDirectory& dir)
|
||||
{
|
||||
BEntry entry(&ref);
|
||||
return entry.MoveTo(&dir);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BMailProtocol::DeleteMessage(const entry_ref& ref)
|
||||
{
|
||||
BEntry entry(&ref);
|
||||
return entry.Remove();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BMailProtocol::ShowError(const char* error)
|
||||
{
|
||||
@@ -435,22 +415,6 @@ BInboundMailProtocol::MessageReceived(BMessage* message)
|
||||
break;
|
||||
}
|
||||
|
||||
case kMsgDeleteMessage:
|
||||
{
|
||||
entry_ref ref;
|
||||
message->FindRef("ref", &ref);
|
||||
DeleteMessage(ref);
|
||||
break;
|
||||
}
|
||||
|
||||
case kMsgAppendMessage:
|
||||
{
|
||||
entry_ref ref;
|
||||
message->FindRef("ref", &ref);
|
||||
AppendMessage(ref);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
BMailProtocol::MessageReceived(message);
|
||||
break;
|
||||
@@ -478,20 +442,6 @@ BInboundMailProtocol::MarkMessageAsRead(const entry_ref& ref, read_flags flag)
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BInboundMailProtocol::DeleteMessage(const entry_ref& ref)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BInboundMailProtocol::AppendMessage(const entry_ref& ref)
|
||||
{
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
/*static*/ void
|
||||
BInboundMailProtocol::ReplyBodyFetched(const BMessenger& replyTo,
|
||||
const entry_ref& ref, status_t status)
|
||||
|
||||
Reference in New Issue
Block a user