From cd43900eb91fe5d315837462a08feb941f23fb59 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 16 Oct 2013 20:02:28 +0000 Subject: [PATCH] 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 --- libretroshare/src/retroshare/rsmsgs.h | 25 +++++++++--------- libretroshare/src/serialiser/rsmsgitems.h | 1 + libretroshare/src/services/p3msgservice.cc | 7 +++++ retroshare-gui/src/gui/MessagesDialog.cpp | 12 ++++++--- retroshare-gui/src/gui/images.qrc | 1 + retroshare-gui/src/gui/images/blue_lock.png | Bin 1713 -> 2301 bytes .../src/gui/images/blue_lock_open.png | Bin 0 -> 2362 bytes 7 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 retroshare-gui/src/gui/images/blue_lock_open.png diff --git a/libretroshare/src/retroshare/rsmsgs.h b/libretroshare/src/retroshare/rsmsgs.h index fdaa88525..2567ee5d9 100644 --- a/libretroshare/src/retroshare/rsmsgs.h +++ b/libretroshare/src/retroshare/rsmsgs.h @@ -48,20 +48,21 @@ #define RS_MSG_OUTBOX 0x03 /* Outbox */ #define RS_MSG_DRAFTBOX 0x05 /* Draftbox */ -#define RS_MSG_NEW 0x0010 /* New */ -#define RS_MSG_TRASH 0x0020 /* Trash */ -#define RS_MSG_UNREAD_BY_USER 0x0040 /* Unread by user */ -#define RS_MSG_REPLIED 0x0080 /* Message is replied */ -#define RS_MSG_FORWARDED 0x0100 /* Message is forwarded */ -#define RS_MSG_STAR 0x0200 /* Message is marked with a star */ +#define RS_MSG_NEW 0x000010 /* New */ +#define RS_MSG_TRASH 0x000020 /* Trash */ +#define RS_MSG_UNREAD_BY_USER 0x000040 /* Unread by user */ +#define RS_MSG_REPLIED 0x000080 /* Message is replied */ +#define RS_MSG_FORWARDED 0x000100 /* Message is forwarded */ +#define RS_MSG_STAR 0x000200 /* Message is marked with a star */ // system message -#define RS_MSG_USER_REQUEST 0x0400 /* user request */ -#define RS_MSG_FRIEND_RECOMMENDATION 0x0800 /* friend recommendation */ +#define RS_MSG_USER_REQUEST 0x000400 /* user request */ +#define RS_MSG_FRIEND_RECOMMENDATION 0x000800 /* 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_SIGNATURE_CHECKS 0x2000 /* message was signed, and signature checked */ -#define RS_MSG_SIGNED 0x4000 /* message was signed and signature didn't check */ -#define RS_MSG_LOAD_EMBEDDED_IMAGES 0x8000 /* load embedded images */ +#define RS_MSG_ENCRYPTED 0x001000 /* message is encrypted */ +#define RS_MSG_SIGNATURE_CHECKS 0x002000 /* message was signed, and signature checked */ +#define RS_MSG_SIGNED 0x004000 /* message was signed and signature didn't check */ +#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_STATUS 0x02 diff --git a/libretroshare/src/serialiser/rsmsgitems.h b/libretroshare/src/serialiser/rsmsgitems.h index 70924c7f5..7ddece845 100644 --- a/libretroshare/src/serialiser/rsmsgitems.h +++ b/libretroshare/src/serialiser/rsmsgitems.h @@ -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_SIGNED = 0x00020000; const uint32_t RS_MSG_FLAGS_LOAD_EMBEDDED_IMAGES = 0x00040000; +const uint32_t RS_MSG_FLAGS_DECRYPTED = 0x00080000; class RsMessageItem: public RsItem { diff --git a/libretroshare/src/services/p3msgservice.cc b/libretroshare/src/services/p3msgservice.cc index 4dfa6ad08..f28dd4bd1 100644 --- a/libretroshare/src/services/p3msgservice.cc +++ b/libretroshare/src/services/p3msgservice.cc @@ -1511,6 +1511,9 @@ void p3MsgService::initRsMI(RsMsgItem *msg, MessageInfo &mi) if (msg->msgFlags & RS_MSG_FLAGS_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) { mi.msgflags |= RS_MSG_TRASH; @@ -1603,6 +1606,9 @@ void p3MsgService::initRsMIS(RsMsgItem *msg, MsgInfoSummary &mis) if (msg->msgFlags & RS_MSG_FLAGS_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) mis.msgflags |= RS_MSG_SIGNED ; @@ -2007,6 +2013,7 @@ bool p3MsgService::decryptMessage(const std::string& mId) msgi = *item ; // copy everything 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_DECRYPTED ; // previousy encrypted msg is now decrypted msgi.PeerId(senders_id.toStdString()) ; for(std::list::iterator it(msgi.msgto.ids.begin());it!=msgi.msgto.ids.end();++it) if(*it == own_hash) *it = own_pgp_id ; diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 7d6cd68b9..7c9ce35a8 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -1222,7 +1222,12 @@ void MessagesDialog::insertMessages() item[COLUMN_SIGNATURE]->setToolTip(tr("This message is encrypted. Right click to decrypt it.")) ; 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_SIGNATURE_CHECKS) { @@ -1234,8 +1239,9 @@ void MessagesDialog::insertMessages() 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")) ; } - else - item[COLUMN_SIGNATURE]->setIcon(QIcon()) ; + } + else + item[COLUMN_SIGNATURE]->setIcon(QIcon()) ; if (bInsert) { /* add to the list */ diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 96a2ed415..d593a7bd1 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -5,6 +5,7 @@ images/decrypt-mail.png images/inbox_22.png images/blue_lock.png + images/blue_lock_open.png images/d-chat64.png images/edit_24.png images/stock_signature_bad.png diff --git a/retroshare-gui/src/gui/images/blue_lock.png b/retroshare-gui/src/gui/images/blue_lock.png index 00b98d715b297bc763fe248df6e5c647cbbfc02c..1f29dc0013a128c8712697894854e06f3685c630 100644 GIT binary patch literal 2301 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*z~ z6Dc$UPn;M400@0aL_t(o!>yNVh+S6|$A4>|b06p4JI`b~nUp5l(!@@QH3_v9sZAlq z2cc$)-?X$+3O>NEez1s86$(lf5k*jtfLKSdg;Y&jVLlY14fd6n+SWX7ZC;(3%zfW; z_uk77``nqE$uxGXi&GWRnQuy>>zV;=TW4x7&Sca&mHh=gytI z{~3Jf(4nN=Zhzhw^U&z<@Q(4(b-Bt=B^n+b7DQ+_TQnODx3IYA<`?HXY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jnFUT)TV3AhiKR<<>%Z0kn!dGu-YIiz>q%sl+-jBfF< zy>MOY#5f{~rLS*DNEA!Efv*5Cmgn}*ev(??a^|fi9{urS&1xa~Ji1-k)>F#1-fR{q z+bS#D`YUiZ+W%YtUO1;6+%(`*CCG?olZQ8(q0f;l)sBysF!Nc;ja7bi{I}F=tIax( zDBF5e*;drvS&Eocw)G3(s5U5gdRCuLJ16w=Y1}G`r4MaH=srDFg3&!wl$|=WbMw4- z>V;2&!|`i)J%4_ewn zML&1nkS^cfl~58ibX zgn->GZM*8 zuor;o9gsD3uyq5_!TQf>LjB!?t}$ANl3^HR^EpIYg(ll(W~r1~Co*{s1*ux;ZHv%D z58luBzW607zDvb-S@s+%o=e4dw4T^2p3AboR#tZEcyZ56WNY}_i*R1MM$4%c{f{z| z5UJIN(NFs)XqmKg&PLc+y+ zQX&llvL+&zM~#l)2X&ojsbn-tXT`0x3J6vD8i<$0GTcl-YWRu@C={~2X?00000NkvXX Hu0mjf{DmiT diff --git a/retroshare-gui/src/gui/images/blue_lock_open.png b/retroshare-gui/src/gui/images/blue_lock_open.png new file mode 100644 index 0000000000000000000000000000000000000000..02434339a817d99a7f7cfe361d17dff6630aac32 GIT binary patch literal 2362 zcmV-A3B~q_P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*z~ z6Dd06_pu)U00_ECL_t(o!@ZbWh+StD$A4?@eeUPXWM+~~Mo}6HkxUYs7OI9Q&Wp8T zC`q9dk>CX?iuk19OOZfZ!50<9%ZoxUh;=Gbm@2K6<{|VJl9)=Twy`!dr)Cn8%$Yg2 zeJg*ql9kfBfdZ*7slQJ7Q+stdEGu3opD7#&H~a@590UIF4=C zu3i51*I)Pd-FKgV&-ZT@+=&w>G8Zmf7|Z2y_Xk06H`vF6KyqdnYV!s!Bl2{=-+w-v z&331zrriGp?!<``#igai?_{&NZ;y?Ph+VV z`e>n0cw*naeeq3&d+xdCN+R;e*yz~TcJJ9;X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