added flag and icon for message that was successfuly decrypted

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6836 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-10-16 20:02:28 +00:00
parent 292bdfa324
commit cd43900eb9
7 changed files with 31 additions and 15 deletions

View File

@ -48,20 +48,21 @@
#define RS_MSG_OUTBOX 0x03 /* Outbox */ #define RS_MSG_OUTBOX 0x03 /* Outbox */
#define RS_MSG_DRAFTBOX 0x05 /* Draftbox */ #define RS_MSG_DRAFTBOX 0x05 /* Draftbox */
#define RS_MSG_NEW 0x0010 /* New */ #define RS_MSG_NEW 0x000010 /* New */
#define RS_MSG_TRASH 0x0020 /* Trash */ #define RS_MSG_TRASH 0x000020 /* Trash */
#define RS_MSG_UNREAD_BY_USER 0x0040 /* Unread by user */ #define RS_MSG_UNREAD_BY_USER 0x000040 /* Unread by user */
#define RS_MSG_REPLIED 0x0080 /* Message is replied */ #define RS_MSG_REPLIED 0x000080 /* Message is replied */
#define RS_MSG_FORWARDED 0x0100 /* Message is forwarded */ #define RS_MSG_FORWARDED 0x000100 /* Message is forwarded */
#define RS_MSG_STAR 0x0200 /* Message is marked with a star */ #define RS_MSG_STAR 0x000200 /* Message is marked with a star */
// system message // system message
#define RS_MSG_USER_REQUEST 0x0400 /* user request */ #define RS_MSG_USER_REQUEST 0x000400 /* user request */
#define RS_MSG_FRIEND_RECOMMENDATION 0x0800 /* friend recommendation */ #define RS_MSG_FRIEND_RECOMMENDATION 0x000800 /* friend recommendation */
#define RS_MSG_SYSTEM (RS_MSG_USER_REQUEST | RS_MSG_FRIEND_RECOMMENDATION) #define RS_MSG_SYSTEM (RS_MSG_USER_REQUEST | RS_MSG_FRIEND_RECOMMENDATION)
#define RS_MSG_ENCRYPTED 0x1000 /* message is encrypted */ #define RS_MSG_ENCRYPTED 0x001000 /* message is encrypted */
#define RS_MSG_SIGNATURE_CHECKS 0x2000 /* message was signed, and signature checked */ #define RS_MSG_SIGNATURE_CHECKS 0x002000 /* message was signed, and signature checked */
#define RS_MSG_SIGNED 0x4000 /* message was signed and signature didn't check */ #define RS_MSG_SIGNED 0x004000 /* message was signed and signature didn't check */
#define RS_MSG_LOAD_EMBEDDED_IMAGES 0x8000 /* load embedded images */ #define RS_MSG_LOAD_EMBEDDED_IMAGES 0x008000 /* load embedded images */
#define RS_MSG_DECRYPTED 0x010000 /* message was previously encrypted, and is now decrypted */
#define RS_CHAT_LOBBY_EVENT_PEER_LEFT 0x01 #define RS_CHAT_LOBBY_EVENT_PEER_LEFT 0x01
#define RS_CHAT_LOBBY_EVENT_PEER_STATUS 0x02 #define RS_CHAT_LOBBY_EVENT_PEER_STATUS 0x02

View File

@ -433,6 +433,7 @@ const uint32_t RS_MSG_FLAGS_DISTANT = 0x00008000;
const uint32_t RS_MSG_FLAGS_SIGNATURE_CHECKS = 0x00010000; const uint32_t RS_MSG_FLAGS_SIGNATURE_CHECKS = 0x00010000;
const uint32_t RS_MSG_FLAGS_SIGNED = 0x00020000; const uint32_t RS_MSG_FLAGS_SIGNED = 0x00020000;
const uint32_t RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES = 0x00040000; const uint32_t RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES = 0x00040000;
const uint32_t RS_MSG_FLAGS_DECRYPTED = 0x00080000;
class RsMessageItem: public RsItem class RsMessageItem: public RsItem
{ {

View File

@ -1511,6 +1511,9 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi)
if (msg->msgFlags & RS_MSG_FLAGS_ENCRYPTED) if (msg->msgFlags & RS_MSG_FLAGS_ENCRYPTED)
mi.msgflags |= RS_MSG_ENCRYPTED ; mi.msgflags |= RS_MSG_ENCRYPTED ;
if (msg->msgFlags & RS_MSG_FLAGS_DECRYPTED)
mi.msgflags |= RS_MSG_DECRYPTED ;
if (msg->msgFlags & RS_MSG_FLAGS_TRASH) if (msg->msgFlags & RS_MSG_FLAGS_TRASH)
{ {
mi.msgflags |= RS_MSG_TRASH; mi.msgflags |= RS_MSG_TRASH;
@ -1603,6 +1606,9 @@ void p3MsgService::initRsMIS(RsMsgItem *msg, MsgInfoSummary &mis)
if (msg->msgFlags & RS_MSG_FLAGS_ENCRYPTED) if (msg->msgFlags & RS_MSG_FLAGS_ENCRYPTED)
mis.msgflags |= RS_MSG_ENCRYPTED ; mis.msgflags |= RS_MSG_ENCRYPTED ;
if (msg->msgFlags & RS_MSG_FLAGS_DECRYPTED)
mis.msgflags |= RS_MSG_DECRYPTED ;
if (msg->msgFlags & RS_MSG_FLAGS_SIGNED) if (msg->msgFlags & RS_MSG_FLAGS_SIGNED)
mis.msgflags |= RS_MSG_SIGNED ; mis.msgflags |= RS_MSG_SIGNED ;
@ -2007,6 +2013,7 @@ bool p3MsgService::decryptMessage(const std::string& mId)
msgi = *item ; // copy everything msgi = *item ; // copy everything
msgi.msgId = msgId ; // restore the correct message id, to make it consistent msgi.msgId = msgId ; // restore the correct message id, to make it consistent
msgi.msgFlags &= ~RS_MSG_FLAGS_ENCRYPTED ; // just in case. msgi.msgFlags &= ~RS_MSG_FLAGS_ENCRYPTED ; // just in case.
msgi.msgFlags |= RS_MSG_FLAGS_DECRYPTED ; // previousy encrypted msg is now decrypted
msgi.PeerId(senders_id.toStdString()) ; msgi.PeerId(senders_id.toStdString()) ;
for(std::list<std::string>::iterator it(msgi.msgto.ids.begin());it!=msgi.msgto.ids.end();++it) if(*it == own_hash) *it = own_pgp_id ; for(std::list<std::string>::iterator it(msgi.msgto.ids.begin());it!=msgi.msgto.ids.end();++it) if(*it == own_hash) *it = own_pgp_id ;

View File

@ -1222,7 +1222,12 @@ void MessagesDialog::insertMessages()
item[COLUMN_SIGNATURE]->setToolTip(tr("This message is encrypted. Right click to decrypt it.")) ; item[COLUMN_SIGNATURE]->setToolTip(tr("This message is encrypted. Right click to decrypt it.")) ;
item[COLUMN_SUBJECT]->setIcon(QIcon(":/images/mail-encrypted-full.png")) ; item[COLUMN_SUBJECT]->setIcon(QIcon(":/images/mail-encrypted-full.png")) ;
} }
else else if(it->msgflags & RS_MSG_DECRYPTED)
{
item[COLUMN_SIGNATURE]->setIcon(QIcon(":/images/blue_lock_open.png")) ;
item[COLUMN_SIGNATURE]->setToolTip(tr("This message has been successfully decrypted, and is unsigned.")) ;
item[COLUMN_SUBJECT]->setIcon(QIcon(":/images/mail-decrypted-full.png")) ;
if(it->msgflags & RS_MSG_SIGNED) if(it->msgflags & RS_MSG_SIGNED)
if(it->msgflags & RS_MSG_SIGNATURE_CHECKS) if(it->msgflags & RS_MSG_SIGNATURE_CHECKS)
{ {
@ -1234,8 +1239,9 @@ void MessagesDialog::insertMessages()
item[COLUMN_SIGNATURE]->setIcon(QIcon(":/images/stock_signature_bad.png")) ; item[COLUMN_SIGNATURE]->setIcon(QIcon(":/images/stock_signature_bad.png")) ;
item[COLUMN_SIGNATURE]->setToolTip(tr("This message was signed but the signature doesn't check")) ; item[COLUMN_SIGNATURE]->setToolTip(tr("This message was signed but the signature doesn't check")) ;
} }
else }
item[COLUMN_SIGNATURE]->setIcon(QIcon()) ; else
item[COLUMN_SIGNATURE]->setIcon(QIcon()) ;
if (bInsert) { if (bInsert) {
/* add to the list */ /* add to the list */

View File

@ -5,6 +5,7 @@
<file>images/decrypt-mail.png</file> <file>images/decrypt-mail.png</file>
<file>images/inbox_22.png</file> <file>images/inbox_22.png</file>
<file>images/blue_lock.png</file> <file>images/blue_lock.png</file>
<file>images/blue_lock_open.png</file>
<file>images/d-chat64.png</file> <file>images/d-chat64.png</file>
<file>images/edit_24.png</file> <file>images/edit_24.png</file>
<file>images/stock_signature_bad.png</file> <file>images/stock_signature_bad.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB