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>
|
#include <E-mail.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define B_MAIL_DAEMON_SIGNATURE "application/x-vnd.Be-POST"
|
||||||
|
|
||||||
const uint32 kMsgCheckAndSend = 'mbth';
|
const uint32 kMsgCheckAndSend = 'mbth';
|
||||||
const uint32 kMsgCheckMessage = 'mnow';
|
const uint32 kMsgCheckMessage = 'mnow';
|
||||||
const uint32 kMsgSendMessages = 'msnd';
|
const uint32 kMsgSendMessages = 'msnd';
|
||||||
@@ -22,6 +24,9 @@ const uint32 kMsgFetchBody = 'mfeb';
|
|||||||
const uint32 kMsgBodyFetched = 'mbfe';
|
const uint32 kMsgBodyFetched = 'mbfe';
|
||||||
|
|
||||||
|
|
||||||
|
class BMessenger;
|
||||||
|
|
||||||
|
|
||||||
class BMailDaemon {
|
class BMailDaemon {
|
||||||
public:
|
public:
|
||||||
//! accountID = -1 means check all accounts
|
//! accountID = -1 means check all accounts
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
status_t
|
status_t
|
||||||
BMailDaemon::CheckMail(int32 accountID)
|
BMailDaemon::CheckMail(int32 accountID)
|
||||||
{
|
{
|
||||||
BMessenger daemon("application/x-vnd.Be-POST");
|
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||||
if (!daemon.IsValid())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ BMailDaemon::CheckMail(int32 accountID)
|
|||||||
status_t
|
status_t
|
||||||
BMailDaemon::CheckAndSendQueuedMail(int32 accountID)
|
BMailDaemon::CheckAndSendQueuedMail(int32 accountID)
|
||||||
{
|
{
|
||||||
BMessenger daemon("application/x-vnd.Be-POST");
|
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||||
if (!daemon.IsValid())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ BMailDaemon::CheckAndSendQueuedMail(int32 accountID)
|
|||||||
status_t
|
status_t
|
||||||
BMailDaemon::SendQueuedMail()
|
BMailDaemon::SendQueuedMail()
|
||||||
{
|
{
|
||||||
BMessenger daemon("application/x-vnd.Be-POST");
|
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||||
if (!daemon.IsValid())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ BMailDaemon::SendQueuedMail()
|
|||||||
int32
|
int32
|
||||||
BMailDaemon::CountNewMessages(bool wait_for_fetch_completion)
|
BMailDaemon::CountNewMessages(bool wait_for_fetch_completion)
|
||||||
{
|
{
|
||||||
BMessenger daemon("application/x-vnd.Be-POST");
|
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||||
if (!daemon.IsValid())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ BMailDaemon::CountNewMessages(bool wait_for_fetch_completion)
|
|||||||
status_t
|
status_t
|
||||||
BMailDaemon::MarkAsRead(int32 account, const entry_ref& ref, read_flags flag)
|
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())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ BMailDaemon::MarkAsRead(int32 account, const entry_ref& ref, read_flags flag)
|
|||||||
status_t
|
status_t
|
||||||
BMailDaemon::FetchBody(const entry_ref& ref, BMessenger* listener)
|
BMailDaemon::FetchBody(const entry_ref& ref, BMessenger* listener)
|
||||||
{
|
{
|
||||||
BMessenger daemon("application/x-vnd.Be-POST");
|
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||||
if (!daemon.IsValid())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ BMailDaemon::FetchBody(const entry_ref& ref, BMessenger* listener)
|
|||||||
status_t
|
status_t
|
||||||
BMailDaemon::Quit()
|
BMailDaemon::Quit()
|
||||||
{
|
{
|
||||||
BMessenger daemon("application/x-vnd.Be-POST");
|
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||||
if (!daemon.IsValid())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
|
|||||||
@@ -948,7 +948,7 @@ BEmailMessage::Send(bool sendNow)
|
|||||||
// TODO!
|
// TODO!
|
||||||
}
|
}
|
||||||
|
|
||||||
BMessenger daemon("application/x-vnd.Be-POST");
|
BMessenger daemon(B_MAIL_DAEMON_SIGNATURE);
|
||||||
if (!daemon.IsValid())
|
if (!daemon.IsValid())
|
||||||
return B_MAIL_NO_DAEMON;
|
return B_MAIL_NO_DAEMON;
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
|
#include <MailDaemon.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -72,7 +73,7 @@ BMailSettings::Save(bigtime_t /*timeout*/)
|
|||||||
if (result < B_OK)
|
if (result < B_OK)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
BMessenger("application/x-vnd.Be-POST").SendMessage('mrrs');
|
BMessenger(B_MAIL_DAEMON_SIGNATURE).SendMessage('mrrs');
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -224,7 +225,7 @@ BMailSettings::SetStatusWindowWorkspaces(int32 workspace)
|
|||||||
|
|
||||||
BMessage msg('wsch');
|
BMessage msg('wsch');
|
||||||
msg.AddInt32("StatusWindowWorkSpace",workspace);
|
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');
|
BMessage msg('lkch');
|
||||||
msg.AddInt32("StatusWindowLook", look);
|
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());
|
SetLowColor(ViewColor());
|
||||||
|
|
||||||
if (be_roster->IsRunning("application/x-vnd.Be-POST")) {
|
if (be_roster->IsRunning(B_MAIL_DAEMON_SIGNATURE)) {
|
||||||
_RefreshMailQuery();
|
_RefreshMailQuery();
|
||||||
} else {
|
} else {
|
||||||
BDeskbar deskbar;
|
BDeskbar deskbar;
|
||||||
@@ -203,7 +203,7 @@ status_t DeskbarView::Archive(BMessage *data,bool deep) const
|
|||||||
{
|
{
|
||||||
BView::Archive(data, deep);
|
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;
|
return B_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ addAttribute(BMessage& msg, const char* name, const char* publicName,
|
|||||||
|
|
||||||
MailDaemonApp::MailDaemonApp()
|
MailDaemonApp::MailDaemonApp()
|
||||||
:
|
:
|
||||||
BApplication("application/x-vnd.Be-POST"),
|
BApplication(B_MAIL_DAEMON_SIGNATURE),
|
||||||
|
|
||||||
fAutoCheckRunner(NULL)
|
fAutoCheckRunner(NULL)
|
||||||
{
|
{
|
||||||
@@ -423,7 +423,7 @@ MailDaemonApp::InstallDeskbarIcon()
|
|||||||
BRoster roster;
|
BRoster roster;
|
||||||
entry_ref ref;
|
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) {
|
if (status < B_OK) {
|
||||||
fprintf(stderr, "Can't find application to tell deskbar: %s\n",
|
fprintf(stderr, "Can't find application to tell deskbar: %s\n",
|
||||||
strerror(status));
|
strerror(status));
|
||||||
|
|||||||
Reference in New Issue
Block a user