Renamed BMailRemoteStorageProtocol to BRemoteMailStorageProtocol. Because I like it better. This should complete the API modifications from the Haiku import.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9379 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,10 +8,10 @@
|
|||||||
#include <MailProtocol.h>
|
#include <MailProtocol.h>
|
||||||
#include <StringList.h>
|
#include <StringList.h>
|
||||||
|
|
||||||
class BMailRemoteStorageProtocol : public BMailProtocol {
|
class BRemoteMailStorageProtocol : public BMailProtocol {
|
||||||
public:
|
public:
|
||||||
BMailRemoteStorageProtocol(BMessage *settings, BMailChainRunner *runner);
|
BRemoteMailStorageProtocol(BMessage *settings, BMailChainRunner *runner);
|
||||||
virtual ~BMailRemoteStorageProtocol();
|
virtual ~BRemoteMailStorageProtocol();
|
||||||
|
|
||||||
virtual status_t GetMessage(const char *mailbox, const char *message, BPositionIO **, BMessage *headers) = 0;
|
virtual status_t GetMessage(const char *mailbox, const char *message, BPositionIO **, BMessage *headers) = 0;
|
||||||
virtual status_t AddMessage(const char *mailbox, BPositionIO *data, BString *id) = 0;
|
virtual status_t AddMessage(const char *mailbox, BPositionIO *data, BString *id) = 0;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ struct mailbox_info {
|
|||||||
BString server_mb_name;
|
BString server_mb_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IMAP4Client : public BMailRemoteStorageProtocol {
|
class IMAP4Client : public BRemoteMailStorageProtocol {
|
||||||
public:
|
public:
|
||||||
IMAP4Client(BMessage *settings, BMailChainRunner *run);
|
IMAP4Client(BMessage *settings, BMailChainRunner *run);
|
||||||
virtual ~IMAP4Client();
|
virtual ~IMAP4Client();
|
||||||
@@ -118,7 +118,7 @@ class NoopWorker : public BHandler {
|
|||||||
time_t last_run;
|
time_t last_run;
|
||||||
};
|
};
|
||||||
|
|
||||||
IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BMailRemoteStorageProtocol(settings,run), noop(NULL), commandCount(0), net(-1), selected_mb(""), force_reselect(false) {
|
IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BRemoteMailStorageProtocol(settings,run), noop(NULL), commandCount(0), net(-1), selected_mb(""), force_reselect(false) {
|
||||||
err = B_OK;
|
err = B_OK;
|
||||||
|
|
||||||
mb_root = settings->FindString("root");
|
mb_root = settings->FindString("root");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
class _EXPORT BMailRemoteStorageProtocol;
|
class _EXPORT BRemoteMailStorageProtocol;
|
||||||
|
|
||||||
#include <RemoteStorageProtocol.h>
|
#include <RemoteStorageProtocol.h>
|
||||||
#include <ChainRunner.h>
|
#include <ChainRunner.h>
|
||||||
@@ -19,7 +19,7 @@ void GetSubFolders(BDirectory *of, BStringList *folders, const char *prepend = "
|
|||||||
|
|
||||||
class UpdateHandler : public BHandler {
|
class UpdateHandler : public BHandler {
|
||||||
public:
|
public:
|
||||||
UpdateHandler(BMailRemoteStorageProtocol *prot, const char *dest) : _prot(prot), _dest(dest) {
|
UpdateHandler(BRemoteMailStorageProtocol *prot, const char *dest) : _prot(prot), _dest(dest) {
|
||||||
node_ref ref;
|
node_ref ref;
|
||||||
_dest.GetNodeRef(&ref);
|
_dest.GetNodeRef(&ref);
|
||||||
dest_node = ref.node;
|
dest_node = ref.node;
|
||||||
@@ -231,7 +231,7 @@ class UpdateHandler : public BHandler {
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BMailRemoteStorageProtocol *_prot;
|
BRemoteMailStorageProtocol *_prot;
|
||||||
BDirectory _dest;
|
BDirectory _dest;
|
||||||
|
|
||||||
map<int64, const char *> nodes;
|
map<int64, const char *> nodes;
|
||||||
@@ -258,19 +258,19 @@ void GetSubFolders(BDirectory *of, BStringList *folders, const char *prepend) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BMailRemoteStorageProtocol::BMailRemoteStorageProtocol(BMessage *settings, BMailChainRunner *runner) : BMailProtocol(settings,runner) {
|
BRemoteMailStorageProtocol::BRemoteMailStorageProtocol(BMessage *settings, BMailChainRunner *runner) : BMailProtocol(settings,runner) {
|
||||||
handler = new UpdateHandler(this,runner->Chain()->MetaData()->FindString("path"));
|
handler = new UpdateHandler(this,runner->Chain()->MetaData()->FindString("path"));
|
||||||
runner->AddHandler(handler);
|
runner->AddHandler(handler);
|
||||||
runner->PostMessage('INIT',handler);
|
runner->PostMessage('INIT',handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
BMailRemoteStorageProtocol::~BMailRemoteStorageProtocol() {
|
BRemoteMailStorageProtocol::~BRemoteMailStorageProtocol() {
|
||||||
delete handler;
|
delete handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----BMailProtocol stuff
|
//----BMailProtocol stuff
|
||||||
status_t BMailRemoteStorageProtocol::GetMessage(
|
status_t BRemoteMailStorageProtocol::GetMessage(
|
||||||
const char* uid,
|
const char* uid,
|
||||||
BPositionIO** out_file, BMessage* out_headers,
|
BPositionIO** out_file, BMessage* out_headers,
|
||||||
BPath* out_folder_location) {
|
BPath* out_folder_location) {
|
||||||
@@ -285,7 +285,7 @@ status_t BMailRemoteStorageProtocol::GetMessage(
|
|||||||
return GetMessage(folder.String(),id.String(),out_file,out_headers);
|
return GetMessage(folder.String(),id.String(),out_file,out_headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t BMailRemoteStorageProtocol::DeleteMessage(const char* uid) {
|
status_t BRemoteMailStorageProtocol::DeleteMessage(const char* uid) {
|
||||||
BString folder(uid), id;
|
BString folder(uid), id;
|
||||||
{
|
{
|
||||||
BString raw(uid);
|
BString raw(uid);
|
||||||
@@ -302,7 +302,7 @@ status_t BMailRemoteStorageProtocol::DeleteMessage(const char* uid) {
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BMailRemoteStorageProtocol::SyncMailbox(const char *mailbox) {
|
void BRemoteMailStorageProtocol::SyncMailbox(const char *mailbox) {
|
||||||
BPath path(runner->Chain()->MetaData()->FindString("path"));
|
BPath path(runner->Chain()->MetaData()->FindString("path"));
|
||||||
path.Append(mailbox);
|
path.Append(mailbox);
|
||||||
|
|
||||||
@@ -360,7 +360,7 @@ void BMailRemoteStorageProtocol::SyncMailbox(const char *mailbox) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*status_t BMailRemoteStorageProtocol::MoveMessage(const char *mailbox, const char *to_mailbox, BString *message) {
|
/*status_t BRemoteMailStorageProtocol::MoveMessage(const char *mailbox, const char *to_mailbox, BString *message) {
|
||||||
BString new_id(*message);
|
BString new_id(*message);
|
||||||
status_t err;
|
status_t err;
|
||||||
if ((err = CopyMessage(mailbox,to_mailbox,&new_id)) < B_OK)
|
if ((err = CopyMessage(mailbox,to_mailbox,&new_id)) < B_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user