Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Refresh message list Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
rob
Groupie
Groupie


Joined: 03 September 2008
Location: Canada
Online Status: Offline
Posts: 60
Posted: 02 October 2008 at 1:46pm | IP Logged Quote rob

We are in dire need of some assistance here.

Right now once a message list is generated for a folder it is retained within what appears to be javascript cache of some sort to help speed up the display of the folder for future viewing within the current session.

We are using the cron to auto-check for new email which fetches new messages in and puts them into the database automatically behind the scenes.

The problem here is the message lists for the folders do not reflect the new messages that come in until the Check Mail button is clicked which then forces each folder to obtain a fresh list of messages from the database.

What can be done to make the system obtain a current list of messages via ajax from the database each time the folder is viewed, including the Inbox, Sent, Trash, etc.?

Ideally we would like the message list to automatically refresh itself, but apparently this has been in development for quite some time and yet to come out.

Help

Rob
Back to Top View rob's Profile Search for other posts by rob
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 03 October 2008 at 2:45am | IP Logged Quote Andrew

If you need to just disable the cache, modify webmail.php file, line 210:
Code:
new CDataType(TYPE_MESSAGES_LIST, true, 5, false, { Page: 'page', SortField: 'sort_field', SortOrder: 'sort_order' }, 'messages' ),


change it to:
Code:
new CDataType(TYPE_MESSAGES_LIST, false, 0, false, { Page: 'page', SortField: 'sort_field', SortOrder: 'sort_order' }, 'messages' ),


The second parameter is responsible for using cache for objects of the given type, the third for number of objects stored in the cache.

Another and more efficient way is to implement periodical polling server via an AJAX query. This can be done in terms of a custom project.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
ash.eldritch
Newbie
Newbie


Joined: 02 January 2009
Location: Japan
Online Status: Offline
Posts: 9
Posted: 07 January 2009 at 7:21pm | IP Logged Quote ash.eldritch

The easiest way to do this is to add the following line to the bottom of webmail.aspx, right after the WebMail.DataSource.Get...

setInterval(function() { WebMail.Screens[1]._checkMail.Start() }, 180000);

...This will check every three minutes. It's a bit of a hack, as there may be no guarantee that Screens[1] will always be the right screen, so it should find the right screen more intelligently. The interval should also be reset if the user checks mail manually, which would involve modifying the BuildToolBar function in screen.messages-list.js. If anyone gets around to doing this or any other improvements please post them here.

Cheers
Ash
Back to Top View ash.eldritch's Profile Search for other posts by ash.eldritch
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide