diff --git a/libtransport/AdminInterface.cpp b/libtransport/AdminInterface.cpp index 496e72f0b11b2737317e818802e88513243e39ea..c0d2561c6877bd93f15b165eee62114f75342cd2 100644 --- a/libtransport/AdminInterface.cpp +++ b/libtransport/AdminInterface.cpp @@ -64,7 +64,7 @@ AdminInterface::~AdminInterface() { void AdminInterface::handleQuery(Swift::Message::ref message) { #if HAVE_SWIFTEN_3 - std::string msg = message->getBody().value_or(""); + std::string msg = message->getBody().get_value_or(""); #else std::string msg = message->getBody(); #endif @@ -390,7 +390,7 @@ void AdminInterface::handleMessageReceived(Swift::Message::ref message) { // Ignore empty messages #if HAVE_SWIFTEN_3 - if (message->getBody().value_or("").empty()) { + if (message->getBody().get_value_or("").empty()) { return; } #else diff --git a/libtransport/NetworkPluginServer.cpp b/libtransport/NetworkPluginServer.cpp index 547dca5f9763156709b5764f25550679fa4503d2..f6daecc0364ce9888f2fdb52a53692f7cd37a250 100644 --- a/libtransport/NetworkPluginServer.cpp +++ b/libtransport/NetworkPluginServer.cpp @@ -971,7 +971,7 @@ void NetworkPluginServer::handleQueryPayload(Backend *b, const std::string &data pbnetwork::BackendConfig response; #if HAVE_SWIFTEN_3 - response.set_config(msg->getBody().value_or("")); + response.set_config(msg->getBody().get_value_or("")); #else response.set_config(msg->getBody()); #endif @@ -1697,7 +1697,7 @@ void NetworkPluginServer::handleMessageReceived(NetworkConversation *conv, boost m.set_username(conv->getConversationManager()->getUser()->getJID().toBare()); m.set_buddyname(conv->getLegacyName()); #if HAVE_SWIFTEN_3 - m.set_message(msg->getBody().value_or("")); + m.set_message(msg->getBody().get_value_or("")); #else m.set_message(msg->getBody()); #endif @@ -1737,7 +1737,7 @@ void NetworkPluginServer::handleMessageReceived(NetworkConversation *conv, boost // Send normal message #if HAVE_SWIFTEN_3 - std::string body = msg->getBody().value_or(""); + std::string body = msg->getBody().get_value_or(""); #else std::string body = msg->getBody(); #endif diff --git a/libtransport/UserManager.cpp b/libtransport/UserManager.cpp index a7dc7335fdd83bce5afc5dcce6ca1e021c54b601..973444be514df24af60ec117dcd3bad9486c6a5e 100644 --- a/libtransport/UserManager.cpp +++ b/libtransport/UserManager.cpp @@ -375,7 +375,7 @@ void UserManager::handleMessageReceived(Swift::Message::ref message) { } #if HAVE_SWIFTEN_3 - std::string body = message->getBody().value_or(""); + std::string body = message->getBody().get_value_or(""); #else std::string body = message->getBody(); #endif diff --git a/spectrum/src/frontends/slack/SlackSession.cpp b/spectrum/src/frontends/slack/SlackSession.cpp index 0334a4d84d8bf5109e8d07c35e0c0424de88535f..8352503ed2a7b0ff58a4302088bd8e8bc4ce0361 100644 --- a/spectrum/src/frontends/slack/SlackSession.cpp +++ b/spectrum/src/frontends/slack/SlackSession.cpp @@ -151,7 +151,7 @@ void SlackSession::sendMessage(boost::shared_ptr message) { LOG4CXX_INFO(logger, m_uinfo.jid << "Sending message to Slack channel " << channel << " from " << from); #if HAVE_SWIFTEN_3 - std::string body = message->getBody().value_or(""); + std::string body = message->getBody().get_value_or(""); #else std::string body = message->getBody(); #endif diff --git a/spectrum/src/frontends/slack/SlackUserManager.cpp b/spectrum/src/frontends/slack/SlackUserManager.cpp index 02f064a4bc556a6c2bf8636256300382b55f8b6d..6cf0f1ae6ff46741e2dc849d378685ceac2aeaa3 100644 --- a/spectrum/src/frontends/slack/SlackUserManager.cpp +++ b/spectrum/src/frontends/slack/SlackUserManager.cpp @@ -110,7 +110,7 @@ void SlackUserManager::handleUserCreated(User *user) { bool SlackUserManager::handleAdminMessage(Swift::Message::ref message) { #if HAVE_SWIFTEN_3 - std::string body = message->getBody().value_or(""); + std::string body = message->getBody().get_value_or(""); #else std::string body = message->getBody(); #endif diff --git a/tests/libtransport/conversationmanager.cpp b/tests/libtransport/conversationmanager.cpp index 0bf6a73779753cf6ca6733258979ee59b5c6d5ed..454de5143ae59a370554a690e0a7aeace4aa1165 100644 --- a/tests/libtransport/conversationmanager.cpp +++ b/tests/libtransport/conversationmanager.cpp @@ -14,7 +14,7 @@ using namespace Transport; #if !HAVE_SWIFTEN_3 -#define value_or(X) substr() +#define get_value_or(X) substr() #endif class ConversationManagerTest : public CPPUNIT_NS :: TestFixture, public BasicTest { diff --git a/tests/libtransport/user.cpp b/tests/libtransport/user.cpp index 714ac48e988cad4306484c389873c645bdb600c4..6180c8d03697d7ca5219fd4d5b70e11729f4e985 100644 --- a/tests/libtransport/user.cpp +++ b/tests/libtransport/user.cpp @@ -13,7 +13,7 @@ using namespace Transport; #if !HAVE_SWIFTEN_3 -#define value_or(X) substr() +#define get_value_or(X) substr() #endif class UserTest : public CPPUNIT_NS :: TestFixture, public BasicTest { @@ -431,7 +431,7 @@ class UserTest : public CPPUNIT_NS :: TestFixture, public BasicTest { CPPUNIT_ASSERT_EQUAL(2, (int) received.size()); Swift::Message *m = dynamic_cast(getStanza(received[0])); - CPPUNIT_ASSERT_EQUAL(std::string("Connection error"), m->getBody().value_or("")); + CPPUNIT_ASSERT_EQUAL(std::string("Connection error"), m->getBody().get_value_or("")); CPPUNIT_ASSERT(dynamic_cast(received[1].get())); CPPUNIT_ASSERT_EQUAL(std::string("Connection error"), dynamic_cast(received[1].get())->getText()); diff --git a/tests/libtransport/usermanager.cpp b/tests/libtransport/usermanager.cpp index 4f2829c2b479eb880929554b4e85108ff8887d15..8dca210f65e030d820a1a46fcbe9b86285eb2369 100644 --- a/tests/libtransport/usermanager.cpp +++ b/tests/libtransport/usermanager.cpp @@ -13,7 +13,7 @@ using namespace Transport; #if !HAVE_SWIFTEN_3 -#define value_or(X) substr() +#define get_value_or(X) substr() #endif class UserManagerTest : public CPPUNIT_NS :: TestFixture, public BasicTest { @@ -81,7 +81,7 @@ class UserManagerTest : public CPPUNIT_NS :: TestFixture, public BasicTest { CPPUNIT_ASSERT_EQUAL(3, (int) received.size()); CPPUNIT_ASSERT(dynamic_cast(getStanza(received[1]))); - CPPUNIT_ASSERT_EQUAL(std::string("Ahoj"), dynamic_cast(getStanza(received[1]))->getBody().value_or("")); + CPPUNIT_ASSERT_EQUAL(std::string("Ahoj"), dynamic_cast(getStanza(received[1]))->getBody().get_value_or("")); CPPUNIT_ASSERT_EQUAL(std::string("user@localhost/resource"), dynamic_cast(getStanza(received[1]))->getTo().toString()); CPPUNIT_ASSERT_EQUAL(std::string("localhost"), dynamic_cast(getStanza(received[1]))->getFrom().toString()); diff --git a/tests/libtransport/userregistration.cpp b/tests/libtransport/userregistration.cpp index af71aee82440f9a429af9b7d237a44b409ceeee7..d62cf6da6a26fcffbc6ff3f5ebe5f6db4b0343b7 100644 --- a/tests/libtransport/userregistration.cpp +++ b/tests/libtransport/userregistration.cpp @@ -13,7 +13,7 @@ using namespace Transport; #if !HAVE_SWIFTEN_3 -#define value_or(X) substr() +#define get_value_or(X) substr() #endif class UserRegistrationTest : public CPPUNIT_NS :: TestFixture, public BasicTest { @@ -204,7 +204,7 @@ class UserRegistrationTest : public CPPUNIT_NS :: TestFixture, public BasicTest CPPUNIT_ASSERT_EQUAL(std::string("localhost"), getStanza(received[0])->getPayload()->getItems()[0].getJID().toString()); CPPUNIT_ASSERT(dynamic_cast(getStanza(received[1]))); - CPPUNIT_ASSERT_EQUAL(std::string("registered: user@localhost"), dynamic_cast(getStanza(received[1]))->getBody().value_or("")); + CPPUNIT_ASSERT_EQUAL(std::string("registered: user@localhost"), dynamic_cast(getStanza(received[1]))->getBody().get_value_or("")); UserInfo user; CPPUNIT_ASSERT_EQUAL(true, storage->getUser("user@localhost", user)); @@ -242,7 +242,7 @@ class UserRegistrationTest : public CPPUNIT_NS :: TestFixture, public BasicTest CPPUNIT_ASSERT(getStanza(received[0])->getPayload()); CPPUNIT_ASSERT(dynamic_cast(getStanza(received[1]))); - CPPUNIT_ASSERT_EQUAL(std::string("unregistered: user@localhost"), dynamic_cast(getStanza(received[1]))->getBody().value_or("")); + CPPUNIT_ASSERT_EQUAL(std::string("unregistered: user@localhost"), dynamic_cast(getStanza(received[1]))->getBody().get_value_or("")); UserInfo user;