Commit 85fc7747 authored by Grigory Fedorov's avatar Grigory Fedorov

Notifications disabled for messages with empty text. #446

parent 3d3f1b8b
...@@ -62,56 +62,45 @@ public abstract class AbstractChat extends BaseEntity { ...@@ -62,56 +62,45 @@ public abstract class AbstractChat extends BaseEntity {
* Number of messages from history to be shown for context purpose. * Number of messages from history to be shown for context purpose.
*/ */
private static final int PRELOADED_MESSAGES = 3; private static final int PRELOADED_MESSAGES = 3;
/** /**
* Current thread id. * Ids of messages not loaded in to the memory.
* <p/>
* MUST BE ACCESSED FROM BACKGROUND THREAD ONLY.
*/ */
private String threadId; protected final Collection<Long> historyIds;
/**
* Sorted list of messages in this chat.
*/
protected final List<MessageItem> messages;
/**
* List of messages to be sent.
*/
protected final Collection<MessageItem> sendQuery;
/** /**
* Whether chat is open and should be displayed as active chat. * Whether chat is open and should be displayed as active chat.
*/ */
protected boolean active; protected boolean active;
/** /**
* Whether changes in status should be record. * Whether changes in status should be record.
*/ */
protected boolean trackStatus; protected boolean trackStatus;
/** /**
* Whether user never received notifications from this chat. * Whether user never received notifications from this chat.
*/ */
protected boolean firstNotification; protected boolean firstNotification;
/** /**
* Last incoming message's text. * Last incoming message's text.
*/ */
protected String lastText; protected String lastText;
/** /**
* Last message's time. * Last message's time.
*/ */
protected Date lastTime; protected Date lastTime;
protected Date creationTime = new Date();
/**
* Ids of messages not loaded in to the memory.
* <p/>
* MUST BE ACCESSED FROM BACKGROUND THREAD ONLY.
*/
protected final Collection<Long> historyIds;
/**
* Sorted list of messages in this chat.
*/
protected final List<MessageItem> messages;
/** /**
* List of messages to be sent. * Current thread id.
*/ */
protected final Collection<MessageItem> sendQuery; private String threadId;
protected Date creationTime = new Date();
private boolean isLastMessageIncoming; private boolean isLastMessageIncoming;
protected AbstractChat(final String account, final String user) { protected AbstractChat(final String account, final String user) {
...@@ -396,6 +385,11 @@ public abstract class AbstractChat extends BaseEntity { ...@@ -396,6 +385,11 @@ public abstract class AbstractChat extends BaseEntity {
.getInstance().getSecurityLevel(account, user) != SecurityLevel.plain))) .getInstance().getSecurityLevel(account, user) != SecurityLevel.plain)))
save = false; save = false;
Date timestamp = new Date(); Date timestamp = new Date();
if (text.trim().isEmpty()) {
notify = false;
}
if (notify || !incoming) if (notify || !incoming)
openChat(); openChat();
if (!incoming) if (!incoming)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment