Author |
|
rob Groupie
Joined: 03 September 2008 Location: Canada
Online Status: Offline Posts: 60
|
Posted: 02 October 2008 at 1:46pm | IP Logged
|
|
|
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 |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 03 October 2008 at 2:45am | IP Logged
|
|
|
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 |
|
|
ash.eldritch Newbie
Joined: 02 January 2009 Location: Japan
Online Status: Offline Posts: 9
|
Posted: 07 January 2009 at 7:21pm | IP Logged
|
|
|
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 |
|
|