From 9a8248c1a2ccbb7276639f7486cb9695b2ffa388 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 26 Oct 2019 15:21:21 +0200 Subject: [PATCH] Rename RS mail tracker id type according to Cyril suggestion --- libretroshare/src/retroshare/rsmsgs.h | 18 +++++++++--------- libretroshare/src/rsserver/p3msgs.cc | 8 ++++---- libretroshare/src/rsserver/p3msgs.h | 4 ++-- libretroshare/src/services/p3msgservice.cc | 10 +++++----- libretroshare/src/services/p3msgservice.h | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libretroshare/src/retroshare/rsmsgs.h b/libretroshare/src/retroshare/rsmsgs.h index e0dd579bd..7a44248d0 100644 --- a/libretroshare/src/retroshare/rsmsgs.h +++ b/libretroshare/src/retroshare/rsmsgs.h @@ -100,11 +100,11 @@ typedef std::string RsMailMessageId; // TODO: rebase on t_RsGenericIdType /** * Used to return a tracker id so the API user can keep track of sent mail - * status + * status, it contains mail id, and recipient id */ -struct RsMailTrackId : RsSerializable +struct RsMailIdRecipientIdPair : RsSerializable { - RsMailTrackId(RsMailMessageId mailId, RsGxsId recipientId): + RsMailIdRecipientIdPair(RsMailMessageId mailId, RsGxsId recipientId): mMailId(mailId), mRecipientId(recipientId) {} RsMailMessageId mMailId; @@ -115,11 +115,11 @@ struct RsMailTrackId : RsSerializable RsGenericSerializer::SerializeJob j, RsGenericSerializer::SerializeContext &ctx ) override; - bool operator<(const RsMailTrackId& other) const; - bool operator==(const RsMailTrackId& other) const; + bool operator<(const RsMailIdRecipientIdPair& other) const; + bool operator==(const RsMailIdRecipientIdPair& other) const; - RsMailTrackId() = default; - ~RsMailTrackId() override = default; + RsMailIdRecipientIdPair() = default; + ~RsMailIdRecipientIdPair() override = default; }; namespace Rs @@ -562,8 +562,8 @@ public: const std::set& cc = std::set(), const std::set& bcc = std::set(), const std::vector& attachments = std::vector(), - std::set& trackingIds = - RS_DEFAULT_STORAGE_PARAM(std::set), + std::set& trackingIds = + RS_DEFAULT_STORAGE_PARAM(std::set), std::string& errorMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0; diff --git a/libretroshare/src/rsserver/p3msgs.cc b/libretroshare/src/rsserver/p3msgs.cc index 7bc6cdc3c..ad74dbdde 100644 --- a/libretroshare/src/rsserver/p3msgs.cc +++ b/libretroshare/src/rsserver/p3msgs.cc @@ -309,7 +309,7 @@ uint32_t p3Msgs::sendMail( const std::set& cc, const std::set& bcc, const std::vector& attachments, - std::set& trackingIds, + std::set& trackingIds, std::string& errorMsg ) { return mMsgSrv->sendMail( @@ -564,7 +564,7 @@ Rs::Msgs::MessageInfo::~MessageInfo() = default; MsgInfoSummary::~MsgInfoSummary() = default; VisibleChatLobbyRecord::~VisibleChatLobbyRecord() = default; -void RsMailTrackId::serial_process( +void RsMailIdRecipientIdPair::serial_process( RsGenericSerializer::SerializeJob j, RsGenericSerializer::SerializeContext& ctx ) { @@ -572,13 +572,13 @@ void RsMailTrackId::serial_process( RS_SERIAL_PROCESS(mRecipientId); } -bool RsMailTrackId::operator<(const RsMailTrackId& o) const +bool RsMailIdRecipientIdPair::operator<(const RsMailIdRecipientIdPair& o) const { return std::tie( mMailId, mRecipientId) < std::tie(o.mMailId, o.mRecipientId); } -bool RsMailTrackId::operator==(const RsMailTrackId& o) const +bool RsMailIdRecipientIdPair::operator==(const RsMailIdRecipientIdPair& o) const { return std::tie( mMailId, mRecipientId) == std::tie(o.mMailId, o.mRecipientId); diff --git a/libretroshare/src/rsserver/p3msgs.h b/libretroshare/src/rsserver/p3msgs.h index 5d315321a..955018d26 100644 --- a/libretroshare/src/rsserver/p3msgs.h +++ b/libretroshare/src/rsserver/p3msgs.h @@ -53,8 +53,8 @@ public: const std::set& cc = std::set(), const std::set& bcc = std::set(), const std::vector& attachments = std::vector(), - std::set& trackingIds = - RS_DEFAULT_STORAGE_PARAM(std::set), + std::set& trackingIds = + RS_DEFAULT_STORAGE_PARAM(std::set), std::string& errorMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) override; diff --git a/libretroshare/src/services/p3msgservice.cc b/libretroshare/src/services/p3msgservice.cc index d1c130e4f..ebf2ce496 100644 --- a/libretroshare/src/services/p3msgservice.cc +++ b/libretroshare/src/services/p3msgservice.cc @@ -1213,7 +1213,7 @@ uint32_t p3MsgService::sendMail( const std::set& cc, const std::set& bcc, const std::vector& attachments, - std::set& trackingIds, + std::set& trackingIds, std::string& errorMsg ) { errorMsg.clear(); @@ -1306,7 +1306,7 @@ uint32_t p3MsgService::sendMail( const RsMailMessageId mailId = std::to_string(msgId); pEvent->mChangedMsgIds.insert(mailId); - trackingIds.insert(RsMailTrackId(mailId, dst)); + trackingIds.insert(RsMailIdRecipientIdPair(mailId, dst)); ++ret; } }; @@ -2187,7 +2187,7 @@ bool p3MsgService::notifyGxsTransSendStatus( RsGxsTransId mailId, GxsTransSendStatus status ) { Dbg2() << __PRETTY_FUNCTION__ << " " << mailId << ", " - << static_cast(status) << std::endl; + << static_cast(status) << std::endl; using Evt_t = RsMailStatusEvent; std::shared_ptr pEvent(new Evt_t()); @@ -2203,7 +2203,7 @@ bool p3MsgService::notifyGxsTransSendStatus( RsGxsTransId mailId, if(it == gxsOngoingMessages.end()) { RsErr() << __PRETTY_FUNCTION__<< " " << mailId << ", " - << static_cast(status) + << static_cast(status) << " cannot find pending message to acknowledge!" << std::endl; return false; @@ -2221,7 +2221,7 @@ bool p3MsgService::notifyGxsTransSendStatus( RsGxsTransId mailId, if(it2 == msgOutgoing.end()) { RsInfo() << __PRETTY_FUNCTION__ << " " << mailId - << ", " << static_cast(status) + << ", " << static_cast(status) << " received receipt for message that is not in " << "outgoing list, probably it has been acknoweldged " << "before by other means." << std::endl; diff --git a/libretroshare/src/services/p3msgservice.h b/libretroshare/src/services/p3msgservice.h index b092ba400..61f5261db 100644 --- a/libretroshare/src/services/p3msgservice.h +++ b/libretroshare/src/services/p3msgservice.h @@ -67,8 +67,8 @@ public: const std::set& cc = std::set(), const std::set& bcc = std::set(), const std::vector& attachments = std::vector(), - std::set& trackingIds = - RS_DEFAULT_STORAGE_PARAM(std::set), + std::set& trackingIds = + RS_DEFAULT_STORAGE_PARAM(std::set), std::string& errorMsg = RS_DEFAULT_STORAGE_PARAM(std::string) );