Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-22-2007, 11:10 PM
Intermediate Member
 
Posts: 20
Default check if it is read or unread

I am trying to make a Zimlet which checks if it is read or unread when a mail is opened from a mail list view.

I wrote a code like this.
--------------------------------------------------------------------------
Disposition_Notification.prototype.match =
function(content, startIndex) {

this._ZmMailListController = this._appCtxt.getApp(ZmZimbraMail.MAIL_APP).getMai lListController();

alert("isUnread1 = " + this._ZmMailListController._getMsg().isUnread);
alert("isUnread2 = " + this._ZmMailListController._listView[this._ZmMailListController._currentView].getSelection()[0].isUnread);

};
--------------------------------------------------------------------------

But this code doesn't work well. Because when a mail is opened (for example, double clicked), mail status changes to "read". So when coming to this method, mail is already "read" all the time.

Is there a good way?
Reply With Quote
  #2 (permalink)  
Old 10-23-2007, 06:41 PM
Zimlet Guru & Moderator
 
Posts: 467
Default

Quote:
Originally Posted by Yokomie View Post
I am trying to make a Zimlet which checks if it is read or unread when a mail is opened from a mail list view.

I wrote a code like this.
--------------------------------------------------------------------------
Disposition_Notification.prototype.match =
function(content, startIndex) {

this._ZmMailListController = this._appCtxt.getApp(ZmZimbraMail.MAIL_APP).getMai lListController();

alert("isUnread1 = " + this._ZmMailListController._getMsg().isUnread);
alert("isUnread2 = " + this._ZmMailListController._listView[this._ZmMailListController._currentView].getSelection()[0].isUnread);

};
--------------------------------------------------------------------------

But this code doesn't work well. Because when a mail is opened (for example, double clicked), mail status changes to "read". So when coming to this method, mail is already "read" all the time.

Is there a good way?
Listen for the change view event (notifyZimlets) and check to make sure the screen is the one you want. Since Zimbra will always mark something read when you select (unless you go back and unmark it) you can do your proccessing when the view is updated.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.