Merge pull request #2191 from defnax/share-on-channel

Fixed to use for share on channel as file attachment
This commit is contained in:
csoler 2021-01-03 15:48:42 +01:00 committed by GitHub
commit 346b0dcfc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,9 +127,14 @@ void GxsChannelDialog::shareOnChannel(const RsGxsGroupId& channel_id,const QList
CreateGxsChannelMsg *msgDialog = new CreateGxsChannelMsg(channel_id) ; CreateGxsChannelMsg *msgDialog = new CreateGxsChannelMsg(channel_id) ;
QString txt ;
for(QList<RetroShareLink>::const_iterator it(file_links.begin());it!=file_links.end();++it) for(QList<RetroShareLink>::const_iterator it(file_links.begin());it!=file_links.end();++it)
txt += (*it).toHtml() + "\n" ; if((*it).type() == RetroShareLink::TYPE_FILE)
{
FileInfo info ;
RsFileHash hash( (*it).hash().toStdString()) ;
msgDialog->addAttachment(hash, (*it).name().toUtf8().constData(), (*it).size(), rsFiles->alreadyHaveFile( hash,info ), RsPeerId()) ;
}
if(!file_links.empty()) if(!file_links.empty())
{ {
@ -137,7 +142,6 @@ void GxsChannelDialog::shareOnChannel(const RsGxsGroupId& channel_id,const QList
msgDialog->addSubject(subject); msgDialog->addSubject(subject);
} }
msgDialog->addHtmlText(txt);
msgDialog->show(); msgDialog->show();
} }