Fix frequently ocurring typos :)
[claws.git] / src / privacy.c
index 4d5fda319f2d1c2b02b7ea03e97d407a5f1f6fa3..01b282a6b3196c797a1b91f6a290b7bce2ef19cf 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "privacy.h"
 #include "procmime.h"
+#include "procmsg.h"
 
 static GSList *systems = NULL;
 static gchar *privacy_last_error = NULL;
@@ -190,7 +191,7 @@ void privacy_msginfo_get_signed_state(MsgInfo *msginfo, gchar **system)
  * If the MimeInfo is not signed an error code will be returned.
  *
  * \return Error code indicating the result of the check,
- *         < 0 if an error occured
+ *         < 0 if an error occurred
  */
 gint privacy_mimeinfo_check_signature(MimeInfo *mimeinfo)
 {
@@ -306,7 +307,7 @@ static gint decrypt(MimeInfo *mimeinfo, PrivacySystem *system)
        parentinfo = procmime_mimeinfo_parent(mimeinfo);
        childnumber = g_node_child_index(parentinfo->node, mimeinfo);
        
-       procmime_mimeinfo_free_all(mimeinfo);
+       procmime_mimeinfo_free_all(&mimeinfo);
 
        g_node_insert(parentinfo->node, childnumber, decryptedinfo->node);
 
@@ -500,3 +501,24 @@ gboolean privacy_encrypt(const gchar *id, MimeInfo *mimeinfo, const gchar *encda
 
        return system->encrypt(mimeinfo, encdata);
 }
+
+gboolean privacy_auto_check_signatures(MimeInfo *mimeinfo)
+{
+       PrivacySystem *system;
+
+       cm_return_val_if_fail(mimeinfo != NULL, FALSE);
+
+       if (mimeinfo->privacy == NULL)
+               privacy_mimeinfo_is_signed(mimeinfo);
+
+       if (mimeinfo->privacy == NULL)
+               return FALSE;
+
+       system = privacy_data_get_system(mimeinfo->privacy);
+       if (system == NULL)
+               return FALSE;
+       if (system->auto_check_signatures == NULL)
+               return FALSE;
+
+       return system->auto_check_signatures();
+}