mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 21:40:36 -04:00
added channel msg thumbnail, you'll lose all your current channel msgs before this rev
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3297 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4157aff291
commit
1f873e023e
6 changed files with 78 additions and 1 deletions
|
@ -454,6 +454,11 @@ void CreateChannelMsg::sendMessage(std::wstring subject, std::wstring msg, std::
|
|||
}
|
||||
else
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* rsChannels */
|
||||
if (rsChannels)
|
||||
{
|
||||
|
@ -465,6 +470,18 @@ void CreateChannelMsg::sendMessage(std::wstring subject, std::wstring msg, std::
|
|||
msgInfo.subject = subject;
|
||||
msgInfo.msg = msg;
|
||||
msgInfo.files = files;
|
||||
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
|
||||
if(!picture.isNull()){
|
||||
// send chan image
|
||||
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
picture.save(&buffer, "PNG"); // writes image into ba in PNG format
|
||||
msgInfo.thumbnail.image_thumbnail = (unsigned char*) ba.data();
|
||||
msgInfo.thumbnail.im_thumbnail_size = ba.size();
|
||||
}
|
||||
|
||||
rsChannels->ChannelMessageSend(msgInfo);
|
||||
}
|
||||
|
|
|
@ -121,6 +121,14 @@ void ChanMsgItem::updateItemStatic()
|
|||
layout->addWidget(fi);
|
||||
}
|
||||
|
||||
if(cmi.thumbnail.image_thumbnail != NULL)
|
||||
{
|
||||
QPixmap thumbnail;
|
||||
thumbnail.loadFromData(cmi.thumbnail.image_thumbnail, cmi.thumbnail.im_thumbnail_size,
|
||||
"PNG");
|
||||
|
||||
label->setPixmap(thumbnail);
|
||||
}
|
||||
|
||||
if (mIsHome)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue