saving current work on big pass over Mail

This commit is contained in:
csoler 2022-11-21 14:18:25 +01:00
parent ba4982f2ca
commit 3ac97b24a8
4 changed files with 58 additions and 58 deletions

View File

@ -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);

View File

@ -1086,7 +1086,7 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
// msgComposer->addRecipient(MessageComposer::BCC, *groupIt, true) ;
// }
for(auto m:msgInfo.to)
for(auto m:msgInfo.destinations)
switch(m.mode())
{
case MsgAddress::MSG_ADDRESS_MODE_TO:
@ -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;

View File

@ -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);
}

View File

@ -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(), "");