diff --git a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp index c376ca9b8..573c65c9d 100644 --- a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp @@ -229,7 +229,7 @@ void ChatMsgItem::sendMessage() mi.title = tr("Quick Message").toUtf8().constData(); mi.msg = quickmsgText->toHtml().toUtf8().constData(); - mi.to.insert(MsgAddress(mPeerId,MsgAddress::MSG_ADDRESS_MODE_TO)); + mi.destinations.insert(MsgAddress(mPeerId,MsgAddress::MSG_ADDRESS_MODE_TO)); rsMail->MessageSend(mi); diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index aede07658..2f707af82 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -1068,49 +1068,49 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/) std::list groupInfoList; rsPeers->getGroupInfoList(groupInfoList); - // std::list groupIds; - // std::list::iterator groupIt; + // std::list groupIds; + // std::list::iterator groupIt; - // calculateGroupsOfSslIds(groupInfoList, msgInfo.msgto, groupIds); - // for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) { - // msgComposer->addRecipient(MessageComposer::TO, *groupIt, true) ; - // } + // calculateGroupsOfSslIds(groupInfoList, msgInfo.msgto, groupIds); + // for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) { + // msgComposer->addRecipient(MessageComposer::TO, *groupIt, true) ; + // } - // calculateGroupsOfSslIds(groupInfoList, msgInfo.msgcc, groupIds); - // for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) { - // msgComposer->addRecipient(MessageComposer::CC, *groupIt, true) ; - // } + // calculateGroupsOfSslIds(groupInfoList, msgInfo.msgcc, groupIds); + // for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) { + // msgComposer->addRecipient(MessageComposer::CC, *groupIt, true) ; + // } - // calculateGroupsOfSslIds(groupInfoList, msgInfo.msgbcc, groupIds); - // for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) { - // msgComposer->addRecipient(MessageComposer::BCC, *groupIt, true) ; - // } + // calculateGroupsOfSslIds(groupInfoList, msgInfo.msgbcc, groupIds); + // for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) { + // msgComposer->addRecipient(MessageComposer::BCC, *groupIt, true) ; + // } - for(auto m:msgInfo.to) - switch(m.mode()) - { - case MsgAddress::MSG_ADDRESS_MODE_TO: - if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) - msgComposer->addRecipient(MessageComposer::TO,m.toGxsId()); - else if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSPEERID) - msgComposer->addRecipient(MessageComposer::TO,m.toRsPeerId()); - break; + for(auto m:msgInfo.destinations) + switch(m.mode()) + { + case MsgAddress::MSG_ADDRESS_MODE_TO: + if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) + msgComposer->addRecipient(MessageComposer::TO,m.toGxsId()); + else if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSPEERID) + msgComposer->addRecipient(MessageComposer::TO,m.toRsPeerId()); + break; - case MsgAddress::MSG_ADDRESS_MODE_CC: - if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) - msgComposer->addRecipient(MessageComposer::CC,m.toGxsId()); - else if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSPEERID) - msgComposer->addRecipient(MessageComposer::CC,m.toRsPeerId()); - break; + case MsgAddress::MSG_ADDRESS_MODE_CC: + if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) + msgComposer->addRecipient(MessageComposer::CC,m.toGxsId()); + else if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSPEERID) + msgComposer->addRecipient(MessageComposer::CC,m.toRsPeerId()); + break; - case MsgAddress::MSG_ADDRESS_MODE_BCC: - if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) - msgComposer->addRecipient(MessageComposer::BCC,m.toGxsId()); - else if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSPEERID) - msgComposer->addRecipient(MessageComposer::BCC,m.toRsPeerId()); - break; - default:break; - } + case MsgAddress::MSG_ADDRESS_MODE_BCC: + if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) + msgComposer->addRecipient(MessageComposer::BCC,m.toGxsId()); + else if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSPEERID) + msgComposer->addRecipient(MessageComposer::BCC,m.toRsPeerId()); + break; + default:break; + } // for (std::set::const_iterator it = msgInfo.rspeerid_msgto.begin(); it != msgInfo.rspeerid_msgto.end(); ++it ) msgComposer->addRecipient(MessageComposer::TO, *it) ; // for (std::set::const_iterator it = msgInfo.rspeerid_msgcc.begin(); it != msgInfo.rspeerid_msgcc.end(); ++it ) msgComposer->addRecipient(MessageComposer::CC, *it) ; @@ -1124,7 +1124,7 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/) msgComposer->m_tagIds = tagInfo.tagIds; msgComposer->showTagLabels(); - std::cerr << "Setting modified 005 = false" << std::endl; + std::cerr << "Setting modified 005 = false" << std::endl; msgComposer->ui.msgText->document()->setModified(false); } @@ -1156,7 +1156,7 @@ QString MessageComposer::buildReplyHeader(const MessageInfo &msgInfo) } QString to,cc; - for(auto m:msgInfo.to) + for(auto m:msgInfo.destinations) { RetroShareLink link; @@ -1262,7 +1262,7 @@ MessageComposer *MessageComposer::replyMsg(const std::string &msgId, bool all) // make sure the current ID is among the ones the msg was actually sent to. #warning: We do not know here what is the atual destination of the message, since it may have been sent to two of our IDs at once. - for(auto m:msgInfo.to) + for(auto m:msgInfo.destinations) if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID && rsIdentity->isOwnId(m.toGxsId())) { msgComposer->ui.respond_to_CB->setDefaultId(m.toGxsId()) ; @@ -1276,7 +1276,7 @@ MessageComposer *MessageComposer::replyMsg(const std::string &msgId, bool all) { RsPeerId ownId = rsPeers->getOwnId(); - for(auto m:msgInfo.to) + for(auto m:msgInfo.destinations) if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) msgComposer->addRecipient(MessageComposer::TO,m.toGxsId()); else if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSPEERID) @@ -1476,9 +1476,9 @@ bool MessageComposer::buildMessage(MessageInfo& mi) switch (type) { - case TO: mi.to.insert(MsgAddress(*sslIt,MsgAddress::MSG_ADDRESS_MODE_TO)); break; - case CC: mi.to.insert(MsgAddress(*sslIt,MsgAddress::MSG_ADDRESS_MODE_CC)); break; - case BCC: mi.to.insert(MsgAddress(*sslIt,MsgAddress::MSG_ADDRESS_MODE_BCC)); break; + case TO: mi.destinations.insert(MsgAddress(*sslIt,MsgAddress::MSG_ADDRESS_MODE_TO)); break; + case CC: mi.destinations.insert(MsgAddress(*sslIt,MsgAddress::MSG_ADDRESS_MODE_CC)); break; + case BCC: mi.destinations.insert(MsgAddress(*sslIt,MsgAddress::MSG_ADDRESS_MODE_BCC)); break; } } } @@ -1490,9 +1490,9 @@ bool MessageComposer::buildMessage(MessageInfo& mi) switch (type) { - case TO: mi.to.insert(MsgAddress(pid,MsgAddress::MSG_ADDRESS_MODE_TO)); break; - case CC: mi.to.insert(MsgAddress(pid,MsgAddress::MSG_ADDRESS_MODE_CC)); break; - case BCC: mi.to.insert(MsgAddress(pid,MsgAddress::MSG_ADDRESS_MODE_BCC)); break; + case TO: mi.destinations.insert(MsgAddress(pid,MsgAddress::MSG_ADDRESS_MODE_TO)); break; + case CC: mi.destinations.insert(MsgAddress(pid,MsgAddress::MSG_ADDRESS_MODE_CC)); break; + case BCC: mi.destinations.insert(MsgAddress(pid,MsgAddress::MSG_ADDRESS_MODE_BCC)); break; } } break ; @@ -1502,9 +1502,9 @@ bool MessageComposer::buildMessage(MessageInfo& mi) switch (type) { - case TO: mi.to.insert(MsgAddress(gid,MsgAddress::MSG_ADDRESS_MODE_TO)); break; - case CC: mi.to.insert(MsgAddress(gid,MsgAddress::MSG_ADDRESS_MODE_CC)); break; - case BCC: mi.to.insert(MsgAddress(gid,MsgAddress::MSG_ADDRESS_MODE_BCC)); break; + case TO: mi.destinations.insert(MsgAddress(gid,MsgAddress::MSG_ADDRESS_MODE_TO)); break; + case CC: mi.destinations.insert(MsgAddress(gid,MsgAddress::MSG_ADDRESS_MODE_CC)); break; + case BCC: mi.destinations.insert(MsgAddress(gid,MsgAddress::MSG_ADDRESS_MODE_BCC)); break; } } break ; @@ -1558,14 +1558,14 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox) else { /* check for the recipient */ - if (mi.to.empty()) + if (mi.destinations.empty()) { QMessageBox::warning(this, tr("RetroShare"), tr("Please insert at least one recipient."), QMessageBox::Ok); return false; // Don't send with no recipient } bool at_least_one_gxsid = false; - for(auto m:mi.to) + for(auto m:mi.destinations) if(m.type() == MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) { at_least_one_gxsid=true; diff --git a/retroshare-gui/src/gui/msgs/MessageModel.cpp b/retroshare-gui/src/gui/msgs/MessageModel.cpp index 143765fd1..d03ab1fec 100644 --- a/retroshare-gui/src/gui/msgs/MessageModel.cpp +++ b/retroshare-gui/src/gui/msgs/MessageModel.cpp @@ -405,7 +405,7 @@ QVariant RsMessageModel::toolTipRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co if(column == COLUMN_THREAD_AUTHOR && !GxsIdDetails::MakeIdDesc(RsGxsId(fmpe.from.toStdString()), true, str, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR)) return QVariant(); - if(column == COLUMN_THREAD_TO && !GxsIdDetails::MakeIdDesc(RsGxsId(fmpe.to.begin()->toStdString()), true, str, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR)) + if(column == COLUMN_THREAD_TO && !GxsIdDetails::MakeIdDesc(RsGxsId(fmpe.to.toStdString()), true, str, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR)) return QVariant(); int S = QFontMetricsF(QApplication::font()).height(); @@ -463,7 +463,7 @@ QVariant RsMessageModel::sortRole(const Rs::Msgs::MsgInfoSummary& fmpe,int colum case COLUMN_THREAD_TO: { QString name; - if(GxsIdTreeItemDelegate::computeName(RsGxsId(fmpe.to.begin()->toStdString()),name)) + if(GxsIdTreeItemDelegate::computeName(RsGxsId(fmpe.to.toStdString()),name)) return name; return ""; //Not Found } @@ -524,7 +524,7 @@ QVariant RsMessageModel::displayRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co } case COLUMN_THREAD_TO: { QString name; - RsGxsId id = RsGxsId(fmpe.to.begin()->toStdString()); // not sure of the type + RsGxsId id = RsGxsId(fmpe.to.toStdString()); // not sure of the type if(id.isNull()) return QVariant(tr("[Notification]")); @@ -600,7 +600,7 @@ QVariant RsMessageModel::decorationRole(const Rs::Msgs::MsgInfoSummary& fmpe,int return FilesDefs::getIconFromQtResourcePath((fmpe.msgflags & RS_MSG_SPAM) ? (IMAGE_SPAM_ON ): (IMAGE_SPAM_OFF)); case COLUMN_THREAD_TO://Return icon as place holder. - return FilesDefs::getIconFromGxsIdCache(RsGxsId(fmpe.to.begin()->toStdString()),QIcon(), exist); + return FilesDefs::getIconFromGxsIdCache(RsGxsId(fmpe.to.toStdString()),QIcon(), exist); case COLUMN_THREAD_AUTHOR://Return icon as place holder. return FilesDefs::getIconFromGxsIdCache(RsGxsId(fmpe.from.toStdString()),QIcon(), exist); } diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index b4a205656..1335ceb50 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -614,7 +614,7 @@ void MessageWidget::fill(const std::string &msgId) RetroShareLink link; QString to_text,cc_text,bcc_text; - for(auto m:msgInfo.to) + for(auto m:msgInfo.destinations) { if(m.type()==MsgAddress::MSG_ADDRESS_TYPE_RSGXSID) link = RetroShareLink::createMessage(m.toGxsId(), "");