[RCD] Breaking the 'mail' / 'addressbook' divide in Roundcube

Thomas Bruederli roundcube at gmail.com
Wed Feb 29 16:17:54 CET 2012

Hi Ian

You pretty much figured out that the current architecture of Roundcube
makes it hard to achieve what you have in mind. However, it's not entirely
impossible. check out the address book widget we now have on the compose
screen in the latest SVN version. It uses a command named 'list-contacts'
which resides in the mail section.

While it's currently bound to the compose step, the code could easily be
moved or adjusted to also work on the main screen. See function
rcmail_contacts_list() in program/steps/mail/compose.inc and line 277 in

But to make a long story short, we'll not refactor our code in the near
future and you'll have to live with a huge patch.

Good luck!

Ian Lewis wrote:
> To provide a brief answer to my own question, providing 'contacts list' 
> functionality on the same page as emails in Roundcube requires an 
> overhaul of the core logic (unless a replacement addressbook is 
> written). The challenge is simply illustrated if you try and place 
> <roundcube:object name='addresslist'> on the 'mail' template. Basic 
> issues seem to be:
> * existing 'shared' logic is hard-coded with tests for task='mail' 
> (populating a template with a list of messages) and task='addressbook' 
> (providing a list of contacts) so that would need to be engineered out 
> to allow use of existing 'addressbook' and 'mail' code on the same page.
> * a small number of the php files in program/steps/mail and 
> program/steps/addressbook have the same name (e.g. list.php) with other 
> code doing an include of program/steps/$task/list.php so the name clash 
> would need files (and their references) renaming.
> * the 'mail' page assumes an action 'list' means 'list emails' while the 
> 'addressbook' page assumes the same command 'list' means 'list 
> contacts'. As far as I can tell this would need re-structuring to use 
> different command names for the two functions for the lists to coexist 
> on the same page (I am re-writing the code to use 'listcontacts' instead 
> of 'list' for the contacts list command.)
> Ian
> _______________________________________________
> List info: http://lists.roundcube.net/dev/
> BT/0ddf6350
List info: http://lists.roundcube.net/dev/

More information about the Dev mailing list