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:
chrisparker126 2010-07-17 20:17:14 +00:00
parent 4157aff291
commit 1f873e023e
6 changed files with 78 additions and 1 deletions

View file

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

View file

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