Author Topic: Show pictures from known senders  (Read 4425 times)

Offline visaju

  • Newbie
  • *
  • Posts: 5
Show pictures from known senders
« on: May 13, 2013, 10:45:08 AM »
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







Offline visaju

  • Newbie
  • *
  • Posts: 5
Re: Show pictures from known senders
« Reply #1 on: May 24, 2013, 11:01:23 AM »
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


Offline visaju

  • Newbie
  • *
  • Posts: 5
Re: Show pictures from known senders
« Reply #2 on: May 27, 2013, 12:38:58 PM »
$message->set_safe(true);

needs to be uncommented.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Re: Show pictures from known senders
« Reply #3 on: June 04, 2013, 01:14:19 AM »
Which CardDAV plugin do you use?
Regards,
Rosali
__________________
MyRoundcube Project (commercial)