Commit 9f0d7c53 authored by Grigory Fedorov's avatar Grigory Fedorov

Merge branch 'release/1.0.10'

parents 21294b02 581cd0cd
......@@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode 181
versionName '1.0.9'
versionCode 182
versionName '1.0.10'
}
compileOptions {
......
......@@ -62,56 +62,45 @@ public abstract class AbstractChat extends BaseEntity {
* Number of messages from history to be shown for context purpose.
*/
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.
*/
protected boolean active;
/**
* Whether changes in status should be record.
*/
protected boolean trackStatus;
/**
* Whether user never received notifications from this chat.
*/
protected boolean firstNotification;
/**
* Last incoming message's text.
*/
protected String lastText;
/**
* Last message's time.
*/
protected Date lastTime;
/**
* 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;
protected Date creationTime = new Date();
/**
* List of messages to be sent.
* Current thread id.
*/
protected final Collection<MessageItem> sendQuery;
protected Date creationTime = new Date();
private String threadId;
private boolean isLastMessageIncoming;
protected AbstractChat(final String account, final String user) {
......@@ -396,6 +385,11 @@ public abstract class AbstractChat extends BaseEntity {
.getInstance().getSecurityLevel(account, user) != SecurityLevel.plain)))
save = false;
Date timestamp = new Date();
if (text.trim().isEmpty()) {
notify = false;
}
if (notify || !incoming)
openChat();
if (!incoming)
......
......@@ -113,8 +113,10 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
case VIEW_TYPE_ACTION_MESSAGE:
ChatAction action = messageItem.getAction();
String time = StringUtils.getSmartTimeText(context, messageItem.getTimestamp());
String name = RosterManager.getInstance().getBestContact(account, messageItem.getChat().getUser()).getName();
((BasicMessage)holder).messageText.setText(time + ": "
+ action.getText(context, messageItem.getResource(), messageItem.getSpannable().toString()));
+ action.getText(context, name, messageItem.getSpannable().toString()));
break;
case VIEW_TYPE_INCOMING_MESSAGE:
......
......@@ -68,7 +68,7 @@
android:singleLine="true"
android:text="example@example.com"
android:textColor="@color/grey_500"
android:textSize="14sp" />
android:textSize="12sp" />
<TextView
android:id="@+id/status"
......
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