Define B_MAIL_DAEMON_SIGNATURE and use it instead of hardcoding the signature everywhere.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42966 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <E-mail.h>
|
||||
|
||||
|
||||
#define B_MAIL_DAEMON_SIGNATURE "application/x-vnd.Be-POST"
|
||||
|
||||
const uint32 kMsgCheckAndSend = 'mbth';
|
||||
const uint32 kMsgCheckMessage = 'mnow';
|
||||
const uint32 kMsgSendMessages = 'msnd';
|
||||
@@ -22,6 +24,9 @@ const uint32 kMsgFetchBody = 'mfeb';
|
||||
const uint32 kMsgBodyFetched = 'mbfe';
|
||||
|
||||
|
||||
class BMessenger;
|
||||
|
||||
|
||||
class BMailDaemon {
|
||||
public:
|
||||
//! accountID = -1 means check all accounts
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
status_t
|
||||
BMailDaemon::CheckMail(int32 accountID)
|
||||
{
|
||||
BMessenger daemon("application/x-vnd.Be-POST");
|
||||
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||
if (!daemon.IsValid())
|
||||
return B_MAIL_NO_DAEMON;
|
||||
|
||||
@@ -30,7 +30,7 @@ BMailDaemon::CheckMail(int32 accountID)
|
||||
status_t
|
||||
BMailDaemon::CheckAndSendQueuedMail(int32 accountID)
|
||||
{
|
||||
BMessenger daemon("application/x-vnd.Be-POST");
|
||||
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||
if (!daemon.IsValid())
|
||||
return B_MAIL_NO_DAEMON;
|
||||
|
||||
@@ -43,7 +43,7 @@ BMailDaemon::CheckAndSendQueuedMail(int32 accountID)
|
||||
status_t
|
||||
BMailDaemon::SendQueuedMail()
|
||||
{
|
||||
BMessenger daemon("application/x-vnd.Be-POST");
|
||||
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||
if (!daemon.IsValid())
|
||||
return B_MAIL_NO_DAEMON;
|
||||
|
||||
@@ -54,7 +54,7 @@ BMailDaemon::SendQueuedMail()
|
||||
int32
|
||||
BMailDaemon::CountNewMessages(bool wait_for_fetch_completion)
|
||||
{
|
||||
BMessenger daemon("application/x-vnd.Be-POST");
|
||||
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||
if (!daemon.IsValid())
|
||||
return B_MAIL_NO_DAEMON;
|
||||
|
||||
@@ -73,7 +73,7 @@ BMailDaemon::CountNewMessages(bool wait_for_fetch_completion)
|
||||
status_t
|
||||
BMailDaemon::MarkAsRead(int32 account, const entry_ref& ref, read_flags flag)
|
||||
{
|
||||
BMessenger daemon("application/x-vnd.Be-POST");
|
||||
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||
if (!daemon.IsValid())
|
||||
return B_MAIL_NO_DAEMON;
|
||||
|
||||
@@ -89,7 +89,7 @@ BMailDaemon::MarkAsRead(int32 account, const entry_ref& ref, read_flags flag)
|
||||
status_t
|
||||
BMailDaemon::FetchBody(const entry_ref& ref, BMessenger* listener)
|
||||
{
|
||||
BMessenger daemon("application/x-vnd.Be-POST");
|
||||
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||
if (!daemon.IsValid())
|
||||
return B_MAIL_NO_DAEMON;
|
||||
|
||||
@@ -106,7 +106,7 @@ BMailDaemon::FetchBody(const entry_ref& ref, BMessenger* listener)
|
||||
status_t
|
||||
BMailDaemon::Quit()
|
||||
{
|
||||
BMessenger daemon("application/x-vnd.Be-POST");
|
||||
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||
if (!daemon.IsValid())
|
||||
return B_MAIL_NO_DAEMON;
|
||||
|
||||
|
||||
@@ -948,7 +948,7 @@ BEmailMessage::Send(bool sendNow)
|
||||
// TODO!
|
||||
}
|
||||
|
||||
BMessenger daemon("application/x-vnd.Be-POST");
|
||||
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||
if (!daemon.IsValid())
|
||||
return B_MAIL_NO_DAEMON;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <Entry.h>
|
||||
#include <File.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <MailDaemon.h>
|
||||
#include <Message.h>
|
||||
#include <Messenger.h>
|
||||
#include <Path.h>
|
||||
@@ -72,7 +73,7 @@ BMailSettings::Save(bigtime_t /*timeout*/)
|
||||
if (result < B_OK)
|
||||
return result;
|
||||
|
||||
BMessenger("application/x-vnd.Be-POST").SendMessage('mrrs');
|
||||
BMessenger(B_MAIL_DAEMON_SIGNATURE).SendMessage('mrrs');
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
@@ -224,7 +225,7 @@ BMailSettings::SetStatusWindowWorkspaces(int32 workspace)
|
||||
|
||||
BMessage msg('wsch');
|
||||
msg.AddInt32("StatusWindowWorkSpace",workspace);
|
||||
BMessenger("application/x-vnd.Be-POST").SendMessage(&msg);
|
||||
BMessenger(B_MAIL_DAEMON_SIGNATURE).SendMessage(&msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +244,7 @@ BMailSettings::SetStatusWindowLook(int32 look)
|
||||
|
||||
BMessage msg('lkch');
|
||||
msg.AddInt32("StatusWindowLook", look);
|
||||
BMessenger("application/x-vnd.Be-POST").SendMessage(&msg);
|
||||
BMessenger(B_MAIL_DAEMON_SIGNATURE).SendMessage(&msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ void DeskbarView::AttachedToWindow()
|
||||
|
||||
SetLowColor(ViewColor());
|
||||
|
||||
if (be_roster->IsRunning("application/x-vnd.Be-POST")) {
|
||||
if (be_roster->IsRunning(B_MAIL_DAEMON_SIGNATURE)) {
|
||||
_RefreshMailQuery();
|
||||
} else {
|
||||
BDeskbar deskbar;
|
||||
@@ -203,7 +203,7 @@ status_t DeskbarView::Archive(BMessage *data,bool deep) const
|
||||
{
|
||||
BView::Archive(data, deep);
|
||||
|
||||
data->AddString("add_on", "application/x-vnd.Be-POST");
|
||||
data->AddString("add_on", B_MAIL_DAEMON_SIGNATURE);
|
||||
return B_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ addAttribute(BMessage& msg, const char* name, const char* publicName,
|
||||
|
||||
MailDaemonApp::MailDaemonApp()
|
||||
:
|
||||
BApplication("application/x-vnd.Be-POST"),
|
||||
BApplication(B_MAIL_DAEMON_SIGNATURE),
|
||||
|
||||
fAutoCheckRunner(NULL)
|
||||
{
|
||||
@@ -423,7 +423,7 @@ MailDaemonApp::InstallDeskbarIcon()
|
||||
BRoster roster;
|
||||
entry_ref ref;
|
||||
|
||||
status_t status = roster.FindApp("application/x-vnd.Be-POST", &ref);
|
||||
status_t status = roster.FindApp(B_MAIL_DAEMON_SIGNATURE, &ref);
|
||||
if (status < B_OK) {
|
||||
fprintf(stderr, "Can't find application to tell deskbar: %s\n",
|
||||
strerror(status));
|
||||
|
||||
Reference in New Issue
Block a user