Bug 54743 - enable/disable encryption per message
Summary: enable/disable encryption per message
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: Cryptography Plugin (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-16 22:58 UTC by Maik Schulz
Modified: 2004-03-11 22:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maik Schulz 2003-02-16 22:58:08 UTC
Version:           0.6 (it claims 0.5.8cvs) (using KDE KDE 3.1)
Installed from:    SuSE RPMs
Compiler:          gcc 3.2 
OS:          Linux

Hi,

I'd like to be able to decide on a per message basis whether I want encryption or not. It would be nice to have a toolbar button and a shortcut instead of having to remove/add the public key from/to a contact everytime.

Thanks,
-Maik
Comment 1 Olivier Goffart 2003-03-03 20:54:10 UTC
how to do that?  
since KMM are deleted on every chat closes: 
i can eventualy add a flag for each contacts 
Comment 2 Maik Schulz 2003-03-05 13:58:22 UTC
I could imagine another keyboard shortcut: Send Message Encrypted and a corresponding toolbar 
button (e.g. a key) which is either pressed (encryption on) or raised (encryption on). 
 
Is that reasonable? 
 
Thanks, 
-Maik 
Comment 3 Stefan Freyr Stefansson 2003-10-27 11:57:44 UTC
I'd like to see this as well.  I'm coming from using PSI which has this functionality... next to the "send" button there is a little "toggle" button which shows a lock that is either open or closed depending on whether or not encryption is being applied.
Comment 4 Olivier Goffart 2003-10-28 20:38:55 UTC
Could be done...   But not for KDE 3.2  (i18n frezee)
Comment 5 Olivier Goffart 2004-03-11 22:22:20 UTC
CVS commit by ogoffart: 

Add the availibity to toggle encryption on/off

CCMAIL: 54743-done@bugs.kde.org


  A            cryptographychatui.rc   1.1
  A            cryptographyguiclient.cpp   1.1 [GPL (v2+)]
  A            cryptographyguiclient.h   1.1 [GPL (v2+)]
  M +4 -1      Makefile.am   1.16
  M +25 -2     cryptographyplugin.cpp   1.44
  M +3 -1      cryptographyplugin.h   1.14


--- kdenetwork/kopete/plugins/cryptography/Makefile.am  #1.15:1.16
@@ -5,5 +5,5 @@
 kde_module_LTLIBRARIES = kopete_cryptography.la kcm_kopete_cryptography.la
 
-kopete_cryptography_la_SOURCES     = cryptographyplugin.cpp kgpginterface.cpp cryptographyselectuserkey.cpp cryptographyuserkey_ui.ui popuppublic.cpp kgpgselkey.cpp
+kopete_cryptography_la_SOURCES     = cryptographyplugin.cpp kgpginterface.cpp cryptographyguiclient.cpp cryptographyselectuserkey.cpp cryptographyuserkey_ui.ui popuppublic.cpp kgpgselkey.cpp
 kopete_cryptography_la_LDFLAGS     = -module -no-undefined $(KDE_PLUGIN)
 kopete_cryptography_la_LIBADD      = ../../libkopete/libkopete.la
@@ -22,2 +22,5 @@
 mydata_DATA = cryptographyui.rc
 
+mydata2dir = $(kde_datadir)/kopete
+mydata2_DATA = cryptographychatui.rc
+

--- kdenetwork/kopete/plugins/cryptography/cryptographyplugin.cpp  #1.43:1.44
@@ -3,5 +3,5 @@
                              -------------------
     begin                : jeu nov 14 2002
-    copyright            : (C) 2002 by Olivier Goffart
+    copyright            : (C) 2002-2004 by Olivier Goffart
     email                : ogoffart@tiscalinet.be
  ***************************************************************************/
@@ -32,4 +32,5 @@
 #include "cryptographyplugin.h"
 #include "cryptographyselectuserkey.h"
+#include "cryptographyguiclient.h"
 
 #include "kgpginterface.h"
@@ -65,4 +66,14 @@ CryptographyPlugin::CryptographyPlugin( 
         loadSettings();
         connect(this, SIGNAL(settingsChanged()), this, SLOT( loadSettings() ) );
+        
+        connect( KopeteMessageManagerFactory::factory(), SIGNAL( messageManagerCreated( KopeteMessageManager * )) , SLOT( slotNewKMM( KopeteMessageManager * ) ) );
+        //Add GUI action to all already existing kmm (if the plugin is launched when kopete already rining)
+        QIntDict<KopeteMessageManager> sessions = KopeteMessageManagerFactory::factory()->sessions();
+        QIntDictIterator<KopeteMessageManager> it( sessions );
+        for ( ; it.current() ; ++it )
+        {
+                slotNewKMM(it.current());
+        }
+
 }
 
@@ -214,8 +225,12 @@ void CryptographyPlugin::slotOutgoingMes
                 QString tmpKey;
                 if( c->metaContact() )
+                {
+                        if(c->metaContact()->pluginData( this, "encrypt_messages"  ) == "off" )
+                                return;
                         tmpKey = c->metaContact()->pluginData( this, "gpgKey" );
+                }
                 if( tmpKey.isEmpty() )
                 {
-                        kdDebug( 14303 ) << "CryptographyPlugin::slotOutgoingMessage: no key selected for one contact" <<endl;
+                //      kdDebug( 14303 ) << "CryptographyPlugin::slotOutgoingMessage: no key selected for one contact" <<endl;
                         return;
                 }
@@ -286,4 +301,12 @@ void CryptographyPlugin::slotForgetCache
 }
 
+void CryptographyPlugin::slotNewKMM(KopeteMessageManager *KMM) 
+{
+        connect(this , SIGNAL( destroyed(QObject*)) ,
+                        new CryptographyGUIClient(KMM) , SLOT(deleteLater()));
+}
+
+
+
 #include "cryptographyplugin.moc"
 

--- kdenetwork/kopete/plugins/cryptography/cryptographyplugin.h  #1.13:1.14
@@ -3,5 +3,5 @@
                              -------------------
     begin                : jeu nov 14 2002
-    copyright            : (C) 2002 by Olivier Goffart
+    copyright            : (C) 2002-2004 by Olivier Goffart
     email                : ogoffart@tiscalinet.be
  ***************************************************************************/
@@ -66,4 +66,6 @@ private slots:
         void loadSettings();
 
+        void slotNewKMM(KopeteMessageManager *);
+
 private:
         static CryptographyPlugin* pluginStatic_;