From b44215c079ec8bff24d4bda55a94fec0d9842d42 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 17 Jun 2014 09:39:28 +0200 Subject: [PATCH] BRoster::Private::SendTo(): Actually support NULL reply Unlike documented passing a NULL reply would just fail instead of sending the message without waiting for a reply. --- src/kits/app/RosterPrivate.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/kits/app/RosterPrivate.cpp b/src/kits/app/RosterPrivate.cpp index 06f730c540..261b84c8ca 100644 --- a/src/kits/app/RosterPrivate.cpp +++ b/src/kits/app/RosterPrivate.cpp @@ -48,7 +48,7 @@ BRoster::Private::SetTo(BMessenger mainMessenger, BMessenger mimeMessenger) \param message The message to be sent. \param reply A pointer to a pre-allocated BMessage into which the reply - message will be copied. + message will be copied. May be \c NULL. \param mime \c true, if the message should be sent to the MIME data base service, \c false for the roster. \return @@ -65,10 +65,12 @@ BRoster::Private::SendTo(BMessage *message, BMessage *reply, bool mime) if (fRoster == NULL) return B_NO_INIT; - if (mime) - return fRoster->_MimeMessenger().SendMessage(message, reply); + const BMessenger& messenger = mime + ? fRoster->_MimeMessenger() : fRoster->fMessenger; - return fRoster->fMessenger.SendMessage(message, reply); + return reply != NULL + ? messenger.SendMessage(message, reply) + : messenger.SendMessage(message); }