fixed display of toaster for distant msgs

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6659 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-08-31 13:12:26 +00:00
parent 8d94ecf9ff
commit 19808587e9
3 changed files with 17 additions and 1 deletions

View File

@ -49,6 +49,7 @@ const uint32_t RS_POPUP_DOWNLOAD = 0x0020;
const uint32_t RS_POPUP_GROUPCHAT = 0x0040;
const uint32_t RS_POPUP_CHATLOBBY = 0x0080;
const uint32_t RS_POPUP_CONNECT_ATTEMPT = 0x0100;
const uint32_t RS_POPUP_ENCRYPTED_MSG = 0x0200;
/* CHAT flags are here - so they are in the same place as
* other Notify flags... not used by libretroshare though

View File

@ -140,7 +140,11 @@ void p3MsgService::processMsg(RsMsgItem *mi, bool incoming)
std::string title, message;
librs::util::ConvertUtf16ToUtf8(mi->subject, title);
librs::util::ConvertUtf16ToUtf8(mi->message, message);
notify->AddPopupMessage(RS_POPUP_MSG, mi->PeerId(), title, message);
if(mi->msgFlags & RS_MSG_FLAGS_ENCRYPTED)
notify->AddPopupMessage(RS_POPUP_ENCRYPTED_MSG, mi->PeerId(), title, message);
else
notify->AddPopupMessage(RS_POPUP_MSG, mi->PeerId(), title, message);
std::string out;
rs_sprintf(out, "%lu", mi->msgId);

View File

@ -775,6 +775,14 @@ void NotifyQt::UpdateGUI()
switch(type)
{
case RS_POPUP_ENCRYPTED_MSG:
soundManager->play(SOUND_MESSAGE_ARRIVED);
if (popupflags & RS_POPUP_MSG)
{
toaster = new Toaster(new MessageToaster(std::string(), QObject::tr("Unknown title"), QObject::tr("[Encrypted message]")));
}
break;
case RS_POPUP_MSG:
soundManager->play(SOUND_MESSAGE_ARRIVED);
@ -925,6 +933,9 @@ void NotifyQt::testToaster(uint notifyFlags, /*RshareSettings::enumToasterPositi
switch(type)
{
case RS_POPUP_ENCRYPTED_MSG:
toaster = new Toaster(new MessageToaster(std::string(), tr("Unknown title"), tr("[Encrypted message]")));
break;
case RS_POPUP_MSG:
toaster = new Toaster(new MessageToaster(id, title, message));
break;