Roundcube Community Forum

 

Show pictures from known senders

Started by visaju, May 13, 2013, 10:45:08 AM

Previous topic - Next topic

visaju

Hi,

In RC 0.8.1 is the option "Show pictures from known senders" in the settings.
When activated every mail from unknown sender has a link "add to known Senders" which adds a addressbook entry with the email-address as "other".
After that pictures from the sender are shown. So far so good.

Why doesnt it work the other way around. When there is a addressbook entry already. Then there is still the link and no pictures are shown. When it is clicked there comes a message "Addressbook entry with this emailadress allready exists"
I wonder where the information is stored. I haven't found anything in the Database.

Is there a possibility to change this behavior.

Thank you,

Jussi







visaju

This was a issue in inoparability of RC-8.1 and carddav_plugin. (crash-override.net)
We use CardDav-Addressbook only, but RC searches only in the contacts DB-table, but carddav_plugin in carddav_contacts.
Maybe following helps someone:

Index: program/steps/mail/func.inc
===================================================================
--- program/steps/mail/func.inc   (revision 145)
+++ program/steps/mail/func.inc   (working copy)
@@ -586,10 +586,17 @@
   {
     switch($show_images) {
       case '1': // known senders only
-        $CONTACTS = new rcube_contacts($RCMAIL->db, $_SESSION['user_id']);
-        if ($CONTACTS->search('email', $message->sender['mailto'], true, false)->count) {
-          $message->set_safe(true);
-        }
+         $book_types = (array) $RCMAIL->config->get('autocomplete_addressbooks', 'sql');
+         foreach ($book_types as $id) {
+            $abook = $RCMAIL->get_address_book($id);
+            $result = $abook->search(array('email'), $message->sender['mailto'], $mode, true, true, array('email'));
+            if($result->count > 0){
+             //This sets the message as save. Do we want that.
+             //If a contact is deleted this message will stay marked "save"
+               //$message->set_safe(true);
+               return;
+            }
+         }
       break;
       case '2': // always
         $message->set_safe(true);

Regards,

Jussi


visaju

$message->set_safe(true);

needs to be uncommented.

rosali

Regards,
Rosali