fixed bug allowing to set unread messeages already unread
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/message-conversations@182160 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
fd855668cf
commit
7f439d7eb5
|
@ -18,6 +18,7 @@ import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.uibinder.client.UiHandler;
|
import com.google.gwt.uibinder.client.UiHandler;
|
||||||
import com.google.gwt.user.client.Random;
|
import com.google.gwt.user.client.Random;
|
||||||
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
@ -74,8 +75,9 @@ public class MessageItem extends Composite {
|
||||||
attachmentsIcon.setVisibility(Visibility.VISIBLE);
|
attachmentsIcon.setVisibility(Visibility.VISIBLE);
|
||||||
if (!sent && !m.isRead())
|
if (!sent && !m.isRead())
|
||||||
item.addStyleName("unread-message");
|
item.addStyleName("unread-message");
|
||||||
if (sent)
|
if (sent || !myMessage.isRead()) {
|
||||||
dd.remove(0); //remove the option to set unread if the message is sent
|
dd.remove(0); //remove the option to set unread if the message is sent
|
||||||
|
}
|
||||||
|
|
||||||
if (m.getOwner().getAvatarURL() == null || m.getOwner().getAvatarURL().compareTo("")== 0) {
|
if (m.getOwner().getAvatarURL() == null || m.getOwner().getAvatarURL().compareTo("")== 0) {
|
||||||
if (sent)
|
if (sent)
|
||||||
|
@ -154,9 +156,13 @@ public class MessageItem extends Composite {
|
||||||
@UiHandler("setUnreadButton")
|
@UiHandler("setUnreadButton")
|
||||||
void onSetUnread(ClickEvent e) {
|
void onSetUnread(ClickEvent e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
ap.setMessageUnread(myMessage, this.sent);
|
if (myMessage.isRead()) {
|
||||||
myMessage.setRead(false);
|
ap.setMessageUnread(myMessage, this.sent);
|
||||||
item.addStyleName("unread-message");
|
myMessage.setRead(false);
|
||||||
|
item.addStyleName("unread-message");
|
||||||
|
} else {
|
||||||
|
Window.alert("Message is marked as unread already.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doDelete(String subject) {
|
private void doDelete(String subject) {
|
||||||
|
|
Loading…
Reference in New Issue