diff --git a/src/servers/mail/MailDaemon.cpp b/src/servers/mail/MailDaemon.cpp index 54597692c8..9c0a317e5f 100644 --- a/src/servers/mail/MailDaemon.cpp +++ b/src/servers/mail/MailDaemon.cpp @@ -458,9 +458,8 @@ MailDaemonApp::GetNewMessages(BMessage* msg) int32 account = -1; if (msg->FindInt32("account", &account) == B_OK && account >= 0) { InboundProtocolThread* protocol = _FindInboundProtocol(account); - if (!protocol) - return; - protocol->SyncMessages(); + if (protocol != NULL) + protocol->SyncMessages(); return; } @@ -468,9 +467,8 @@ MailDaemonApp::GetNewMessages(BMessage* msg) AccountMap::const_iterator it = fAccounts.begin(); for (; it != fAccounts.end(); it++) { InboundProtocolThread* protocol = it->second.inboundThread; - if (!protocol) - continue; - protocol->SyncMessages(); + if (protocol != NULL) + protocol->SyncMessages(); } } @@ -483,7 +481,6 @@ MailDaemonApp::SendPendingMessages(BMessage* msg) map messages; - int32 account = -1; if (msg->FindInt32("account", &account) != B_OK) account = -1; @@ -738,7 +735,6 @@ MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings, image_id& image) { const entry_ref& entry = settings.InboundPath(); - InboundProtocol* (*instantiate_protocol)(BMailAccountSettings*); BPath path(&entry); @@ -746,13 +742,12 @@ MailDaemonApp::_CreateInboundProtocol(BMailAccountSettings& settings, if (image < 0) return NULL; if (get_image_symbol(image, "instantiate_inbound_protocol", - B_SYMBOL_TYPE_TEXT, (void **)&instantiate_protocol) != B_OK) { + B_SYMBOL_TYPE_TEXT, (void**)&instantiate_protocol) != B_OK) { unload_add_on(image); image = -1; return NULL; } - InboundProtocol* protocol = (*instantiate_protocol)(&settings); - return protocol; + return (*instantiate_protocol)(&settings); } @@ -761,7 +756,6 @@ MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings, image_id& image) { const entry_ref& entry = settings.OutboundPath(); - OutboundProtocol* (*instantiate_protocol)(BMailAccountSettings*); BPath path(&entry); @@ -769,13 +763,12 @@ MailDaemonApp::_CreateOutboundProtocol(BMailAccountSettings& settings, if (image < 0) return NULL; if (get_image_symbol(image, "instantiate_outbound_protocol", - B_SYMBOL_TYPE_TEXT, (void **)&instantiate_protocol) != B_OK) { + B_SYMBOL_TYPE_TEXT, (void**)&instantiate_protocol) != B_OK) { unload_add_on(image); image = -1; return NULL; } - OutboundProtocol* protocol = (*instantiate_protocol)(&settings); - return protocol; + return (*instantiate_protocol)(&settings); }