Skip to content

Commit

Permalink
Avoid using namespace bts::mail in client, which was causing types li…
Browse files Browse the repository at this point in the history
…ke digest_type to be ambiguous with bts::blockchain::digest_type
  • Loading branch information
emfrias committed Nov 11, 2014
1 parent cf6c3d5 commit 76e2525
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion libraries/client/include/bts/client/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ namespace bts { namespace client {

using namespace bts::blockchain;
using namespace bts::wallet;
using namespace bts::mail;
using bts::mail::mail_client_ptr;
using bts::mail::mail_server_ptr;

boost::program_options::variables_map parse_option_variables(int argc, char** argv);
fc::path get_data_dir(const boost::program_options::variables_map& option_variables);
Expand Down
13 changes: 7 additions & 6 deletions libraries/client/mail_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,25 @@ vector<mail::email_header> detail::client_impl::mail_inbox() const
return _mail_client->get_inbox();
}

void detail::client_impl::mail_retry_send(const message_id_type& message_id)
void detail::client_impl::mail_retry_send(const bts::mail::message_id_type& message_id)
{
FC_ASSERT(_mail_client);
_mail_client->retry_message(message_id);
}

void detail::client_impl::mail_cancel_message(const message_id_type &message_id)
void detail::client_impl::mail_cancel_message(const bts::mail::message_id_type &message_id)
{
FC_ASSERT(_mail_client);
_mail_client->cancel_message(message_id);
}

void detail::client_impl::mail_remove_message(const message_id_type &message_id)
void detail::client_impl::mail_remove_message(const bts::mail::message_id_type &message_id)
{
FC_ASSERT(_mail_client);
_mail_client->remove_message(message_id);
}

void detail::client_impl::mail_archive_message(const message_id_type &message_id)
void detail::client_impl::mail_archive_message(const bts::mail::message_id_type &message_id)
{
FC_ASSERT(_mail_client);
_mail_client->archive_message(message_id);
Expand Down Expand Up @@ -97,15 +97,16 @@ vector<mail::email_header> detail::client_impl::mail_get_messages_in_conversatio
auto backward = _mail_client->get_messages_from_to(account_two, account_one);

std::move(backward.begin(), backward.end(), std::back_inserter(forward));
std::sort(forward.begin(), forward.end(), [](const email_header& a, const email_header& b) {return a.timestamp < b.timestamp;});
std::sort(forward.begin(), forward.end(),
[](const bts::mail::email_header& a, const bts::mail::email_header& b) { return a.timestamp < b.timestamp;});
return forward;
}

mail::message_id_type detail::client_impl::mail_send(const std::string& from,
const std::string& to,
const std::string& subject,
const std::string& body,
const message_id_type& reply_to)
const bts::mail::message_id_type& reply_to)
{
FC_ASSERT(_mail_client);
return _mail_client->send_email(from, to, subject, body, reply_to);
Expand Down
12 changes: 6 additions & 6 deletions libraries/client/wallet_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,23 +461,23 @@ string detail::client_impl::wallet_dump_private_key( const std::string& input )
return "key not found";
}

message detail::client_impl::wallet_mail_create(const std::string& sender,
const std::string& subject,
const std::string& body,
const message_id_type& reply_to)
bts::mail::message detail::client_impl::wallet_mail_create(const std::string& sender,
const std::string& subject,
const std::string& body,
const bts::mail::message_id_type& reply_to)
{
return _wallet->mail_create(sender, subject, body, reply_to);
}

message detail::client_impl::wallet_mail_encrypt(const std::string &recipient, const message &plaintext)
bts::mail::message detail::client_impl::wallet_mail_encrypt(const std::string &recipient, const bts::mail::message &plaintext)
{
auto recipient_account = _chain_db->get_account_record(recipient);
FC_ASSERT(recipient_account, "Unknown recipient name.");

return _wallet->mail_encrypt(recipient_account->active_key(), plaintext);
}

mail::message detail::client_impl::wallet_mail_open(const address& recipient, const message& ciphertext)
bts::mail::message detail::client_impl::wallet_mail_open(const address& recipient, const bts::mail::message& ciphertext)
{
return _wallet->mail_open(recipient, ciphertext);
}
Expand Down

0 comments on commit 76e2525

Please sign in to comment.